@sinch/conversation 0.0.2 → 0.0.4

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 (111) hide show
  1. package/README.md +28 -13
  2. package/dist/models/v1/agent/agent.d.ts +3 -3
  3. package/dist/models/v1/agent-joined-event/agent-joined-event.d.ts +1 -1
  4. package/dist/models/v1/agent-left-event/agent-left-event.d.ts +1 -1
  5. package/dist/models/v1/app-event/app-event.d.ts +44 -1
  6. package/dist/models/v1/app-message/app-message.d.ts +198 -30
  7. package/dist/models/v1/app-message-message/app-message-message.d.ts +92 -1
  8. package/dist/models/v1/choice/choice.d.ts +17 -5
  9. package/dist/models/v1/comment-reply-event/comment-reply-event.d.ts +1 -1
  10. package/dist/models/v1/composing-end-event/composing-end-event.d.ts +1 -1
  11. package/dist/models/v1/composing-event/composing-event.d.ts +1 -1
  12. package/dist/models/v1/contact-event/contact-event.d.ts +32 -1
  13. package/dist/models/v1/contact-id/contact-id.d.ts +2 -1
  14. package/dist/models/v1/contact-info-message/contact-info-message.d.ts +1 -1
  15. package/dist/models/v1/contact-message/contact-message.d.ts +36 -6
  16. package/dist/models/v1/conversation-channel-credential/conversation-channel-credential.d.ts +3 -10
  17. package/dist/models/v1/conversation-channel-credential/index.d.ts +1 -1
  18. package/dist/models/v1/conversation-event/conversation-event.d.ts +6 -0
  19. package/dist/models/v1/conversation-message/conversation-message.d.ts +4 -2
  20. package/dist/models/v1/generic-event/generic-event.d.ts +1 -1
  21. package/dist/models/v1/get-channel-profile-request/get-channel-profile-request.d.ts +2 -2
  22. package/dist/models/v1/helper.d.ts +17 -9
  23. package/dist/models/v1/helper.js +26 -9
  24. package/dist/models/v1/helper.js.map +1 -1
  25. package/dist/models/v1/identified-by/identified-by.d.ts +1 -0
  26. package/dist/models/v1/index.d.ts +2 -3
  27. package/dist/models/v1/index.js +2 -3
  28. package/dist/models/v1/index.js.map +1 -1
  29. package/dist/models/v1/inject-conversation-event-request/inject-conversation-event-request.d.ts +12 -1
  30. package/dist/models/v1/inject-message-request/inject-message-request.d.ts +4 -2
  31. package/dist/models/v1/list-message/index.d.ts +1 -1
  32. package/dist/models/v1/list-message/list-message.d.ts +8 -3
  33. package/dist/models/v1/list-section/list-section.d.ts +1 -1
  34. package/dist/models/v1/lookup-capability-request/index.d.ts +1 -0
  35. package/dist/models/v1/lookup-capability-request/index.js.map +1 -0
  36. package/dist/models/v1/{lookup-capability/lookup-capability.d.ts → lookup-capability-request/lookup-capability-request.d.ts} +2 -2
  37. package/dist/models/v1/{query-capability-response/index.js → lookup-capability-request/lookup-capability-request.js} +1 -1
  38. package/dist/models/v1/lookup-capability-request/lookup-capability-request.js.map +1 -0
  39. package/dist/models/v1/lookup-capability-response/index.d.ts +1 -0
  40. package/dist/models/v1/lookup-capability-response/index.js.map +1 -0
  41. package/dist/models/v1/{query-capability-response/query-capability-response.d.ts → lookup-capability-response/lookup-capability-response.d.ts} +1 -1
  42. package/dist/models/v1/{lookup-capability/lookup-capability.js → lookup-capability-response/lookup-capability-response.js} +1 -1
  43. package/dist/models/v1/lookup-capability-response/lookup-capability-response.js.map +1 -0
  44. package/dist/models/v1/mod-callback-events/capability-event/capability-event.d.ts +2 -14
  45. package/dist/models/v1/mod-callback-events/channel-event/channel-event.d.ts +4 -15
  46. package/dist/models/v1/mod-callback-events/contact-create-event/contact-create-event.d.ts +2 -14
  47. package/dist/models/v1/mod-callback-events/contact-delete-event/contact-delete-event.d.ts +2 -14
  48. package/dist/models/v1/mod-callback-events/contact-identities-duplication-event/contact-identities-duplication-event.d.ts +2 -14
  49. package/dist/models/v1/mod-callback-events/contact-merge-event/contact-merge-event.d.ts +2 -14
  50. package/dist/models/v1/mod-callback-events/contact-update-event/contact-update-event.d.ts +2 -14
  51. package/dist/models/v1/mod-callback-events/conversation-callback-event/conversation-callback-event.d.ts +13 -0
  52. package/dist/models/v1/mod-callback-events/conversation-delete-event/conversation-delete-event.d.ts +2 -14
  53. package/dist/models/v1/mod-callback-events/conversation-start-event/conversation-start-event.d.ts +2 -14
  54. package/dist/models/v1/mod-callback-events/conversation-stop-event/conversation-stop-event.d.ts +2 -14
  55. package/dist/models/v1/mod-callback-events/event-delivery/event-delivery.d.ts +2 -14
  56. package/dist/models/v1/mod-callback-events/event-inbound/event-inbound.d.ts +2 -14
  57. package/dist/models/v1/mod-callback-events/message-delivery-receipt-event/message-delivery-receipt-event.d.ts +2 -14
  58. package/dist/models/v1/mod-callback-events/message-inbound-event/message-inbound-event.d.ts +2 -14
  59. package/dist/models/v1/mod-callback-events/message-inbound-event-item/message-inbound-event-item.d.ts +3 -3
  60. package/dist/models/v1/mod-callback-events/message-inbound-smart-conversation-redaction-event/message-inbound-smart-conversation-redaction-event.d.ts +2 -14
  61. package/dist/models/v1/mod-callback-events/message-submit-event/message-submit-event.d.ts +2 -14
  62. package/dist/models/v1/mod-callback-events/opt-in-event/opt-in-event.d.ts +2 -14
  63. package/dist/models/v1/mod-callback-events/opt-out-event/opt-out-event.d.ts +2 -14
  64. package/dist/models/v1/mod-callback-events/record-notification/record-notification.d.ts +2 -14
  65. package/dist/models/v1/mod-callback-events/smart-conversations-event/smart-conversations-event.d.ts +2 -14
  66. package/dist/models/v1/mod-callback-events/unsupported-callback-event/unsupported-callback-event.d.ts +2 -14
  67. package/dist/models/v1/send-event-request/index.d.ts +1 -1
  68. package/dist/models/v1/send-event-request/send-event-request.d.ts +37 -5
  69. package/dist/models/v1/send-message-request/index.d.ts +1 -1
  70. package/dist/models/v1/send-message-request/send-message-request.d.ts +53 -6
  71. package/dist/models/v1/transcode-message-response/transcode-message-response.d.ts +2 -1
  72. package/dist/models/v1/v2-template-translation/index.d.ts +1 -1
  73. package/dist/models/v1/v2-template-translation/v2-template-translation.d.ts +94 -10
  74. package/dist/rest/v1/capability/capability-api.d.ts +5 -5
  75. package/dist/rest/v1/capability/capability-api.jest.fixture.d.ts +5 -3
  76. package/dist/rest/v1/capability/capability-api.jest.fixture.js +1 -1
  77. package/dist/rest/v1/capability/capability-api.jest.fixture.js.map +1 -1
  78. package/dist/rest/v1/capability/capability-api.js +1 -1
  79. package/dist/rest/v1/capability/capability-api.js.map +1 -1
  80. package/dist/rest/v1/contact/contact-api.d.ts +7 -6
  81. package/dist/rest/v1/contact/contact-api.jest.fixture.d.ts +4 -2
  82. package/dist/rest/v1/contact/contact-api.jest.fixture.js.map +1 -1
  83. package/dist/rest/v1/contact/contact-api.js +3 -2
  84. package/dist/rest/v1/contact/contact-api.js.map +1 -1
  85. package/dist/rest/v1/events/events-api.d.ts +66 -5
  86. package/dist/rest/v1/events/events-api.jest.fixture.d.ts +39 -3
  87. package/dist/rest/v1/events/events-api.jest.fixture.js +24 -0
  88. package/dist/rest/v1/events/events-api.jest.fixture.js.map +1 -1
  89. package/dist/rest/v1/events/events-api.js +56 -3
  90. package/dist/rest/v1/events/events-api.js.map +1 -1
  91. package/dist/rest/v1/messages/messages-api.d.ts +96 -5
  92. package/dist/rest/v1/messages/messages-api.jest.fixture.d.ts +59 -3
  93. package/dist/rest/v1/messages/messages-api.jest.fixture.js +36 -0
  94. package/dist/rest/v1/messages/messages-api.jest.fixture.js.map +1 -1
  95. package/dist/rest/v1/messages/messages-api.js +80 -3
  96. package/dist/rest/v1/messages/messages-api.js.map +1 -1
  97. package/package.json +2 -2
  98. package/dist/models/v1/list-message-message-properties/index.d.ts +0 -1
  99. package/dist/models/v1/list-message-message-properties/index.js.map +0 -1
  100. package/dist/models/v1/list-message-message-properties/list-message-message-properties.d.ts +0 -9
  101. package/dist/models/v1/list-message-message-properties/list-message-message-properties.js +0 -3
  102. package/dist/models/v1/list-message-message-properties/list-message-message-properties.js.map +0 -1
  103. package/dist/models/v1/lookup-capability/index.d.ts +0 -1
  104. package/dist/models/v1/lookup-capability/index.js.map +0 -1
  105. package/dist/models/v1/lookup-capability/lookup-capability.js.map +0 -1
  106. package/dist/models/v1/query-capability-response/index.d.ts +0 -1
  107. package/dist/models/v1/query-capability-response/index.js.map +0 -1
  108. package/dist/models/v1/query-capability-response/query-capability-response.js +0 -3
  109. package/dist/models/v1/query-capability-response/query-capability-response.js.map +0 -1
  110. /package/dist/models/v1/{list-message-message-properties → lookup-capability-request}/index.js +0 -0
  111. /package/dist/models/v1/{lookup-capability → lookup-capability-response}/index.js +0 -0
