botframework-webchat-core 4.15.1 → 4.15.2-main.20220413.af6e8a3
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.
- package/babel.config.json +1 -1
- package/lib/actions/clearSuggestedActions.js +1 -1
- package/lib/actions/connect.js +1 -1
- package/lib/actions/connectionStatusUpdate.js +1 -1
- package/lib/actions/deleteActivity.d.ts +13 -0
- package/lib/actions/deleteActivity.d.ts.map +1 -0
- package/lib/actions/deleteActivity.js +5 -3
- package/lib/actions/disconnect.js +1 -1
- package/lib/actions/dismissNotification.js +1 -1
- package/lib/actions/emitTypingIndicator.js +1 -1
- package/lib/actions/incomingActivity.d.ts +14 -0
- package/lib/actions/incomingActivity.d.ts.map +1 -0
- package/lib/actions/incomingActivity.js +5 -3
- package/lib/actions/markActivity.d.ts +17 -0
- package/lib/actions/markActivity.d.ts.map +1 -0
- package/lib/actions/markActivity.js +5 -3
- package/lib/actions/postActivity.d.ts +52 -0
- package/lib/actions/postActivity.d.ts.map +1 -0
- package/lib/actions/postActivity.js +5 -3
- package/lib/actions/queueIncomingActivity.js +1 -1
- package/lib/actions/sagaError.js +1 -1
- package/lib/actions/sendEvent.js +1 -1
- package/lib/actions/sendFiles.js +1 -1
- package/lib/actions/sendMessage.js +1 -1
- package/lib/actions/sendMessageBack.js +1 -1
- package/lib/actions/sendPostBack.js +1 -1
- package/lib/actions/setDictateInterims.js +1 -1
- package/lib/actions/setDictateState.js +1 -1
- package/lib/actions/setLanguage.js +1 -1
- package/lib/actions/setNotification.js +1 -1
- package/lib/actions/setReferenceGrammarID.js +1 -1
- package/lib/actions/setSendBox.js +1 -1
- package/lib/actions/setSendTimeout.js +1 -1
- package/lib/actions/setSendTypingIndicator.js +1 -1
- package/lib/actions/setSuggestedActions.js +1 -1
- package/lib/actions/startDictate.js +1 -1
- package/lib/actions/startSpeakingActivity.js +1 -1
- package/lib/actions/stopDictate.js +1 -1
- package/lib/actions/stopSpeakingActivity.js +1 -1
- package/lib/actions/submitSendBox.js +1 -1
- package/lib/actions/updateConnectionStatus.js +1 -1
- package/lib/constants/ActivityClientState.js +1 -1
- package/lib/definitions/speakingActivity.js +4 -2
- package/lib/index.d.ts +15 -14
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +4 -3
- package/lib/reducer.d.ts +1 -2
- package/lib/reducer.d.ts.map +1 -1
- package/lib/reducer.js +1 -4
- package/lib/reducers/activities.d.ts +10 -0
- package/lib/reducers/activities.d.ts.map +1 -0
- package/lib/reducers/activities.js +65 -45
- package/lib/reducers/typing.js +13 -7
- package/lib/sagas/effects/observeOnce.js +1 -1
- package/lib/sagas/effects/whileConnected.js +1 -1
- package/lib/sagas/observeActivitySaga.js +21 -3
- package/lib/sagas/postActivitySaga.js +51 -72
- package/lib/sagas/sendFilesToPostActivitySaga.js +4 -4
- package/lib/selectors/activities.js +1 -1
- package/lib/selectors/combineSelectors.js +3 -3
- package/lib/selectors/dictateState.js +1 -1
- package/lib/selectors/language.js +1 -1
- package/lib/selectors/notifications.js +1 -1
- package/lib/selectors/sendBoxValue.js +1 -1
- package/lib/selectors/sendTimeout.js +1 -1
- package/lib/selectors/sendTypingIndicator.js +1 -1
- package/lib/selectors/shouldSpeakIncomingActivity.js +1 -1
- package/lib/types/AnyAnd.d.ts +2 -0
- package/lib/types/AnyAnd.d.ts.map +1 -0
- package/lib/types/AnyAnd.js +6 -0
- package/lib/types/OneOrMany.js +4 -0
- package/lib/types/WebChatActivity.d.ts +81 -0
- package/lib/types/WebChatActivity.d.ts.map +1 -0
- package/lib/types/WebChatActivity.js +6 -0
- package/lib/types/external/DirectLineActivity.d.ts +1 -1
- package/lib/types/external/DirectLineActivity.d.ts.map +1 -1
- package/lib/types/external/DirectLineActivity.js +4 -0
- package/lib/types/external/DirectLineAnimationCard.d.ts +5 -2
- package/lib/types/external/DirectLineAnimationCard.d.ts.map +1 -1
- package/lib/types/external/DirectLineAnimationCard.js +4 -0
- package/lib/types/external/DirectLineAttachment.d.ts +8 -2
- package/lib/types/external/DirectLineAttachment.d.ts.map +1 -1
- package/lib/types/external/DirectLineAttachment.js +4 -0
- package/lib/types/external/DirectLineAudioCard.d.ts +5 -2
- package/lib/types/external/DirectLineAudioCard.d.ts.map +1 -1
- package/lib/types/external/DirectLineAudioCard.js +4 -0
- package/lib/types/external/DirectLineBasicCardEssence.d.ts +12 -0
- package/lib/types/external/DirectLineBasicCardEssence.d.ts.map +1 -0
- package/lib/types/external/DirectLineBasicCardEssence.js +6 -0
- package/lib/types/external/DirectLineCardAction.d.ts +1 -1
- package/lib/types/external/DirectLineCardAction.d.ts.map +1 -1
- package/lib/types/external/DirectLineCardAction.js +4 -0
- package/lib/types/external/DirectLineCardImage.d.ts +8 -0
- package/lib/types/external/DirectLineCardImage.d.ts.map +1 -0
- package/lib/types/external/DirectLineCardImage.js +6 -0
- package/lib/types/external/DirectLineHeroCard.d.ts +5 -2
- package/lib/types/external/DirectLineHeroCard.d.ts.map +1 -1
- package/lib/types/external/DirectLineHeroCard.js +4 -0
- package/lib/types/external/DirectLineJSBotConnection.d.ts +1 -1
- package/lib/types/external/DirectLineJSBotConnection.d.ts.map +1 -1
- package/lib/types/external/DirectLineJSBotConnection.js +4 -0
- package/lib/types/external/DirectLineMediaCardEssence.d.ts +21 -0
- package/lib/types/external/DirectLineMediaCardEssence.d.ts.map +1 -0
- package/lib/types/external/DirectLineMediaCardEssence.js +6 -0
- package/lib/types/external/DirectLineOAuthCard.d.ts +7 -2
- package/lib/types/external/DirectLineOAuthCard.d.ts.map +1 -1
- package/lib/types/external/DirectLineOAuthCard.js +4 -0
- package/lib/types/external/DirectLineReceiptCard.d.ts +27 -2
- package/lib/types/external/DirectLineReceiptCard.d.ts.map +1 -1
- package/lib/types/external/DirectLineReceiptCard.js +4 -0
- package/lib/types/external/DirectLineSignInCard.d.ts +7 -2
- package/lib/types/external/DirectLineSignInCard.d.ts.map +1 -1
- package/lib/types/external/DirectLineSignInCard.js +4 -0
- package/lib/types/external/DirectLineSuggestedAction.d.ts +6 -2
- package/lib/types/external/DirectLineSuggestedAction.d.ts.map +1 -1
- package/lib/types/external/DirectLineSuggestedAction.js +4 -0
- package/lib/types/external/DirectLineThumbnailCard.d.ts +5 -2
- package/lib/types/external/DirectLineThumbnailCard.d.ts.map +1 -1
- package/lib/types/external/DirectLineThumbnailCard.js +4 -0
- package/lib/types/external/DirectLineVideoCard.d.ts +5 -2
- package/lib/types/external/DirectLineVideoCard.d.ts.map +1 -1
- package/lib/types/external/DirectLineVideoCard.js +4 -0
- package/lib/types/external/Observable.js +6 -0
- package/lib/types/internal/Notification.js +6 -0
- package/lib/types/internal/ReduxState.js +6 -0
- package/lib/utils/dateToLocaleISOString.js +5 -5
- package/lib/utils/deleteKey.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/uniqueID.js +1 -1
- package/package.json +18 -14
- package/src/actions/deleteActivity.ts +19 -0
- package/src/actions/incomingActivity.ts +21 -0
- package/src/actions/markActivity.ts +23 -0
- package/src/actions/postActivity.ts +48 -0
- package/src/definitions/speakingActivity.js +1 -1
- package/src/index.ts +17 -14
- package/src/reducer.ts +0 -2
- package/src/reducers/activities.ts +172 -0
- package/src/reducers/typing.js +6 -5
- package/src/sagas/effects/{observeOnce.js → observeOnce.ts} +6 -4
- package/src/sagas/effects/{whileConnected.js → whileConnected.ts} +20 -1
- package/src/sagas/{observeActivitySaga.js → observeActivitySaga.ts} +25 -6
- package/src/sagas/{postActivitySaga.js → postActivitySaga.ts} +57 -48
- package/src/sagas/sendFilesToPostActivitySaga.js +1 -1
- package/src/selectors/activities.ts +12 -0
- package/src/selectors/{combineSelectors.js → combineSelectors.ts} +7 -2
- package/src/selectors/dictateState.ts +3 -0
- package/src/selectors/language.ts +3 -0
- package/src/selectors/notifications.ts +6 -0
- package/src/selectors/sendBoxValue.ts +3 -0
- package/src/selectors/sendTimeout.ts +3 -0
- package/src/selectors/sendTypingIndicator.ts +3 -0
- package/src/selectors/shouldSpeakIncomingActivity.ts +3 -0
- package/src/types/AnyAnd.ts +1 -0
- package/src/types/WebChatActivity.ts +154 -0
- package/src/types/external/DirectLineActivity.ts +1 -1
- package/src/types/external/DirectLineAnimationCard.ts +6 -3
- package/src/types/external/DirectLineAttachment.ts +10 -4
- package/src/types/external/DirectLineAudioCard.ts +6 -3
- package/src/types/external/DirectLineBasicCardEssence.ts +14 -0
- package/src/types/external/DirectLineCardAction.ts +1 -1
- package/src/types/external/DirectLineCardImage.ts +9 -0
- package/src/types/external/DirectLineHeroCard.ts +6 -3
- package/src/types/external/DirectLineJSBotConnection.ts +1 -1
- package/src/types/external/DirectLineMediaCardEssence.ts +19 -0
- package/src/types/external/DirectLineOAuthCard.ts +7 -3
- package/src/types/external/DirectLineReceiptCard.ts +30 -3
- package/src/types/external/DirectLineSignInCard.ts +8 -3
- package/src/types/external/DirectLineSuggestedAction.ts +6 -3
- package/src/types/external/DirectLineThumbnailCard.ts +6 -3
- package/src/types/external/DirectLineVideoCard.ts +6 -3
- package/src/types/external/Observable.ts +69 -0
- package/src/types/internal/Notification.ts +10 -0
- package/src/types/internal/ReduxState.ts +16 -0
- package/src/utils/{dateToLocaleISOString.js → dateToLocaleISOString.ts} +6 -6
- package/src/utils/deleteKey.ts +9 -0
- package/src/utils/{sleep.js → sleep.ts} +1 -1
- package/src/utils/{uniqueID.js → uniqueID.ts} +1 -1
- package/lib/reducers/clockSkewAdjustment.js +0 -44
- package/lib/sagas/effects/callUntil.js +0 -48
- package/lib/selectors/clockSkewAdjustment.js +0 -14
- package/lib/utils/mime-wrapper.js +0 -47
- package/src/actions/deleteActivity.js +0 -8
- package/src/actions/incomingActivity.js +0 -10
- package/src/actions/markActivity.js +0 -14
- package/src/actions/postActivity.js +0 -14
- package/src/reducers/activities.js +0 -116
- package/src/reducers/clockSkewAdjustment.js +0 -29
- package/src/sagas/effects/callUntil.js +0 -13
- package/src/selectors/activities.js +0 -8
- package/src/selectors/clockSkewAdjustment.js +0 -1
- package/src/selectors/dictateState.js +0 -1
- package/src/selectors/language.js +0 -1
- package/src/selectors/notifications.js +0 -3
- package/src/selectors/sendBoxValue.js +0 -1
- package/src/selectors/sendTimeout.js +0 -1
- package/src/selectors/sendTypingIndicator.js +0 -1
- package/src/selectors/shouldSpeakIncomingActivity.js +0 -1
- package/src/utils/deleteKey.js +0 -9
- package/src/utils/mime-wrapper.js +0 -39
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import isForbiddenPropertyName from '../utils/isForbiddenPropertyName';
|
|
2
2
|
|
|
3
|
-
export default function combineSelectors
|
|
3
|
+
export default function combineSelectors<
|
|
4
|
+
TState extends { [key: string]: unknown },
|
|
5
|
+
TResult extends { [key: string]: unknown }
|
|
6
|
+
>(selectors: { [P in keyof TResult]: (state: TState) => TResult[P] }): (state: TState) => {
|
|
7
|
+
[P in keyof TResult]?: TResult[P];
|
|
8
|
+
} {
|
|
4
9
|
if (Array.isArray(selectors)) {
|
|
5
10
|
return state => selectors.reduce((combinedState, selector) => [...combinedState, selector(state)], []);
|
|
6
11
|
}
|
|
@@ -11,6 +16,6 @@ export default function combineSelectors(selectors) {
|
|
|
11
16
|
// Mitigated through denylisting.
|
|
12
17
|
// eslint-disable-next-line security/detect-object-injection
|
|
13
18
|
isForbiddenPropertyName(key) ? combinedState : { ...combinedState, [key]: selectors[key](state) },
|
|
14
|
-
{}
|
|
19
|
+
{} as TResult
|
|
15
20
|
);
|
|
16
21
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Notification } from '../types/internal/Notification';
|
|
2
|
+
import type { ReduxState } from '../types/internal/ReduxState';
|
|
3
|
+
|
|
4
|
+
const notifications = ({ notifications }: ReduxState): { [key: string]: Notification } => notifications;
|
|
5
|
+
|
|
6
|
+
export default notifications;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type AnyAnd<T> = Omit<any, keyof T> & T;
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
// This is Web Chat view of Direct Line Activity, which is defined at https://github.com/Microsoft/botframework-sdk/blob/main/specs/botframework-activity/botframework-activity.md.
|
|
2
|
+
// It is not a direct port of Direct Line version of Activity.
|
|
3
|
+
|
|
4
|
+
// For example:
|
|
5
|
+
// - "channelId" is not needed by Web Chat, thus, it is optional
|
|
6
|
+
// - "localTimestamp" is a must when sending out activities to the server
|
|
7
|
+
// - However, we do not expect the server to return "localTimestamp" as they may not have capability to store this information
|
|
8
|
+
// - "conversationUpdate" activity is never sent to Web Chat, thus, it is not defined
|
|
9
|
+
|
|
10
|
+
import type { AnyAnd } from './AnyAnd';
|
|
11
|
+
import type { DirectLineAttachment } from './external/DirectLineAttachment';
|
|
12
|
+
import type { DirectLineSuggestedAction } from './external/DirectLineSuggestedAction';
|
|
13
|
+
|
|
14
|
+
type ChannelData<SendState extends string | undefined, Type extends string> = AnyAnd<
|
|
15
|
+
{
|
|
16
|
+
// TODO: [P2] #3953 Rename to "webchat:attachment-sizes".
|
|
17
|
+
attachmentSizes?: number[];
|
|
18
|
+
|
|
19
|
+
// TODO: [P2] #3953 Rename to "webchat:client-activity-id".
|
|
20
|
+
clientActivityID?: string;
|
|
21
|
+
|
|
22
|
+
// Sequence ID must be available when chat adapter send it to Web Chat.
|
|
23
|
+
'webchat:sequence-id': number;
|
|
24
|
+
} & (SendState extends string
|
|
25
|
+
? {
|
|
26
|
+
// TODO: [P2] #3953 Rename to "webchat:send-state".
|
|
27
|
+
state: SendState;
|
|
28
|
+
}
|
|
29
|
+
: {}) &
|
|
30
|
+
(Type extends 'message'
|
|
31
|
+
? {
|
|
32
|
+
// TODO: [P2] #3953 Rename to "webchat:message-back".
|
|
33
|
+
messageBack?: {
|
|
34
|
+
displayText: string;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
// TODO: [P2] #3953 Rename to "webchat:post-back".
|
|
38
|
+
postBack?: boolean;
|
|
39
|
+
|
|
40
|
+
// TODO: [P2] #3953 Rename to "webchat:speak-state".
|
|
41
|
+
speak?: boolean;
|
|
42
|
+
|
|
43
|
+
// TODO: [P2] #3953 Rename to "webchat:speech-synthesis-utterance".
|
|
44
|
+
speechSynthesisUtterance?: SpeechSynthesisUtterance;
|
|
45
|
+
|
|
46
|
+
// TODO: [P2] #3953 It seems Direct Line added a new "summary" field to cater this case.
|
|
47
|
+
'webchat:fallback-text'?: string;
|
|
48
|
+
}
|
|
49
|
+
: {})
|
|
50
|
+
>;
|
|
51
|
+
|
|
52
|
+
// Entity - https://github.com/Microsoft/botframework-sdk/blob/main/specs/botframework-activity/botframework-activity.md#entity
|
|
53
|
+
|
|
54
|
+
type ClientCapabilitiesEntity = {
|
|
55
|
+
requiresBotState?: boolean;
|
|
56
|
+
supportsListening?: boolean;
|
|
57
|
+
supportsTts?: boolean;
|
|
58
|
+
type: 'ClientCapabilities';
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
type Entity = ClientCapabilitiesEntity | AnyAnd<{ type: Exclude<string, 'ClientCapabilities'> }>;
|
|
62
|
+
|
|
63
|
+
// Channel account - https://github.com/Microsoft/botframework-sdk/blob/main/specs/botframework-activity/botframework-activity.md#channel-account
|
|
64
|
+
type ChannelAcount<Role = 'bot' | 'channel' | 'user'> = {
|
|
65
|
+
id: string;
|
|
66
|
+
name?: string;
|
|
67
|
+
role: Role;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
// Abstract - content of different activity types
|
|
71
|
+
|
|
72
|
+
// https://github.com/Microsoft/botframework-sdk/blob/main/specs/botframework-activity/botframework-activity.md#event-activity
|
|
73
|
+
type EventActivityEssence = {
|
|
74
|
+
name: string;
|
|
75
|
+
type: 'event';
|
|
76
|
+
value?: any;
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
// https://github.com/Microsoft/botframework-sdk/blob/main/specs/botframework-activity/botframework-activity.md#message-activity
|
|
80
|
+
type MessageActivityEssence = {
|
|
81
|
+
attachmentLayout?: 'carousel' | 'stacked';
|
|
82
|
+
attachments?: DirectLineAttachment[];
|
|
83
|
+
inputHint?: 'accepting' | 'expecting' | 'ignoring';
|
|
84
|
+
locale?: string;
|
|
85
|
+
speak?: string;
|
|
86
|
+
suggestedActions?: DirectLineSuggestedAction;
|
|
87
|
+
text: string | undefined;
|
|
88
|
+
textFormat?: 'markdown' | 'plain' | 'xml';
|
|
89
|
+
type: 'message';
|
|
90
|
+
value?: any;
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
// https://github.com/Microsoft/botframework-sdk/blob/main/specs/botframework-activity/botframework-activity.md#typing-activity
|
|
94
|
+
type TypingActivityEssence = {
|
|
95
|
+
type: 'typing';
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
// Abstract - timestamps
|
|
99
|
+
|
|
100
|
+
type TimestampFromServerEssence = {
|
|
101
|
+
id: string;
|
|
102
|
+
localTimestamp?: string;
|
|
103
|
+
timestamp: string;
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
type TimestampInTransitEssence = {
|
|
107
|
+
id?: string;
|
|
108
|
+
localTimestamp: string;
|
|
109
|
+
timestamp?: string;
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
type TimestampEssence<Role extends string, SendState extends string | undefined> = Role extends 'user'
|
|
113
|
+
? SendState extends 'sending' | 'send failed'
|
|
114
|
+
? TimestampInTransitEssence
|
|
115
|
+
: TimestampFromServerEssence
|
|
116
|
+
: TimestampFromServerEssence;
|
|
117
|
+
|
|
118
|
+
// Abstract - core
|
|
119
|
+
|
|
120
|
+
type CoreActivityEssence<
|
|
121
|
+
Role extends 'bot' | 'channel' | 'user',
|
|
122
|
+
SendState extends string | undefined,
|
|
123
|
+
Type extends string = 'conversationUpdate' | 'event' | 'invoke' | 'message' | 'typing'
|
|
124
|
+
> = {
|
|
125
|
+
channelData: ChannelData<SendState, Type>;
|
|
126
|
+
channelId?: string;
|
|
127
|
+
entities?: Entity[];
|
|
128
|
+
from: ChannelAcount<Role>;
|
|
129
|
+
localTimezone?: string;
|
|
130
|
+
replyToId?: string;
|
|
131
|
+
type: string;
|
|
132
|
+
} & TimestampEssence<Role, SendState> &
|
|
133
|
+
(Type extends 'event'
|
|
134
|
+
? EventActivityEssence
|
|
135
|
+
: Type extends 'message'
|
|
136
|
+
? MessageActivityEssence
|
|
137
|
+
: Type extends 'typing'
|
|
138
|
+
? TypingActivityEssence
|
|
139
|
+
: { type: Type });
|
|
140
|
+
|
|
141
|
+
// Concrete
|
|
142
|
+
|
|
143
|
+
type SelfActivityInTransit = CoreActivityEssence<'user', 'sending' | 'send failed'>;
|
|
144
|
+
type SelfActivityFromServer = CoreActivityEssence<'user', 'sent'>;
|
|
145
|
+
|
|
146
|
+
type SelfActivity = SelfActivityInTransit | SelfActivityFromServer;
|
|
147
|
+
|
|
148
|
+
type OthersActivity = CoreActivityEssence<'bot' | 'channel', undefined>;
|
|
149
|
+
|
|
150
|
+
// Exported
|
|
151
|
+
|
|
152
|
+
type WebChatActivity = SelfActivity | OthersActivity;
|
|
153
|
+
|
|
154
|
+
export type { WebChatActivity };
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import type { DirectLineMediaCardEssence } from './DirectLineMediaCardEssence';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// https://github.com/microsoft/botframework-sdk/blob/master/specs/botframework-activity/botframework-cards.md#Animation-card
|
|
4
|
+
type DirectLineAnimationCard = DirectLineMediaCardEssence & {
|
|
5
|
+
contentType: 'application/vnd.microsoft.card.animation';
|
|
6
|
+
};
|
|
4
7
|
|
|
5
|
-
export
|
|
8
|
+
export type { DirectLineAnimationCard };
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
//
|
|
1
|
+
// https://github.com/Microsoft/botframework-sdk/blob/main/specs/botframework-activity/botframework-activity.md#attachment
|
|
2
|
+
type DirectLineAttachment = {
|
|
3
|
+
// Currently, we allow "text/plain" with "content" field of type string. Under the spec, "content" must not contains primitive types.
|
|
4
|
+
content?: any;
|
|
5
|
+
contentType: string;
|
|
6
|
+
contentUrl?: string;
|
|
7
|
+
name?: string;
|
|
8
|
+
thumbnailUrl?: string;
|
|
9
|
+
};
|
|
2
10
|
|
|
3
|
-
type DirectLineAttachment
|
|
4
|
-
|
|
5
|
-
export default DirectLineAttachment;
|
|
11
|
+
export type { DirectLineAttachment };
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import type { DirectLineMediaCardEssence } from './DirectLineMediaCardEssence';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// https://github.com/microsoft/botframework-sdk/blob/master/specs/botframework-activity/botframework-cards.md#audio-card
|
|
4
|
+
type DirectLineAudioCard = DirectLineMediaCardEssence & {
|
|
5
|
+
contentType: 'application/vnd.microsoft.card.audio';
|
|
6
|
+
};
|
|
4
7
|
|
|
5
|
-
export
|
|
8
|
+
export type { DirectLineAudioCard };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { DirectLineCardImage } from './DirectLineCardImage';
|
|
2
|
+
import type { DirectLineCardAction } from './DirectLineCardAction';
|
|
3
|
+
|
|
4
|
+
// https://github.com/microsoft/botframework-sdk/blob/master/specs/botframework-activity/botframework-cards.md#basic-cards
|
|
5
|
+
type DirectLineBasicCardEssence = {
|
|
6
|
+
buttons?: DirectLineCardAction[];
|
|
7
|
+
images?: DirectLineCardImage[];
|
|
8
|
+
subtitle?: string;
|
|
9
|
+
tap?: DirectLineCardAction;
|
|
10
|
+
text?: string;
|
|
11
|
+
title?: string;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export type { DirectLineBasicCardEssence };
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import type { DirectLineBasicCardEssence } from './DirectLineBasicCardEssence';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// https://github.com/microsoft/botframework-sdk/blob/master/specs/botframework-activity/botframework-cards.md#Hero-cards
|
|
4
|
+
type DirectLineHeroCard = DirectLineBasicCardEssence & {
|
|
5
|
+
contentType: 'application/vnd.microsoft.card.hero';
|
|
6
|
+
};
|
|
4
7
|
|
|
5
|
-
export
|
|
8
|
+
export type { DirectLineHeroCard };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { DirectLineCardAction } from './DirectLineCardAction';
|
|
2
|
+
|
|
3
|
+
// https://github.com/microsoft/botframework-sdk/blob/master/specs/botframework-activity/botframework-cards.md#media-cards
|
|
4
|
+
type DirectLineMediaCardEssence = {
|
|
5
|
+
aspect?: '4:3' | '16:9';
|
|
6
|
+
autoloop?: boolean;
|
|
7
|
+
autostart?: boolean;
|
|
8
|
+
buttons?: DirectLineCardAction[];
|
|
9
|
+
duration?: string;
|
|
10
|
+
// In the spec, "image" is of type "thumbnailUrl", which is simply a string.
|
|
11
|
+
image?: { url: string };
|
|
12
|
+
media: { profile?: string; url: string }[];
|
|
13
|
+
shareable?: boolean;
|
|
14
|
+
subtitle?: string;
|
|
15
|
+
title?: string;
|
|
16
|
+
value?: any;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export type { DirectLineMediaCardEssence };
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
import type { DirectLineCardAction } from './DirectLineCardAction';
|
|
2
2
|
|
|
3
|
-
type DirectLineOAuthCard =
|
|
3
|
+
type DirectLineOAuthCard = {
|
|
4
|
+
buttons?: DirectLineCardAction[];
|
|
5
|
+
contentType: 'application/vnd.microsoft.card.oauth';
|
|
6
|
+
text?: string;
|
|
7
|
+
};
|
|
4
8
|
|
|
5
|
-
export
|
|
9
|
+
export type { DirectLineOAuthCard };
|
|
@@ -1,5 +1,32 @@
|
|
|
1
|
-
|
|
1
|
+
import type { DirectLineCardAction } from './DirectLineCardAction';
|
|
2
|
+
import type { DirectLineCardImage } from './DirectLineCardImage';
|
|
2
3
|
|
|
3
|
-
type
|
|
4
|
+
type Fact = {
|
|
5
|
+
key?: string;
|
|
6
|
+
value?: string;
|
|
7
|
+
};
|
|
4
8
|
|
|
5
|
-
|
|
9
|
+
type ReceiptItem = {
|
|
10
|
+
image?: DirectLineCardImage;
|
|
11
|
+
price?: string;
|
|
12
|
+
quantity?: string;
|
|
13
|
+
subtitle?: string;
|
|
14
|
+
tap?: DirectLineCardAction;
|
|
15
|
+
text?: string;
|
|
16
|
+
title?: string;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
// https://github.com/microsoft/botframework-sdk/blob/master/specs/botframework-activity/botframework-cards.md#receipt-card
|
|
20
|
+
type DirectLineReceiptCard = {
|
|
21
|
+
buttons?: DirectLineCardAction[];
|
|
22
|
+
contentType: 'application/vnd.microsoft.card.receipt';
|
|
23
|
+
facts?: Fact[];
|
|
24
|
+
items?: ReceiptItem[];
|
|
25
|
+
tap?: DirectLineCardAction;
|
|
26
|
+
tax?: string;
|
|
27
|
+
title?: string;
|
|
28
|
+
total?: string;
|
|
29
|
+
vat?: string;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export type { DirectLineReceiptCard };
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
import type { DirectLineCardAction } from './DirectLineCardAction';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// https://github.com/microsoft/botframework-sdk/blob/master/specs/botframework-activity/botframework-cards.md#Signin-card
|
|
4
|
+
type DirectLineSignInCard = {
|
|
5
|
+
buttons?: DirectLineCardAction[];
|
|
6
|
+
contentType: 'application/vnd.microsoft.card.signin';
|
|
7
|
+
text?: string;
|
|
8
|
+
};
|
|
4
9
|
|
|
5
|
-
export
|
|
10
|
+
export type { DirectLineSignInCard };
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import type { DirectLineCardAction } from './DirectLineCardAction';
|
|
2
2
|
|
|
3
|
-
type DirectLineSuggestedAction =
|
|
3
|
+
type DirectLineSuggestedAction = {
|
|
4
|
+
actions?: DirectLineCardAction[];
|
|
5
|
+
to?: string[];
|
|
6
|
+
};
|
|
4
7
|
|
|
5
|
-
export
|
|
8
|
+
export type { DirectLineSuggestedAction };
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import type { DirectLineBasicCardEssence } from './DirectLineBasicCardEssence';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// https://github.com/microsoft/botframework-sdk/blob/master/specs/botframework-activity/botframework-cards.md#Thumbnail-cards
|
|
4
|
+
type DirectLineThumbnailCard = DirectLineBasicCardEssence & {
|
|
5
|
+
contentType: 'application/vnd.microsoft.card.thumbnail';
|
|
6
|
+
};
|
|
4
7
|
|
|
5
|
-
export
|
|
8
|
+
export type { DirectLineThumbnailCard };
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import type { DirectLineMediaCardEssence } from './DirectLineMediaCardEssence';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// https://github.com/microsoft/botframework-sdk/blob/master/specs/botframework-activity/botframework-cards.md#video-card
|
|
4
|
+
type DirectLineVideoCard = DirectLineMediaCardEssence & {
|
|
5
|
+
contentType: 'application/vnd.microsoft.card.video';
|
|
6
|
+
};
|
|
4
7
|
|
|
5
|
-
export
|
|
8
|
+
export type { DirectLineVideoCard };
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
// This is a declaration file for a single ES feature. Could contains multiple classes definitions.
|
|
2
|
+
/* eslint-disable max-classes-per-file */
|
|
3
|
+
|
|
4
|
+
// Adopted from https://github.com/tc39/proposal-observable.
|
|
5
|
+
|
|
6
|
+
/** Receives a completion notification */
|
|
7
|
+
type CompleteFunction = () => void;
|
|
8
|
+
|
|
9
|
+
/** Receives the sequence error */
|
|
10
|
+
type ErrorFunction = (error: Error) => void;
|
|
11
|
+
|
|
12
|
+
/** Receives the next value in the sequence */
|
|
13
|
+
type NextFunction<T> = (value: T) => void;
|
|
14
|
+
type SubscriberFunction<T> = (observer: SubscriptionObserver<T>) => Subscription;
|
|
15
|
+
|
|
16
|
+
/** An `Observable` represents a sequence of values which may be observed. */
|
|
17
|
+
declare class Observable<T> {
|
|
18
|
+
constructor(subscriber: SubscriberFunction<T>);
|
|
19
|
+
|
|
20
|
+
/** Subscribes to the sequence with an observer */
|
|
21
|
+
subscribe(observer: Observer<T>): Subscription;
|
|
22
|
+
|
|
23
|
+
/** Subscribes to the sequence with callbacks */
|
|
24
|
+
subscribe(onNext: NextFunction<T>, onError?: ErrorFunction, onComplete?: CompleteFunction): Subscription;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
declare class Subscription {
|
|
28
|
+
/** Cancels the subscription */
|
|
29
|
+
unsubscribe(): void;
|
|
30
|
+
|
|
31
|
+
/** A boolean value indicating whether the subscription is closed */
|
|
32
|
+
get closed(): boolean;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* An `Observer` is used to receive data from an `Observable`, and is supplied as an argument to `subscribe`.
|
|
37
|
+
*
|
|
38
|
+
* All methods are optional.
|
|
39
|
+
*/
|
|
40
|
+
declare class Observer<T> {
|
|
41
|
+
/** Receives the subscription object when `subscribe` is called */
|
|
42
|
+
start(subscription: Subscription);
|
|
43
|
+
|
|
44
|
+
/** Receives the next value in the sequence */
|
|
45
|
+
next: NextFunction<T>;
|
|
46
|
+
|
|
47
|
+
/** Receives the sequence error */
|
|
48
|
+
error: ErrorFunction;
|
|
49
|
+
|
|
50
|
+
/** Receives a completion notification */
|
|
51
|
+
complete: CompleteFunction;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/** A `SubscriptionObserver` is a normalized `Observer` which wraps the observer object supplied to `subscribe`. */
|
|
55
|
+
declare class SubscriptionObserver<T> {
|
|
56
|
+
/** Sends the next value in the sequence */
|
|
57
|
+
next: NextFunction<T>;
|
|
58
|
+
|
|
59
|
+
/** Sends the sequence error */
|
|
60
|
+
error: ErrorFunction;
|
|
61
|
+
|
|
62
|
+
/** Sends the completion notification */
|
|
63
|
+
complete: CompleteFunction;
|
|
64
|
+
|
|
65
|
+
/** A boolean value indicating whether the subscription is closed */
|
|
66
|
+
get closed(): boolean;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export type { Observable, Observer, Subscription, SubscriptionObserver };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Notification } from './Notification';
|
|
2
|
+
import type { WebChatActivity } from '../external/WebChatActivity';
|
|
3
|
+
|
|
4
|
+
type ReduxState = {
|
|
5
|
+
activities: WebChatActivity[];
|
|
6
|
+
clockSkewAdjustment: number;
|
|
7
|
+
dictateState: string;
|
|
8
|
+
language: string;
|
|
9
|
+
notifications: { [key: string]: Notification };
|
|
10
|
+
sendBoxValue: string;
|
|
11
|
+
sendTimeout: number;
|
|
12
|
+
sendTypingIndicator: boolean;
|
|
13
|
+
shouldSpeakIncomingActivity: boolean;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export type { ReduxState };
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
/* eslint no-magic-numbers: ["off", { "ignore": [1, 2, 3, 60] }] */
|
|
2
2
|
|
|
3
|
-
function pad(value, count = 2) {
|
|
3
|
+
function pad(value: number, count = 2): string {
|
|
4
4
|
if (typeof value !== 'number') {
|
|
5
5
|
throw new Error('First argument must be a number');
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
value
|
|
8
|
+
let stringValue = value + '';
|
|
9
9
|
|
|
10
|
-
while (
|
|
11
|
-
|
|
10
|
+
while (stringValue.length < count) {
|
|
11
|
+
stringValue = '0' + stringValue;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
return
|
|
14
|
+
return stringValue;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
// Adopted from https://stackoverflow.com/questions/17415579/how-to-iso-8601-format-a-date-with-timezone-offset-in-javascript.
|
|
18
|
-
export default function dateToLocaleISOString(date) {
|
|
18
|
+
export default function dateToLocaleISOString(date: Date): string {
|
|
19
19
|
if (!(date instanceof Date)) {
|
|
20
20
|
throw new Error('First argument must be a Date object');
|
|
21
21
|
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports["default"] = clockSkewAdjustment;
|
|
7
|
-
|
|
8
|
-
var _incomingActivity = require("../actions/incomingActivity");
|
|
9
|
-
|
|
10
|
-
var _setClockSkewAdjustment = require("../actions/setClockSkewAdjustment");
|
|
11
|
-
|
|
12
|
-
function clockSkewAdjustment() {
|
|
13
|
-
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
14
|
-
|
|
15
|
-
var _ref = arguments.length > 1 ? arguments[1] : undefined,
|
|
16
|
-
payload = _ref.payload,
|
|
17
|
-
type = _ref.type;
|
|
18
|
-
|
|
19
|
-
if (type === _incomingActivity.INCOMING_ACTIVITY) {
|
|
20
|
-
var _payload$activity = payload.activity,
|
|
21
|
-
_payload$activity$cha = _payload$activity.channelData;
|
|
22
|
-
_payload$activity$cha = _payload$activity$cha === void 0 ? {} : _payload$activity$cha;
|
|
23
|
-
var clientTimestamp = _payload$activity$cha.clientTimestamp,
|
|
24
|
-
timestamp = _payload$activity.timestamp;
|
|
25
|
-
var clientSendTime = Date.parse(clientTimestamp);
|
|
26
|
-
var serverTime = Date.parse(timestamp);
|
|
27
|
-
|
|
28
|
-
if (!isNaN(clientSendTime) && !isNaN(serverTime)) {
|
|
29
|
-
// The adjustment include the latency between the client and the server.
|
|
30
|
-
// This means, the adjustment is always larger than the actual value.
|
|
31
|
-
// And it means, after adjustment, client time will be ahead of server time.
|
|
32
|
-
// And it also means, the user-originated message has higher probability to appear below bot-originated message.
|
|
33
|
-
// Although it has higher probability, if the user-originated message is still sending (i.e. did not echoback with server timestamp yet),
|
|
34
|
-
// the insertion-sort logic will put the bot-originated below the user-originated message.
|
|
35
|
-
state = serverTime - clientSendTime;
|
|
36
|
-
}
|
|
37
|
-
} else if (type === _setClockSkewAdjustment.SET_CLOCK_SKEW_ADJUSTMENT) {
|
|
38
|
-
// Currently, this action is for testing purpose only.
|
|
39
|
-
state = payload.value;
|
|
40
|
-
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