Skip to content

Commit

Permalink
refactor callback-events and credentials
Browse files Browse the repository at this point in the history
  • Loading branch information
asein-sinch committed Feb 13, 2024
1 parent 3e18a93 commit d2772e1
Show file tree
Hide file tree
Showing 77 changed files with 84 additions and 80 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
import { ConversationChannel } from '../conversation-channel';
import { KakaoTalkCredentials } from '../kakaotalk-credentials';
import { KakaoTalkChatCredentials } from '../kakaotalkchat-credentials';
import { LineCredentials } from '../line-credentials';
import { MMSCredentials } from '../mms-credentials';
import { SMSCredentials } from '../sms-credentials';
import { StaticBearerCredential } from '../static-bearer-credential';
import { StaticTokenCredential } from '../static-token-credential';
import { TelegramCredentials } from '../telegram-credentials';
import { WeChatCredentials } from '../wechat-credentials';
import { InstagramCredentials } from '../instagram-credentials';
import { AppleBcCredentials } from '../applebc-credentials';
import {
AppleBcCredentials,
InstagramCredentials,
KakaoTalkChatCredentials,
KakaoTalkCredentials,
LineCredentials,
MMSCredentials,
SMSCredentials,
StaticBearerCredential,
StaticTokenCredential,
TelegramCredentials,
WeChatCredentials,
} from '../mod-credentials';