@@ -4,20 +4,8 @@ import { ConversationCallbackEvent } from '../conversation-callback-event';
4
4
  * This callback is sent when a new contact is deleted.
5
5
  */
6
6
  export interface ContactDeleteEvent extends ConversationCallbackEvent {
7
- /** Id of the subscribed app. */
8
- app_id?: string;
9
- /** Timestamp marking when the channel callback was accepted/received by the Conversation API. */
10
- accepted_time?: Date;
11
- /** Timestamp of the event as provided by the underlying channels. */
12
- event_time?: Date;
13
- /** The project ID of the app which has subscribed for the callback. */
14
- project_id?: string;
15
- /** Context-dependent metadata. Refer to specific callback's documentation for exact information provided. */
16
- message_metadata?: string;
17
- /** The value provided in field correlation_id of a send message request. */
18
- correlation_id?: string;
19
- /** @see ContactNotification */
20
- contact_delete_notification?: ContactNotification;
21
7
  /** Name of the trigger responsible for this event. */
22
8
  trigger: 'CONTACT_DELETE';
9
+ /** @see ContactNotification */
10
+ contact_delete_notification?: ContactNotification;
23
11
  }
@@ -4,22 +4,10 @@ import { ConversationCallbackEvent } from '../conversation-callback-event';
4
4
  * This callback is sent when duplicates of channel identities are found between multiple contacts in the contact database during message and event processing.
5
5
  */
6
6
  export interface ContactIdentitiesDuplicationEvent extends ConversationCallbackEvent {
7
- /** Id of the subscribed app. */
8
- app_id?: string;
9
- /** Timestamp marking when the channel callback was accepted/received by the Conversation API. */
10
- accepted_time?: Date;
11
- /** Timestamp of the event as provided by the underlying channels. */
12
- event_time?: Date;
13
- /** The project ID of the app which has subscribed for the callback. */
14
- project_id?: string;
15
- /** Context-dependent metadata. Refer to specific callback's documentation for exact information provided. */
16
- message_metadata?: string;
17
- /** The value provided in field correlation_id of a send message request. */
18
- correlation_id?: string;
19
- /** @see DuplicatedIdentitiesEvent */
20
- duplicated_contact_identities_notification: DuplicatedIdentitiesEvent;
21
7
  /** Name of the trigger responsible for this event. */
22
8
  trigger: 'CONTACT_IDENTITIES_DUPLICATION';
9
+ /** @see DuplicatedIdentitiesEvent */
10
+ duplicated_contact_identities_notification: DuplicatedIdentitiesEvent;
23
11
  }
24
12
  export interface DuplicatedIdentitiesEvent {
25
13
  /** List of DuplicatedIdentities */
@@ -4,22 +4,10 @@ import { ConversationCallbackEvent } from '../conversation-callback-event';
4
4
  * This callback is sent when two contacts are merged.
5
5
  */
6
6
  export interface ContactMergeEvent extends ConversationCallbackEvent {
7
- /** Id of the subscribed app. */
8
- app_id?: string;
9
- /** Timestamp marking when the channel callback was accepted/received by the Conversation API. */
10
- accepted_time?: Date;
11
- /** Timestamp of the event as provided by the underlying channels. */
12
- event_time?: Date;
13
- /** The project ID of the app which has subscribed for the callback. */
14
- project_id?: string;
15
- /** Context-dependent metadata. Refer to specific callback's documentation for exact information provided. */
16
- message_metadata?: string;
17
- /** The value provided in field correlation_id of a send message request. */
18
- correlation_id?: string;
19
- /** @see ContactMergeEventContactMergeNotification */
20
- contact_merge_notification?: ContactMergeNotification;
21
7
  /** Name of the trigger responsible for this event. */
22
8
  trigger: 'CONTACT_MERGE';
9
+ /** @see ContactMergeNotification */
10
+ contact_merge_notification?: ContactMergeNotification;
23
11
  }
24
12
  export interface ContactMergeNotification {
25
13
  /** @see Contact */
@@ -4,20 +4,8 @@ import { ConversationCallbackEvent } from '../conversation-callback-event';
4
4
  * This callback is sent when a new contact is updated.
5
5
  */
6
6
  export interface ContactUpdateEvent extends ConversationCallbackEvent {
7
- /** Id of the subscribed app. */
8
- app_id?: string;
9
- /** Timestamp marking when the channel callback was accepted/received by the Conversation API. */
10
- accepted_time?: Date;
11
- /** Timestamp of the event as provided by the underlying channels. */
12
- event_time?: Date;
13
- /** The project ID of the app which has subscribed for the callback. */
14
- project_id?: string;
15
- /** Context-dependent metadata. Refer to specific callback's documentation for exact information provided. */
16
- message_metadata?: string;
17
- /** The value provided in field correlation_id of a send message request. */
18
- correlation_id?: string;
19
- /** @see ContactNotification */
20
- contact_update_notification?: ContactNotification;
21
7
  /** Name of the trigger responsible for this event. */
22
8
  trigger: 'CONTACT_UPDATE';
9
+ /** @see ContactNotification */
10
+ contact_update_notification?: ContactNotification;
23
11
  }
@@ -1,4 +1,17 @@
1
1
  import { WebhookTrigger } from '../../webhook-trigger';
2
2
  export interface ConversationCallbackEvent {
3
+ /** Id of the subscribed app. */
4
+ app_id?: string;
5
+ /** Timestamp marking when the channel callback was accepted/received by the Conversation API. */
6
+ accepted_time?: Date;
7
+ /** Timestamp of the event as provided by the underlying channels. */
8
+ event_time?: Date;
9
+ /** The project ID of the app which has subscribed for the callback. */
10
+ project_id?: string;
11
+ /** Context-dependent metadata. Refer to specific callback's documentation for exact information provided. */
12
+ message_metadata?: string;
13
+ /** The value provided in field correlation_id of a send message request. */
14
+ correlation_id?: string;
15
+ /** Name of the trigger responsible for this event. */
3
16
  trigger: WebhookTrigger;
4
17
  }
@@ -4,22 +4,10 @@ import { ConversationCallbackEvent } from '../conversation-callback-event';
4
4
  * This callback is sent when a conversation between the subscribed app and a contact is deleted.
5
5
  */
6
6
  export interface ConversationDeleteEvent extends ConversationCallbackEvent {
7
- /** Id of the subscribed app. */
8
- app_id?: string;
9
- /** Timestamp marking when the channel callback was accepted/received by the Conversation API. */
10
- accepted_time?: string;
11
- /** Timestamp of the event as provided by the underlying channels. */
12
- event_time?: string;
13
- /** The project ID of the app which has subscribed for the callback. */
14
- project_id?: string;
15
- /** Context-dependent metadata. Refer to specific callback\'s documentation for exact information provided. */
16
- message_metadata?: string;
17
- /** The value provided in field correlation_id of a send message request. */
18
- correlation_id?: string;
19
- /** @see ConversationNotification */
20
- conversation_delete_notification?: ConversationNotification;
21
7
  /** Name of the trigger responsible for this event. */
22
8
  trigger: 'CONVERSATION_DELETE';
9
+ /** @see ConversationNotification */
10
+ conversation_delete_notification?: ConversationNotification;
23
11
  }
24
12
  /**
25
13
  * Object containing the details of the deleted conversation
@@ -4,22 +4,10 @@ import { ConversationCallbackEvent } from '../conversation-callback-event';
4
4
  * This callback is sent when a new conversation between the subscribed app and a contact is started.
5
5
  */
6
6
  export interface ConversationStartEvent extends ConversationCallbackEvent {
7
- /** Id of the subscribed app. */
8
- app_id?: string;
9
- /** Timestamp marking when the channel callback was accepted/received by the Conversation API. */
10
- accepted_time?: Date;
11
- /** Timestamp of the event as provided by the underlying channels. */
12
- event_time?: Date;
13
- /** The project ID of the app which has subscribed for the callback. */
14
- project_id?: string;
15
- /** Context-dependent metadata. Refer to specific callback's documentation for exact information provided. */
16
- message_metadata?: string;
17
- /** The value provided in field correlation_id of a send message request. */
18
- correlation_id?: string;
19
- /** @see Conversation */
20
- conversation_start_notification?: ConversationNotification;
21
7
  /** Name of the trigger responsible for this event. */
22
8
  trigger: 'CONVERSATION_START';
9
+ /** @see ConversationNotification */
10
+ conversation_start_notification?: ConversationNotification;
23
11
  }
24
12
  /**
25
13
  * Object containing the details of the started conversation
@@ -4,22 +4,10 @@ import { ConversationCallbackEvent } from '../conversation-callback-event';
4
4
  * This callback is sent when a conversation between the subscribed app and a contact is stopped.
5
5
  */
6
6
  export interface ConversationStopEvent extends ConversationCallbackEvent {
7
- /** Id of the subscribed app. */
8
- app_id?: string;
9
- /** Timestamp marking when the channel callback was accepted/received by the Conversation API. */
10
- accepted_time?: string;
11
- /** Timestamp of the event as provided by the underlying channels. */
12
- event_time?: string;
13
- /** The project ID of the app which has subscribed for the callback. */
14
- project_id?: string;
15
- /** Context-dependent metadata. Refer to specific callback\'s documentation for exact information provided. */
16
- message_metadata?: string;
17
- /** The value provided in field correlation_id of a send message request. */
18
- correlation_id?: string;
19
- /** @see Conversation */
20
- conversation_stop_notification?: ConversationNotification;
21
7
  /** Name of the trigger responsible for this event. */
22
8
  trigger: 'CONVERSATION_STOP';
9
+ /** @see ConversationNotification */
10
+ conversation_stop_notification?: ConversationNotification;
23
11
  }
24
12
  /**
25
13
  * Object containing the details of the stopped conversation
@@ -3,22 +3,10 @@ import { Reason } from '../../reason';
3
3
  import { ConversationCallbackEvent } from '../conversation-callback-event';
4
4
  import { DeliveryStatus, ProcessingMode } from '../../enums';
5
5
  export interface EventDelivery extends ConversationCallbackEvent {
6
- /** Id of the subscribed app. */
7
- app_id?: string;
8
- /** Timestamp marking when the channel callback was accepted/received by the Conversation API. */
9
- accepted_time?: Date;
10
- /** Timestamp of the event as provided by the underlying channels. */
11
- event_time?: Date;
12
- /** The project ID of the app which has subscribed for the callback. */
13
- project_id?: string;
14
- /** Context-dependent metadata. Refer to specific callback's documentation for exact information provided. */
15
- message_metadata?: string;
16
- /** The value provided in field correlation_id of a send message request. */
17
- correlation_id?: string;
18
- /** @see EventDeliveryEventDeliveryReport */
19
- event_delivery_report?: EventDeliveryReport;
20
6
  /** Name of the trigger responsible for this event. */
21
7
  trigger: 'EVENT_DELIVERY';
8
+ /** @see EventDeliveryReport */
9
+ event_delivery_report?: EventDeliveryReport;
22
10
  }
23
11
  export interface EventDeliveryReport {
24
12
  /** The ID of the app event. */
@@ -4,22 +4,10 @@ import { ProcessingMode } from '../../enums';
4
4
  import { ContactEvent } from '../../contact-event';
5
5
  import { ContactMessageEvent } from '../../contact-message-event';
6
6
  export interface EventInbound extends ConversationCallbackEvent {
7
- /** Id of the subscribed app. */
8
- app_id?: string;
9
- /** Timestamp marking when the channel callback was accepted/received by the Conversation API. */
10
- accepted_time?: Date;
11
- /** Timestamp of the event as provided by the underlying channels. */
12
- event_time?: Date;
13
- /** The project ID of the app which has subscribed for the callback. */
14
- project_id?: string;
15
- /** Context-dependent metadata. Refer to specific callback\'s documentation for exact information provided. */
16
- message_metadata?: string;
17
- /** The value provided in field correlation_id of a send message request. */
18
- correlation_id?: string;
19
- /** @see EventInboundEvent */
20
- event?: EventInboundEvent;
21
7
  /** Name of the trigger responsible for this event. */
22
8
  trigger: 'EVENT_INBOUND';
9
+ /** @see EventInboundEvent */
10
+ event?: EventInboundEvent;
23
11
  }
24
12
  export interface EventInboundEvent {
25
13
  /** The event ID. */
@@ -6,22 +6,10 @@ import { DeliveryStatus, ProcessingMode } from '../../enums';
6
6
  * This callback notifies the API clients about status changes of already sent app message.
7
7
  */
8
8
  export interface MessageDeliveryReceiptEvent extends ConversationCallbackEvent {
9
- /** Id of the subscribed app. */
10
- app_id?: string;
11
- /** Timestamp marking when the channel callback was accepted/received by the Conversation API. */
12
- accepted_time?: Date;
13
- /** Timestamp of the event as provided by the underlying channels. */
14
- event_time?: Date;
15
- /** The project ID of the app which has subscribed for the callback. */
16
- project_id?: string;
17
- /** Context-dependent metadata. Refer to specific callback's documentation for exact information provided. */
18
- message_metadata?: string;
19
- /** The value provided in field correlation_id of a send message request. */
20
- correlation_id?: string;
21
- /** @see MessageDeliveryReceiptEventMessageDeliveryReport */
22
- message_delivery_report?: MessageDeliveryReport;
23
9
  /** Name of the trigger responsible for this event. */
24
10
  trigger: 'MESSAGE_DELIVERY';
11
+ /** @see MessageDeliveryReport */
12
+ message_delivery_report?: MessageDeliveryReport;
25
13
  }
26
14
  export interface MessageDeliveryReport {
27
15
  /** The ID of the app message. */
@@ -4,20 +4,8 @@ import { ConversationCallbackEvent } from '../conversation-callback-event';
4
4
  * This callback delivers contact (end-user) messages to the API clients.
5
5
  */
6
6
  export interface MessageInboundEvent extends ConversationCallbackEvent {
7
- /** Id of the subscribed app. */
8
- app_id?: string;
9
- /** Timestamp marking when the channel callback was accepted/received by the Conversation API. */
10
- accepted_time?: Date;
11
- /** Timestamp of the event as provided by the underlying channels. */
12
- event_time?: Date;
13
- /** The project ID of the app which has subscribed for the callback. */
14
- project_id?: string;
15
- /** Context-dependent metadata. Refer to specific callback's documentation for exact information provided. */
16
- message_metadata?: string;
17
- /** The value provided in field correlation_id of a send message request. */
18
- correlation_id?: string;
19
- /** @see MessageInboundEventItem */
20
- message?: MessageInboundEventItem;
21
7
  /** Name of the trigger responsible for this event. */
22
8
  trigger: 'MESSAGE_INBOUND';
9
+ /** @see MessageInboundEventItem */
10
+ message?: MessageInboundEventItem;
23
11
  }
@@ -4,7 +4,7 @@ import { ProcessingMode } from '../../enums';
4
4
  export interface MessageInboundEventItem {
5
5
  /** The message ID. */
6
6
  id?: string;
7
- /** The direction of the message, it\'s always TO_APP for contact messages. */
7
+ /** The direction of the message, it's always TO_APP for contact messages. */
8
8
  direction?: 'TO_APP';
9
9
  /** @see ContactMessage */
10
10
  contact_message?: ContactMessage;
@@ -14,10 +14,10 @@ export interface MessageInboundEventItem {
14
14
  conversation_id?: string;
15
15
  /** The ID of the contact. Will be empty if processing_mode is DISPATCH. */
16
16
  contact_id?: string;
17
- /** Usually, metadata specific to the underlying channel is provided in this field. Refer to the individual channels\' documentation for more information (for example, SMS delivery receipts). Note that, for Choice message responses, this field is populated with the value of the message_metadata field of the corresponding Send message request. */
17
+ /** Usually, metadata specific to the underlying channel is provided in this field. Refer to the individual channels' documentation for more information (for example, SMS delivery receipts). Note that, for Choice message responses, this field is populated with the value of the message_metadata field of the corresponding Send message request. */
18
18
  metadata?: string;
19
19
  /** Timestamp marking when the channel callback was received by the Conversation API. */
20
- accept_time?: string;
20
+ accept_time?: Date;
21
21
  /** The sender ID to which the contact sent the message, if applicable. For example, originator msisdn/short code for SMS and MMS. */
22
22
  sender_id?: string;
23
23
  /** Whether or not Conversation API should store contacts and conversations for the app. For more information, see [Processing Modes](../../../../../conversation/processing-modes/). */
@@ -4,20 +4,8 @@ import { ConversationCallbackEvent } from '../conversation-callback-event';
4
4
  * This callback delivers contact (end-user) messages to the API clients. The content of the message goes through an A.I. analysis and is redacted if required.
5
5
  */
6
6
  export interface MessageInboundSmartConversationRedactionEvent extends ConversationCallbackEvent {
7
- /** Id of the subscribed app. */
8
- app_id?: string;
9
- /** Timestamp marking when the channel callback was accepted/received by the Conversation API. */
10
- accepted_time?: Date;
11
- /** Timestamp of the event as provided by the underlying channels. */
12
- event_time?: Date;
13
- /** The project ID of the app which has subscribed for the callback. */
14
- project_id?: string;
15
- /** Context-dependent metadata. Refer to specific callback's documentation for exact information provided. */
16
- message_metadata?: string;
17
- /** The value provided in field correlation_id of a send message request. */
18
- correlation_id?: string;
19
- /** @see MessageInboundEventItem */
20
- message_redaction?: MessageInboundEventItem;
21
7
  /** Name of the trigger responsible for this event. */
22
8
  trigger: 'MESSAGE_INBOUND_SMART_CONVERSATION_REDACTION';
9
+ /** @see MessageInboundEventItem */
10
+ message_redaction?: MessageInboundEventItem;
23
11
  }
@@ -6,22 +6,10 @@ import { ProcessingMode } from '../../enums';
6
6
  * This callback provides a notification to the API clients that the corresponding app message was submitted to a channel. This notification is created before any confirmation from Delivery Receipts.
7
7
  */
8
8
  export interface MessageSubmitEvent extends ConversationCallbackEvent {
9
- /** Id of the subscribed app. */
10
- app_id?: string;
11
- /** Timestamp marking when the channel callback was accepted/received by the Conversation API. */
12
- accepted_time?: Date;
13
- /** Timestamp of the event as provided by the underlying channels. */
14
- event_time?: Date;
15
- /** The project ID of the app which has subscribed for the callback. */
16
- project_id?: string;
17
- /** Context-dependent metadata. Refer to specific callback's documentation for exact information provided. */
18
- message_metadata?: string;
19
- /** The value provided in field correlation_id of a send message request. */
20
- correlation_id?: string;
21
- /** @see MessageSubmitEventMessageSubmitNotification */
22
- message_submit_notification?: MessageSubmitNotification;
23
9
  /** Name of the trigger responsible for this event. */
24
10
  trigger: 'MESSAGE_SUBMIT';
11
+ /** @see MessageSubmitNotification */
12
+ message_submit_notification?: MessageSubmitNotification;
25
13
  }
26
14
  export interface MessageSubmitNotification {
27
15
  /** The ID of the app message. */
@@ -5,22 +5,10 @@ import { ProcessingMode } from '../../enums';
5
5
  * This callback is used to deliver opt-in notifications from the channels.
6
6
  */
7
7
  export interface OptInEvent extends ConversationCallbackEvent {
8
- /** Id of the subscribed app. */
9
- app_id?: string;
10
- /** Timestamp marking when the channel callback was accepted/received by the Conversation API. */
11
- accepted_time?: Date;
12
- /** Timestamp of the event as provided by the underlying channels. */
13
- event_time?: Date;
14
- /** The project ID of the app which has subscribed for the callback. */
15
- project_id?: string;
16
- /** Context-dependent metadata. Refer to specific callback\'s documentation for exact information provided. */
17
- message_metadata?: string;
18
- /** The value provided in field correlation_id of a send message request. */
19
- correlation_id?: string;
20
- /** @see OptInNotification */
21
- opt_in_notification?: OptInNotification;
22
8
  /** Name of the trigger responsible for this event. */
23
9
  trigger: 'OPT_IN';
10
+ /** @see OptInNotification */
11
+ opt_in_notification?: OptInNotification;
24
12
  }
25
13
  export interface OptInNotification {
26
14
  /** ID generated when making an opt-in registration request. Can be used to detect duplicates. */
@@ -5,22 +5,10 @@ import { ProcessingMode } from '../../enums';
5
5
  * This callback is used to deliver opt-out notifications from the channels.
6
6
  */
7
7
  export interface OptOutEvent extends ConversationCallbackEvent {
8
- /** Id of the subscribed app. */
9
- app_id?: string;
10
- /** Timestamp marking when the channel callback was accepted/received by the Conversation API. */
11
- accepted_time?: Date;
12
- /** Timestamp of the event as provided by the underlying channels. */
13
- event_time?: Date;
14
- /** The project ID of the app which has subscribed for the callback. */
15
- project_id?: string;
16
- /** Context-dependent metadata. Refer to specific callback's documentation for exact information provided. */
17
- message_metadata?: string;
18
- /** The value provided in field correlation_id of a send message request. */
19
- correlation_id?: string;
20
- /** @see OptOutNotification */
21
- opt_out_notification?: OptOutNotification;
22
8
  /** Name of the trigger responsible for this event. */
23
9
  trigger: 'OPT_OUT';
10
+ /** @see OptOutNotification */
11
+ opt_out_notification?: OptOutNotification;
24
12
  }
25
13
  export interface OptOutNotification {
26
14
  /** ID generated when making an opt-out registration request. Can be used to detect duplicates. */
@@ -3,22 +3,10 @@ import { ChannelIdentity } from '../../channel-identity';
3
3
  import { ProcessingMode } from '../../enums';
4
4
  import { Reason } from '../../reason';
5
5
  export interface RecordNotificationEvent extends ConversationCallbackEvent {
6
- /** Id of the subscribed app. */
7
- app_id?: string;
8
- /** Timestamp marking when the channel callback was accepted/received by the Conversation API. */
9
- accepted_time?: Date;
10
- /** Timestamp of the event as provided by the underlying channels. */
11
- event_time?: Date;
12
- /** The project ID of the app which has subscribed for the callback. */
13
- project_id?: string;
14
- /** Context-dependent metadata. Refer to specific callback's documentation for exact information provided. */
15
- message_metadata?: string;
16
- /** The value provided in field correlation_id of a send message request. */
17
- correlation_id?: string;
18
- /** @see SmartConversationNotification */
19
- record_notification?: RecordNotification;
20
6
  /** Name of the trigger responsible for this event. */
21
7
  trigger: 'RECORD_NOTIFICATION';
8
+ /** @see RecordNotification */
9
+ record_notification?: RecordNotification;
22
10
  }
23
11
  export interface RecordNotification {
24
12
  /** Required. The ID of the entity. */
@@ -4,22 +4,10 @@ import { ConversationCallbackEvent } from '../conversation-callback-event';
4
4
  * When using the Smart Conversations functionality, Machine Learning and Artificial Intelligence analyses are delivered through specific callbacks on the Conversation API.
5
5
  */
6
6
  export interface SmartConversationsEvent extends ConversationCallbackEvent {
7
- /** Id of the subscribed app. */
8
- app_id?: string;
9
- /** Timestamp marking when the channel callback was accepted/received by the Conversation API. */
10
- accepted_time?: Date;
11
- /** Timestamp of the event as provided by the underlying channels. */
12
- event_time?: Date;
13
- /** The project ID of the app which has subscribed for the callback. */
14
- project_id?: string;
15
- /** Context-dependent metadata. Refer to specific callback's documentation for exact information provided. */
16
- message_metadata?: string;
17
- /** The value provided in field correlation_id of a send message request. */
18
- correlation_id?: string;
19
- /** @see SmartConversationNotification */
20
- smart_conversation_notification?: SmartConversationNotification;
21
7
  /** Name of the trigger responsible for this event. */
22
8
  trigger: 'SMART_CONVERSATIONS';
9
+ /** @see SmartConversationNotification */
10
+ smart_conversation_notification?: SmartConversationNotification;
23
11
  }
24
12
  export interface SmartConversationNotification {
25
13
  /** The unique ID of the contact that sent the message. */
@@ -6,22 +6,10 @@ import { ProcessingMode } from '../../enums';
6
6
  * Some of the callbacks received from the underlying channels might be specific to a single channel or may not have a proper mapping in Conversation API yet.
7
7
  */
8
8
  export interface UnsupportedCallbackEvent extends ConversationCallbackEvent {
9
- /** Id of the subscribed app. */
10
- app_id?: string;
11
- /** Timestamp marking when the channel callback was accepted/received by the Conversation API. */
12
- accepted_time?: Date;
13
- /** Timestamp of the event as provided by the underlying channels. */
14
- event_time?: Date;
15
- /** The project ID of the app which has subscribed for the callback. */
16
- project_id?: string;
17
- /** Context-dependent metadata. Refer to specific callback's documentation for exact information provided. */
18
- message_metadata?: string;
19
- /** The value provided in field correlation_id of a send message request. */
20
- correlation_id?: string;
21
- /** @see UnsupportedCallback */
22
- unsupported_callback?: UnsupportedCallback;
23
9
  /** Name of the trigger responsible for this event. */
24
10
  trigger: 'UNSUPPORTED';
11
+ /** @see UnsupportedCallback */
12
+ unsupported_callback?: UnsupportedCallback;
25
13
  }
26
14
  export interface UnsupportedCallback {
27
15
  /** @see ConversationChannel */
@@ -1 +1 @@
1
- export type { SendEventRequest } from './send-event-request';
1
+ export type { SendEventRequest, SendComposingEventRequest, SendComposingEndEventRequest, SendCommentReplyEventRequest, SendAgentJoinedEventRequest, SendAgentLeftEventRequest, SendGenericEventRequest, } from './send-event-request';
@@ -1,20 +1,52 @@
1
- import { AppEvent } from '../app-event';
2
1
  import { ConversationChannel } from '../conversation-channel';
3
2
  import { Recipient } from '../recipient';
4
3
  import { MessageQueue } from '../enums';
5
- export interface SendEventRequest {
4
+ import { ComposingEvent } from '../composing-event';
5
+ import { ComposingEndEvent } from '../composing-end-event';
6
+ import { CommentReplyEvent } from '../comment-reply-event';
7
+ import { AgentJoinedEvent } from '../agent-joined-event';
8
+ import { AgentLeftEvent } from '../agent-left-event';
9
+ import { GenericEvent } from '../generic-event';
10
+ import { AppEvent } from '../app-event';
11
+ export interface SendEventRequestBase<T extends Recipient> {
6
12
  /** The ID of the app sending the event. */
7
13
  app_id: string;
8
14
  /** Overwrites the default callback url for delivery receipts for this message The REST URL should be of the form: `http://host[:port]/path` */
9
15
  callback_url?: string;
10
16
  /** Optional. A single element array that dictates on what channel should the Conversation API try to send the event. It overrides any default set on the contact. Providing more than one option has no effect. */
11
17
  channel_priority_order?: ConversationChannel[];
12
- /** @see AppEvent */
13
- event: AppEvent;
14
18
  /** Optional. Eventual metadata that should be associated to the event. */
15
19
  event_metadata?: string;
16
20
  /** @see MessageQueue */
17
21
  queue?: MessageQueue;
18
22
  /** @see Recipient */
19
- recipient: Recipient;
23
+ recipient: T;
24
+ }
25
+ export interface SendEventRequest<T extends Recipient> extends SendEventRequestBase<T> {
26
+ /** @see AppEvent */
27
+ event: AppEvent;
28
+ }
29
+ export interface SendComposingEventRequest<T extends Recipient> extends SendEventRequestBase<T> {
30
+ /** @see ComposingEvent */
31
+ event: ComposingEvent;
32
+ }
33
+ export interface SendComposingEndEventRequest<T extends Recipient> extends SendEventRequestBase<T> {
34
+ /** @see ComposingEndEvent */
35
+ event: ComposingEndEvent;
36
+ }
37
+ export interface SendCommentReplyEventRequest<T extends Recipient> extends SendEventRequestBase<T> {
38
+ /** @see CommentReplyEvent */
39
+ event: CommentReplyEvent;
40
+ }
41
+ export interface SendAgentJoinedEventRequest<T extends Recipient> extends SendEventRequestBase<T> {
42
+ /** @see AgentJoinedEvent */
43
+ event: AgentJoinedEvent;
44
+ }
45
+ export interface SendAgentLeftEventRequest<T extends Recipient> extends SendEventRequestBase<T> {
46
+ /** @see AgentLeftEvent */
47
+ event: AgentLeftEvent;
48
+ }
49
+ export interface SendGenericEventRequest<T extends Recipient> extends SendEventRequestBase<T> {
50
+ /** @see GenericEvent */
51
+ event: GenericEvent;
20
52
  }
@@ -1 +1 @@
1
- export type { SendMessageRequest } from './send-message-request';
1
+ export type { SendMessageRequest, SendCardMessageRequest, SendCarouselMessageRequest, SendChoiceMessageRequest, SendContactInfoMessageRequest, SendLocationMessageRequest, SendMediaMessageRequest, SendTemplateMessageRequest, SendTextMessageRequest, SendListMessageRequest, } from './send-message-request';