/**
* Enables access to the underlying messaging channel.
Expand Down
4 changes: 2 additions & 2 deletions packages/conversation/src/models/v1/enums.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
export type {
PaymentStatusEnum as PaymentStatusUpdateEventPaymentStatusEnum,
PaymentTransactionStatusEnum as PaymentStatusUpdateEventPaymentTransactionStatusEnum,
} from './event-inbound/event-inbound';
} from './mod-callback-events/event-inbound/event-inbound';
export type {
SentimentResult as MachineLearningSentimentEnum,
EvaluationEnum as OffensiveAnalysisEvaluationEnum,
} from './smart-conversations-event/smart-conversations-event';
} from './mod-callback-events/smart-conversations-event/smart-conversations-event';

export type ConversationMetadataReportView = 'NONE' | 'FULL';

Expand Down
37 changes: 2 additions & 35 deletions packages/conversation/src/models/v1/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,10 @@ export * from './app-message';
export * from './app-message-message';
export * from './app-response';
export * from './app-update-request';
export * from './applebc-credentials';
export * from './basic-auth-credential';
export * from './call-message';
export * from './callback-settings';
export * from './capability-event';
export * from './card-message';
export * from './carousel-message';
export * from './channel-event';
export * from './channel-identity';
export * from './channel-template-override';
export * from './channel-template-reference';
Expand All @@ -27,57 +23,33 @@ export * from './comment-reply-event';
export * from './composing-end-event';
export * from './composing-event';
export * from './contact';
export * from './contact-create-event';
export * from './contact-create-request';
export * from './contact-delete-event';
export * from './contact-id';
export * from './contact-identities-duplication-event';
export * from './contact-merge-event';
export * from './contact-language';
export * from './contact-message';
export * from './contact-notification';
export * from './contact-update-event';
export * from './conversation';
export * from './conversation-channel';
export * from './conversation-channel-credential';
export * from './conversation-delete-event';
export * from './conversation-message';
export * from './conversation-message-injected';
export * from './conversation-start-event';
export * from './conversation-stop-event';
export * from './conversation-webhook-event';
export * from './coordinates';
export * from './create-conversation-request';
export * from './dispatch-retention-policy';
export * from './event-delivery';
export * from './event-inbound';
export * from './fallback-message';
export * from './generic-event';
export * from './get-channel-profile-request';
export * from './get-channel-profile-response';
export * from './identified-by';
export * from './instagram-credentials';
export * from './kakaotalk-credentials';
export * from './kakaotalkchat-credentials';
export * from './line-credentials';
export * from './list-apps-response';
export * from './list-message';
export * from './list-message-message-properties';
export * from './list-section';
export * from './list-webhooks-response';
export * from './location-message';
export * from './message-inbound-event';
export * from './message-inbound-event-item';
export * from './message-inbound-smart-conversation-redaction-event';
export * from './mms-credentials';
export * from './opt-in-event';
export * from './opt-out-event';
export * from './media-card-message';
export * from './media-carousel-message';
export * from './media-message';
export * from './merge-contact-request';
export * from './message-delivery-receipt-event';
export * from './message-submit-event';
export * from './product';
export * from './error-detail';
export * from './lookup-capability';
Expand All @@ -94,18 +66,12 @@ export * from './send-event-response';
export * from './send-message-request';
export * from './send-message-response';
export * from './smart-conversation';
export * from './smart-conversations-event';
export * from './sms-credentials';
export * from './static-bearer-credential';
export * from './static-token-credential';
export * from './telegram-credentials';
export * from './template-message';
export * from './template-reference';
export * from './template-variable';
export * from './text-message';
export * from './transcode-message-request';
export * from './transcode-message-response';
export * from './unsupported-callback-event';
export * from './url-message';
export * from './v1-list-templates-response';
export * from './v1-template';
Expand All @@ -115,8 +81,9 @@ export * from './v2-list-translations-response';
export * from './v2-template';
export * from './v2-template-response';
export * from './v2-template-translation';
export * from './wechat-credentials';
export * from './webhook';
export * from './webhook-trigger';
export * from './enums';
export * from './helper';
export * from './mod-callback-events';
export * from './mod-credentials';
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ConversationChannel } from '../conversation-channel';
import { Reason } from '../reason';
import { ConversationChannel } from '../../conversation-channel';
import { Reason } from '../../reason';
import { ConversationEvent } from '../conversation-event';

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ConversationChannel } from '../conversation-channel';
import { ConversationChannel } from '../../conversation-channel';
import { ConversationEvent } from '../conversation-event';

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ConversationChannel } from '../conversation-channel';
import { ConversationChannel } from '../../conversation-channel';
import { ConversationEvent } from '../conversation-event';

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Contact } from '../contact';
import { Contact } from '../../contact';
import { ConversationEvent } from '../conversation-event';

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Contact } from '../contact';
import { Contact } from '../../contact';

export interface ContactNotification {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Conversation } from '../conversation';
import { Conversation } from '../../conversation';
import { ConversationEvent } from '../conversation-event';

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { WebhookTrigger } from '../webhook-trigger';
import { WebhookTrigger } from '../../webhook-trigger';

export interface ConversationEvent {
trigger: WebhookTrigger;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Conversation } from '../conversation';
import { Conversation } from '../../conversation';
import { ConversationEvent } from '../conversation-event';

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Conversation } from '../conversation';
import { Conversation } from '../../conversation';
import { ConversationEvent } from '../conversation-event';

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ChannelIdentity } from '../channel-identity';
import { Reason } from '../reason';
import { ChannelIdentity } from '../../channel-identity';
import { Reason } from '../../reason';
import { ConversationEvent } from '../conversation-event';
import { DeliveryStatus, ProcessingMode } from '../enums';
import { DeliveryStatus, ProcessingMode } from '../../enums';

export interface EventDelivery extends ConversationEvent{

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ChannelIdentity } from '../channel-identity';
import { ChannelIdentity } from '../../channel-identity';
import { ConversationEvent } from '../conversation-event';
import { ProcessingMode } from '../enums';
import { ProcessingMode } from '../../enums';

export interface EventInbound extends ConversationEvent {

Expand Down
23 changes: 23 additions & 0 deletions packages/conversation/src/models/v1/mod-callback-events/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
export * from './capability-event';
export * from './channel-event';
export * from './contact-create-event';
export * from './contact-delete-event';
export * from './contact-identities-duplication-event';
export * from './contact-merge-event';
export * from './contact-notification';
export * from './contact-update-event';
export * from './conversation-delete-event';
export * from './conversation-start-event';
export * from './conversation-stop-event';
export * from './conversation-webhook-event';
export * from './event-delivery';
export * from './event-inbound';
export * from './message-inbound-event';
export * from './message-inbound-event-item';
export * from './message-inbound-smart-conversation-redaction-event';
export * from './opt-in-event';
export * from './opt-out-event';
export * from './message-delivery-receipt-event';
export * from './message-submit-event';
export * from './smart-conversations-event';
export * from './unsupported-callback-event';
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ChannelIdentity } from '../channel-identity';
import { Reason } from '../reason';
import { ChannelIdentity } from '../../channel-identity';
import { Reason } from '../../reason';
import { ConversationEvent } from '../conversation-event';
import { DeliveryStatus, ProcessingMode } from '../enums';
import { DeliveryStatus, ProcessingMode } from '../../enums';

/**
* This callback notifies the API clients about status changes of already sent app message.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ChannelIdentity } from '../channel-identity';
import { ContactMessage } from '../contact-message';
import { ProcessingMode } from '../enums';
import { ChannelIdentity } from '../../channel-identity';
import { ContactMessage } from '../../contact-message';
import { ProcessingMode } from '../../enums';

export interface MessageInboundEventItem {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ChannelIdentity } from '../channel-identity';
import { ContactMessage } from '../contact-message';
import { ChannelIdentity } from '../../channel-identity';
import { ContactMessage } from '../../contact-message';
import { ConversationEvent } from '../conversation-event';
import { ProcessingMode } from '../enums';
import { ProcessingMode } from '../../enums';

/**
* 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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ConversationChannel } from '../conversation-channel';
import { ConversationChannel } from '../../conversation-channel';
import { ConversationEvent } from '../conversation-event';
import { ProcessingMode } from '../enums';
import { ProcessingMode } from '../../enums';

/**
* This callback is used to deliver opt-in notifications from the channels.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ConversationChannel } from '../conversation-channel';
import { ConversationChannel } from '../../conversation-channel';
import { ConversationEvent } from '../conversation-event';
import { ProcessingMode } from '../enums';
import { ProcessingMode } from '../../enums';

/**
* This callback is used to deliver opt-out notifications from the channels.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ConversationChannel } from '../conversation-channel';
import { ConversationChannel } from '../../conversation-channel';
import { ConversationEvent } from '../conversation-event';

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ConversationChannel } from '../conversation-channel';
import { ChannelIdentity } from '../channel-identity';
import { ConversationChannel } from '../../conversation-channel';
import { ChannelIdentity } from '../../channel-identity';
import { ConversationEvent } from '../conversation-event';
import { ProcessingMode } from '../enums';
import { ProcessingMode } from '../../enums';

/**
* 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.
Expand Down
12 changes: 12 additions & 0 deletions packages/conversation/src/models/v1/mod-credentials/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
export * from './applebc-credentials';
export * from './basic-auth-credential';
export * from './instagram-credentials';
export * from './kakaotalk-credentials';
export * from './kakaotalkchat-credentials';
export * from './line-credentials';
export * from './mms-credentials';
export * from './sms-credentials';
export * from './static-bearer-credential';
export * from './static-token-credential';
export * from './telegram-credentials';
export * from './wechat-credentials';

0 comments on commit d2772e1

Please sign in to comment.