botframework-webchat-core 4.18.1 → 4.19.0
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/LICENSE +21 -0
- package/activity.js +3 -0
- package/boot/deprecated/activity.js +7 -0
- package/boot/deprecated/activity.mjs +5 -0
- package/boot/deprecated/graph.js +7 -0
- package/boot/deprecated/graph.mjs +5 -0
- package/boot/deprecated/internal.js +7 -0
- package/boot/deprecated/internal.mjs +5 -0
- package/dist/WebChatActivity-CYqxBG_4.d.mts +271 -0
- package/dist/WebChatActivity-CYqxBG_4.d.ts +271 -0
- package/dist/_dtsroll-chunks/B7Whm73Q-tagged.d.ts +71 -0
- package/dist/_dtsroll-chunks/C-MxR98A-botframework-webchat-core-debug-api.d.ts +135 -0
- package/dist/_dtsroll-chunks/CAquHfZK-botframework-webchat-base.utils.d.ts +17 -0
- package/dist/_dtsroll-chunks/CDVed0Q--botframework-webchat-core.org-schema.d.ts +601 -0
- package/dist/_dtsroll-chunks/vlDgTKWF-botframework-webchat-core-graph.d.ts +239 -0
- package/dist/botframework-webchat-core.activity.d.mts +23 -0
- package/dist/botframework-webchat-core.activity.d.ts +23 -0
- package/dist/botframework-webchat-core.activity.js +2 -0
- package/dist/botframework-webchat-core.activity.js.map +1 -0
- package/dist/botframework-webchat-core.activity.mjs +2 -0
- package/dist/botframework-webchat-core.activity.mjs.map +1 -0
- package/dist/botframework-webchat-core.d.mts +267 -662
- package/dist/botframework-webchat-core.d.ts +556 -0
- package/dist/botframework-webchat-core.graph.d.mts +9 -0
- package/dist/botframework-webchat-core.graph.d.ts +9 -0
- package/dist/botframework-webchat-core.graph.js +2 -0
- package/dist/botframework-webchat-core.graph.js.map +1 -0
- package/dist/botframework-webchat-core.graph.mjs +2 -0
- package/dist/botframework-webchat-core.graph.mjs.map +1 -0
- package/dist/botframework-webchat-core.internal.d.mts +61 -0
- package/dist/botframework-webchat-core.internal.d.ts +61 -0
- package/dist/botframework-webchat-core.internal.js +2 -0
- package/dist/botframework-webchat-core.internal.js.map +1 -0
- package/dist/botframework-webchat-core.internal.mjs +2 -0
- package/dist/botframework-webchat-core.internal.mjs.map +1 -0
- package/dist/botframework-webchat-core.js +2 -0
- package/dist/botframework-webchat-core.js.map +1 -0
- package/dist/botframework-webchat-core.json-ld.d.mts +2 -0
- package/dist/botframework-webchat-core.json-ld.d.ts +2 -0
- package/dist/botframework-webchat-core.json-ld.js +2 -0
- package/dist/botframework-webchat-core.json-ld.js.map +1 -0
- package/dist/botframework-webchat-core.json-ld.mjs +2 -0
- package/dist/botframework-webchat-core.json-ld.mjs.map +1 -0
- package/dist/botframework-webchat-core.mjs +1 -2
- package/dist/botframework-webchat-core.mjs.map +1 -1
- package/dist/botframework-webchat-core.org-schema.d.mts +2 -0
- package/dist/botframework-webchat-core.org-schema.d.ts +2 -0
- package/dist/botframework-webchat-core.org-schema.js +2 -0
- package/dist/botframework-webchat-core.org-schema.js.map +1 -0
- package/dist/botframework-webchat-core.org-schema.mjs +2 -0
- package/dist/botframework-webchat-core.org-schema.mjs.map +1 -0
- package/dist/chunk-A4GEFYZJ.mjs +2 -0
- package/dist/chunk-A4GEFYZJ.mjs.map +1 -0
- package/dist/chunk-HZWWJL43.mjs +2 -0
- package/dist/chunk-HZWWJL43.mjs.map +1 -0
- package/dist/chunk-ICNZKQJW.mjs +2 -0
- package/dist/chunk-ICNZKQJW.mjs.map +1 -0
- package/dist/chunk-K6E6QQMQ.js +2 -0
- package/dist/chunk-K6E6QQMQ.js.map +1 -0
- package/dist/chunk-KPT5FBH2.mjs +2 -0
- package/dist/chunk-KPT5FBH2.mjs.map +1 -0
- package/dist/chunk-LO5BZSVE.js +2 -0
- package/dist/chunk-LO5BZSVE.js.map +1 -0
- package/dist/chunk-LP2X2JTR.js +2 -0
- package/dist/chunk-LP2X2JTR.js.map +1 -0
- package/dist/chunk-RUERYYZO.js +2 -0
- package/dist/chunk-RUERYYZO.js.map +1 -0
- package/dist/chunk-XOE3AOSM.js +2 -0
- package/dist/chunk-XOE3AOSM.js.map +1 -0
- package/dist/chunk-Y6ZDNVRT.mjs +2 -0
- package/dist/chunk-Y6ZDNVRT.mjs.map +1 -0
- package/{lib/createStore.d.ts → dist/createStore-CcvouBrW.d.mts} +29 -7
- package/dist/createStore-CcvouBrW.d.ts +65 -0
- package/dist/metafile-cjs.json +1 -0
- package/dist/metafile-esm.json +1 -1
- package/graph.js +3 -0
- package/internal.js +3 -0
- package/json-ld.js +3 -0
- package/org-schema.js +3 -0
- package/package.json +147 -73
- package/src/__tests__/activityFromBot.spec.js +2 -0
- package/src/__tests__/addMetaTag.spec.js +8 -0
- package/src/__tests__/addMetaTag.spec.mjs +8 -0
- package/src/__tests__/connectSaga.spec.js +2 -0
- package/src/__tests__/deleteKey.spec.js +2 -0
- package/src/__tests__/detectSlowConnectionSaga.spec.js +3 -1
- package/src/__tests__/observeOnce.spec.js +2 -0
- package/src/__tests__/speakableActivity.spec.js +2 -0
- package/src/__tests__/uniqueID.spec.js +2 -0
- package/src/actions/clearSuggestedActions.ts +20 -0
- package/src/actions/{connect.js → connect.ts} +9 -1
- package/src/actions/muteVoiceRecording.ts +17 -0
- package/src/actions/postVoiceActivity.ts +21 -0
- package/src/actions/registerActionSink.ts +29 -0
- package/src/actions/registerVoiceHandler.ts +24 -0
- package/src/actions/{sendEvent.js → sendEvent.ts} +1 -1
- package/src/actions/{sendMessageBack.js → sendMessageBack.ts} +1 -1
- package/src/actions/{sendPostBack.js → sendPostBack.ts} +1 -1
- package/src/actions/{setDictateInterims.js → setDictateInterims.ts} +1 -1
- package/src/actions/{setDictateState.js → setDictateState.ts} +1 -1
- package/src/actions/{setLanguage.js → setLanguage.ts} +1 -1
- package/src/actions/{setSendBox.js → setSendBox.ts} +1 -1
- package/src/actions/{setSendTimeout.js → setSendTimeout.ts} +1 -1
- package/src/actions/setSendTypingIndicator.ts +1 -1
- package/src/actions/setSuggestedActions.ts +35 -0
- package/src/actions/setVoiceState.ts +21 -0
- package/src/actions/startVoiceRecording.ts +17 -0
- package/src/actions/stopVoiceRecording.ts +17 -0
- package/src/actions/{submitSendBox.js → submitSendBox.ts} +1 -1
- package/src/actions/unmuteVoiceRecording.ts +17 -0
- package/src/actions/unregisterActionSink.ts +29 -0
- package/src/actions/unregisterVoiceHandler.ts +19 -0
- package/src/boot/activity.ts +19 -0
- package/src/boot/graph.ts +18 -0
- package/src/boot/internal.ts +11 -0
- package/src/boot/json-ld.ts +6 -0
- package/src/boot/org-schema.ts +29 -0
- package/src/buildInfo.ts +9 -0
- package/src/constants/{ActivityClientState.js → ActivityClientState.ts} +3 -3
- package/src/constants/DictateState.ts +10 -0
- package/src/createPromiseQueue.js +8 -6
- package/src/createReducer.ts +28 -20
- package/src/createSagas.ts +6 -3
- package/src/createStore.ts +26 -10
- package/src/env.d.ts +12 -0
- package/src/graph/createGraphFromStore.ts +121 -0
- package/src/index.ts +62 -45
- package/src/internal/StoreDebugAPIRegistry.ts +4 -0
- package/src/internal/actions/setRawState.ts +48 -0
- package/src/internal/types/suggestedActions.ts +11 -0
- package/src/internal/types/suggestedActionsOriginActivity.ts +16 -0
- package/src/reducers/activities/combineActivitiesReducer.ts +58 -0
- package/src/reducers/activities/createGroupedActivitiesReducer.ts +297 -0
- package/src/reducers/activities/patchActivity.ts +37 -0
- package/src/reducers/activities/sort/deleteActivityByLocalId.activity.spec.ts +144 -0
- package/src/reducers/activities/sort/deleteActivityByLocalId.howTo.spec.ts +148 -0
- package/src/reducers/activities/sort/deleteActivityByLocalId.howToWithLivestream.spec.ts +248 -0
- package/src/reducers/activities/sort/deleteActivityByLocalId.livestream.spec.ts +156 -0
- package/src/reducers/activities/sort/deleteActivityByLocalId.ts +177 -0
- package/src/reducers/activities/sort/private/computePartListTimestamp.ts +9 -0
- package/src/reducers/activities/sort/private/computeSortedActivities.ts +51 -0
- package/src/reducers/activities/sort/private/getLogicalTimestamp.spec.ts +49 -0
- package/src/reducers/activities/sort/private/getLogicalTimestamp.ts +33 -0
- package/src/reducers/activities/sort/private/getPartGroupingMetadataMap.spec.ts +92 -0
- package/src/reducers/activities/sort/private/getPartGroupingMetadataMap.ts +37 -0
- package/src/reducers/activities/sort/private/insertSorted.spec.ts +106 -0
- package/src/reducers/activities/sort/private/insertSorted.ts +18 -0
- package/src/reducers/activities/sort/property/LocalId.ts +60 -0
- package/src/reducers/activities/sort/property/Position.ts +39 -0
- package/src/reducers/activities/sort/property/ReceivedAt.ts +45 -0
- package/src/reducers/activities/sort/property/SendStatus.ts +51 -0
- package/src/reducers/activities/sort/queryLocalIdByActivityId.ts +6 -0
- package/src/reducers/activities/sort/queryLocalIdByClientActivityId.ts +6 -0
- package/src/reducers/activities/sort/types.ts +80 -0
- package/src/reducers/activities/sort/updateActivityChannelData.ts +101 -0
- package/src/reducers/activities/sort/updateSendState.ts +22 -0
- package/src/reducers/activities/sort/upsert.activity.spec.ts +500 -0
- package/src/reducers/activities/sort/upsert.howTo.spec.ts +368 -0
- package/src/reducers/activities/sort/upsert.howToWithLivestream.spec.ts +384 -0
- package/src/reducers/activities/sort/upsert.livestream.spec.ts +418 -0
- package/src/reducers/activities/sort/upsert.ts +498 -0
- package/src/reducers/activities/tsconfig.json +4 -0
- package/src/reducers/createNotificationsReducer.ts +4 -4
- package/src/reducers/suggestedActions.ts +21 -0
- package/src/reducers/suggestedActionsOriginActivity.ts +24 -0
- package/src/reducers/voiceActivity.ts +102 -0
- package/src/sagas/actionSinkSaga.ts +39 -0
- package/src/sagas/observeActivitySaga.ts +51 -1
- package/src/sagas/postActivitySaga.ts +17 -10
- package/src/sagas/postVoiceActivitySaga.ts +76 -0
- package/src/sagas/queueIncomingActivitySaga.ts +10 -4
- package/src/sagas/sendMessageToPostActivitySaga.ts +4 -1
- package/src/sagas/speakActivityAndStartDictateOnIncomingActivityFromOthersSaga.js +10 -4
- package/src/sagas/startDictateOnSpeakCompleteSaga.js +3 -3
- package/src/sagas/startSpeakActivityOnPostActivitySaga.js +15 -5
- package/src/sagas/stopDictateOnCardActionSaga.js +11 -3
- package/src/sagas/stopSpeakingActivityOnInputSaga.js +22 -4
- package/src/selectors/combineSelectors.ts +1 -1
- package/src/tsconfig.json +3 -15
- package/src/types/StoreDebugAPI.ts +25 -0
- package/src/types/WebChatActivity.ts +31 -14
- package/src/types/external/DirectLineActivity.ts +1 -1
- package/src/types/external/Observable.ts +4 -1
- package/src/types/internal/GlobalScopeClock.ts +10 -10
- package/src/types/internal/ReduxState.ts +2 -0
- package/src/types/internal/WebChatOutgoingActivity.ts +1 -1
- package/src/utils/dateToLocaleISOString.chatham.spec.js +1 -2
- package/src/utils/dateToLocaleISOString.japan.spec.js +1 -2
- package/src/utils/dateToLocaleISOString.newfoundland.spec.js +1 -2
- package/src/utils/dateToLocaleISOString.pacific.spec.js +1 -2
- package/src/utils/dateToLocaleISOString.utc.spec.js +1 -3
- package/src/utils/deleteKey.ts +1 -1
- package/src/utils/getActivityLivestreamingMetadata.spec.ts +297 -0
- package/src/utils/getActivityLivestreamingMetadata.ts +197 -0
- package/src/utils/getOrgSchemaMessage.spec.ts +4 -1
- package/src/utils/getOrgSchemaMessage.ts +16 -16
- package/src/utils/onErrorResumeNext.ts +1 -1
- package/src/utils/voiceActivity/getVoiceActivityRole.spec.ts +150 -0
- package/src/utils/voiceActivity/getVoiceActivityRole.ts +16 -0
- package/src/utils/voiceActivity/getVoiceActivityText.spec.ts +100 -0
- package/src/utils/voiceActivity/getVoiceActivityText.ts +11 -0
- package/src/utils/voiceActivity/isVoiceActivity.spec.ts +202 -0
- package/src/utils/voiceActivity/isVoiceActivity.ts +21 -0
- package/src/utils/voiceActivity/isVoiceTranscriptActivity.spec.ts +224 -0
- package/src/utils/voiceActivity/isVoiceTranscriptActivity.ts +24 -0
- package/dist/botframework-webchat-core.mjs.LEGAL.txt +0 -0
- package/lib/actions/clearSuggestedActions.js +0 -15
- package/lib/actions/connect.js +0 -33
- package/lib/actions/connectionStatusUpdate.js +0 -20
- package/lib/actions/deleteActivity.d.ts +0 -13
- package/lib/actions/deleteActivity.d.ts.map +0 -1
- package/lib/actions/deleteActivity.js +0 -19
- package/lib/actions/disconnect.js +0 -21
- package/lib/actions/dismissNotification.d.ts +0 -12
- package/lib/actions/dismissNotification.d.ts.map +0 -1
- package/lib/actions/dismissNotification.js +0 -19
- package/lib/actions/emitTypingIndicator.js +0 -15
- package/lib/actions/incomingActivity.d.ts +0 -14
- package/lib/actions/incomingActivity.d.ts.map +0 -1
- package/lib/actions/incomingActivity.js +0 -19
- package/lib/actions/markActivity.d.ts +0 -17
- package/lib/actions/markActivity.d.ts.map +0 -1
- package/lib/actions/markActivity.js +0 -22
- package/lib/actions/postActivity.d.ts +0 -64
- package/lib/actions/postActivity.d.ts.map +0 -1
- package/lib/actions/postActivity.js +0 -31
- package/lib/actions/queueIncomingActivity.js +0 -18
- package/lib/actions/reconnect.js +0 -17
- package/lib/actions/sagaError.d.ts +0 -8
- package/lib/actions/sagaError.d.ts.map +0 -1
- package/lib/actions/sagaError.js +0 -15
- package/lib/actions/sendEvent.js +0 -19
- package/lib/actions/sendFiles.d.ts +0 -19
- package/lib/actions/sendFiles.d.ts.map +0 -1
- package/lib/actions/sendFiles.js +0 -20
- package/lib/actions/sendMessage.d.ts +0 -19
- package/lib/actions/sendMessage.d.ts.map +0 -1
- package/lib/actions/sendMessage.js +0 -24
- package/lib/actions/sendMessageBack.js +0 -20
- package/lib/actions/sendPostBack.js +0 -18
- package/lib/actions/setClockSkewAdjustment.js +0 -12
- package/lib/actions/setDictateInterims.js +0 -18
- package/lib/actions/setDictateState.js +0 -18
- package/lib/actions/setLanguage.js +0 -18
- package/lib/actions/setNotification.d.ts +0 -10
- package/lib/actions/setNotification.d.ts.map +0 -1
- package/lib/actions/setNotification.js +0 -37
- package/lib/actions/setReferenceGrammarID.js +0 -18
- package/lib/actions/setSendBox.js +0 -18
- package/lib/actions/setSendBoxAttachments.d.ts +0 -13
- package/lib/actions/setSendBoxAttachments.d.ts.map +0 -1
- package/lib/actions/setSendBoxAttachments.js +0 -18
- package/lib/actions/setSendTimeout.js +0 -18
- package/lib/actions/setSendTypingIndicator.d.ts +0 -11
- package/lib/actions/setSendTypingIndicator.d.ts.map +0 -1
- package/lib/actions/setSendTypingIndicator.js +0 -18
- package/lib/actions/setSuggestedActions.js +0 -20
- package/lib/actions/startDictate.js +0 -15
- package/lib/actions/startSpeakingActivity.js +0 -15
- package/lib/actions/stopDictate.js +0 -15
- package/lib/actions/stopSpeakingActivity.js +0 -15
- package/lib/actions/submitSendBox.js +0 -22
- package/lib/actions/updateConnectionStatus.js +0 -18
- package/lib/constants/ActivityClientState.js +0 -16
- package/lib/constants/DictateState.js +0 -17
- package/lib/createPromiseQueue.js +0 -30
- package/lib/createReducer.d.ts +0 -60
- package/lib/createReducer.d.ts.map +0 -1
- package/lib/createReducer.js +0 -45
- package/lib/createSagas.d.ts +0 -8
- package/lib/createSagas.d.ts.map +0 -1
- package/lib/createSagas.js +0 -112
- package/lib/createStore.d.ts.map +0 -1
- package/lib/createStore.js +0 -131
- package/lib/definitions/activityFromBot.js +0 -11
- package/lib/definitions/speakableActivity.js +0 -10
- package/lib/definitions/speakingActivity.js +0 -13
- package/lib/index.d.ts +0 -76
- package/lib/index.d.ts.map +0 -1
- package/lib/index.js +0 -309
- package/lib/reducers/connectivityStatus.js +0 -49
- package/lib/reducers/createActivitiesReducer.d.ts +0 -12
- package/lib/reducers/createActivitiesReducer.d.ts.map +0 -1
- package/lib/reducers/createActivitiesReducer.js +0 -267
- package/lib/reducers/createInternalReducer.d.ts +0 -10
- package/lib/reducers/createInternalReducer.d.ts.map +0 -1
- package/lib/reducers/createInternalReducer.js +0 -19
- package/lib/reducers/createNotificationsReducer.d.ts +0 -11
- package/lib/reducers/createNotificationsReducer.d.ts.map +0 -1
- package/lib/reducers/createNotificationsReducer.js +0 -55
- package/lib/reducers/createTypingReducer.d.ts +0 -14
- package/lib/reducers/createTypingReducer.d.ts.map +0 -1
- package/lib/reducers/createTypingReducer.js +0 -50
- package/lib/reducers/dictateInterims.js +0 -23
- package/lib/reducers/dictateState.js +0 -38
- package/lib/reducers/language.js +0 -23
- package/lib/reducers/private/findBeforeAfter.d.ts +0 -4
- package/lib/reducers/private/findBeforeAfter.d.ts.map +0 -1
- package/lib/reducers/private/findBeforeAfter.js +0 -24
- package/lib/reducers/readyState.js +0 -23
- package/lib/reducers/referenceGrammarID.js +0 -23
- package/lib/reducers/sendBoxAttachments.d.ts +0 -9
- package/lib/reducers/sendBoxAttachments.d.ts.map +0 -1
- package/lib/reducers/sendBoxAttachments.js +0 -23
- package/lib/reducers/sendBoxValue.js +0 -23
- package/lib/reducers/sendTimeout.js +0 -23
- package/lib/reducers/sendTypingIndicator.js +0 -23
- package/lib/reducers/shouldSpeakIncomingActivity.js +0 -25
- package/lib/reducers/suggestedActions.js +0 -32
- package/lib/sagas/clearSuggestedActionsOnPostActivitySaga.js +0 -62
- package/lib/sagas/connectSaga.js +0 -445
- package/lib/sagas/connectionStatusToNotificationSaga.js +0 -107
- package/lib/sagas/connectionStatusUpdateSaga.js +0 -63
- package/lib/sagas/detectSlowConnectionSaga.d.ts +0 -5
- package/lib/sagas/detectSlowConnectionSaga.d.ts.map +0 -1
- package/lib/sagas/detectSlowConnectionSaga.js +0 -50
- package/lib/sagas/effects/forever.js +0 -19
- package/lib/sagas/effects/forkPut.js +0 -51
- package/lib/sagas/effects/observeEach.js +0 -45
- package/lib/sagas/effects/observeOnce.d.ts +0 -3
- package/lib/sagas/effects/observeOnce.d.ts.map +0 -1
- package/lib/sagas/effects/observeOnce.js +0 -42
- package/lib/sagas/effects/whileConnected.d.ts +0 -7
- package/lib/sagas/effects/whileConnected.d.ts.map +0 -1
- package/lib/sagas/effects/whileConnected.js +0 -55
- package/lib/sagas/emitTypingIndicatorToPostActivitySaga.js +0 -63
- package/lib/sagas/markAllAsSpokenOnStopSpeakActivitySaga.js +0 -78
- package/lib/sagas/observeActivitySaga.d.ts +0 -2
- package/lib/sagas/observeActivitySaga.d.ts.map +0 -1
- package/lib/sagas/observeActivitySaga.js +0 -117
- package/lib/sagas/postActivitySaga.d.ts +0 -3
- package/lib/sagas/postActivitySaga.d.ts.map +0 -1
- package/lib/sagas/postActivitySaga.js +0 -264
- package/lib/sagas/queueIncomingActivitySaga.d.ts +0 -3
- package/lib/sagas/queueIncomingActivitySaga.d.ts.map +0 -1
- package/lib/sagas/queueIncomingActivitySaga.js +0 -197
- package/lib/sagas/sendEventToPostActivitySaga.js +0 -68
- package/lib/sagas/sendFilesToPostActivitySaga.js +0 -85
- package/lib/sagas/sendMessageBackToPostActivitySaga.js +0 -70
- package/lib/sagas/sendMessageToPostActivitySaga.d.ts +0 -2
- package/lib/sagas/sendMessageToPostActivitySaga.d.ts.map +0 -1
- package/lib/sagas/sendMessageToPostActivitySaga.js +0 -91
- package/lib/sagas/sendPostBackToPostActivitySaga.js +0 -69
- package/lib/sagas/sendTypingIndicatorOnSetSendBoxSaga.d.ts +0 -3
- package/lib/sagas/sendTypingIndicatorOnSetSendBoxSaga.d.ts.map +0 -1
- package/lib/sagas/sendTypingIndicatorOnSetSendBoxSaga.js +0 -145
- package/lib/sagas/speakActivityAndStartDictateOnIncomingActivityFromOthersSaga.js +0 -106
- package/lib/sagas/startDictateOnSpeakCompleteSaga.js +0 -65
- package/lib/sagas/startSpeakActivityOnPostActivitySaga.js +0 -62
- package/lib/sagas/stopDictateOnCardActionSaga.js +0 -65
- package/lib/sagas/stopSpeakingActivityOnInputSaga.js +0 -68
- package/lib/sagas/submitSendBoxSaga.js +0 -84
- package/lib/selectors/activities.d.ts +0 -9
- package/lib/selectors/activities.d.ts.map +0 -1
- package/lib/selectors/activities.js +0 -33
- package/lib/selectors/combineSelectors.js +0 -31
- package/lib/selectors/dictateState.js +0 -12
- package/lib/selectors/language.d.ts +0 -4
- package/lib/selectors/language.d.ts.map +0 -1
- package/lib/selectors/language.js +0 -12
- package/lib/selectors/notifications.js +0 -13
- package/lib/selectors/sendBoxAttachments.js +0 -11
- package/lib/selectors/sendBoxValue.js +0 -12
- package/lib/selectors/sendTimeout.d.ts +0 -4
- package/lib/selectors/sendTimeout.d.ts.map +0 -1
- package/lib/selectors/sendTimeout.js +0 -12
- package/lib/selectors/sendTypingIndicator.d.ts +0 -4
- package/lib/selectors/sendTypingIndicator.d.ts.map +0 -1
- package/lib/selectors/sendTypingIndicator.js +0 -12
- package/lib/selectors/shouldSpeakIncomingActivity.js +0 -12
- package/lib/types/AnyAnd.d.ts +0 -2
- package/lib/types/AnyAnd.d.ts.map +0 -1
- package/lib/types/AnyAnd.js +0 -6
- package/lib/types/GlobalScopePonyfill.d.ts +0 -8
- package/lib/types/GlobalScopePonyfill.d.ts.map +0 -1
- package/lib/types/GlobalScopePonyfill.js +0 -6
- package/lib/types/OneOrMany.d.ts +0 -3
- package/lib/types/OneOrMany.d.ts.map +0 -1
- package/lib/types/OneOrMany.js +0 -6
- package/lib/types/SendBoxAttachment.d.ts +0 -5
- package/lib/types/SendBoxAttachment.d.ts.map +0 -1
- package/lib/types/SendBoxAttachment.js +0 -6
- package/lib/types/WebChatActivity.d.ts +0 -128
- package/lib/types/WebChatActivity.d.ts.map +0 -1
- package/lib/types/WebChatActivity.js +0 -6
- package/lib/types/external/DirectLineActivity.d.ts +0 -3
- package/lib/types/external/DirectLineActivity.d.ts.map +0 -1
- package/lib/types/external/DirectLineActivity.js +0 -6
- package/lib/types/external/DirectLineAnimationCard.d.ts +0 -6
- package/lib/types/external/DirectLineAnimationCard.d.ts.map +0 -1
- package/lib/types/external/DirectLineAnimationCard.js +0 -6
- package/lib/types/external/DirectLineAttachment.d.ts +0 -9
- package/lib/types/external/DirectLineAttachment.d.ts.map +0 -1
- package/lib/types/external/DirectLineAttachment.js +0 -6
- package/lib/types/external/DirectLineAudioCard.d.ts +0 -6
- package/lib/types/external/DirectLineAudioCard.d.ts.map +0 -1
- package/lib/types/external/DirectLineAudioCard.js +0 -6
- package/lib/types/external/DirectLineBasicCardEssence.d.ts +0 -12
- package/lib/types/external/DirectLineBasicCardEssence.d.ts.map +0 -1
- package/lib/types/external/DirectLineBasicCardEssence.js +0 -6
- package/lib/types/external/DirectLineCardAction.d.ts +0 -110
- package/lib/types/external/DirectLineCardAction.d.ts.map +0 -1
- package/lib/types/external/DirectLineCardAction.js +0 -6
- package/lib/types/external/DirectLineCardImage.d.ts +0 -8
- package/lib/types/external/DirectLineCardImage.d.ts.map +0 -1
- package/lib/types/external/DirectLineCardImage.js +0 -6
- package/lib/types/external/DirectLineHeroCard.d.ts +0 -6
- package/lib/types/external/DirectLineHeroCard.d.ts.map +0 -1
- package/lib/types/external/DirectLineHeroCard.js +0 -6
- package/lib/types/external/DirectLineJSBotConnection.d.ts +0 -3
- package/lib/types/external/DirectLineJSBotConnection.d.ts.map +0 -1
- package/lib/types/external/DirectLineJSBotConnection.js +0 -6
- package/lib/types/external/DirectLineMediaCardEssence.d.ts +0 -21
- package/lib/types/external/DirectLineMediaCardEssence.d.ts.map +0 -1
- package/lib/types/external/DirectLineMediaCardEssence.js +0 -6
- package/lib/types/external/DirectLineOAuthCard.d.ts +0 -8
- package/lib/types/external/DirectLineOAuthCard.d.ts.map +0 -1
- package/lib/types/external/DirectLineOAuthCard.js +0 -6
- package/lib/types/external/DirectLineReceiptCard.d.ts +0 -28
- package/lib/types/external/DirectLineReceiptCard.d.ts.map +0 -1
- package/lib/types/external/DirectLineReceiptCard.js +0 -6
- package/lib/types/external/DirectLineSignInCard.d.ts +0 -8
- package/lib/types/external/DirectLineSignInCard.d.ts.map +0 -1
- package/lib/types/external/DirectLineSignInCard.js +0 -6
- package/lib/types/external/DirectLineSuggestedAction.d.ts +0 -7
- package/lib/types/external/DirectLineSuggestedAction.d.ts.map +0 -1
- package/lib/types/external/DirectLineSuggestedAction.js +0 -6
- package/lib/types/external/DirectLineThumbnailCard.d.ts +0 -6
- package/lib/types/external/DirectLineThumbnailCard.d.ts.map +0 -1
- package/lib/types/external/DirectLineThumbnailCard.js +0 -6
- package/lib/types/external/DirectLineVideoCard.d.ts +0 -6
- package/lib/types/external/DirectLineVideoCard.d.ts.map +0 -1
- package/lib/types/external/DirectLineVideoCard.js +0 -6
- package/lib/types/external/Observable.d.ts +0 -49
- package/lib/types/external/Observable.d.ts.map +0 -1
- package/lib/types/external/Observable.js +0 -6
- package/lib/types/external/OrgSchema/Action.d.ts +0 -29
- package/lib/types/external/OrgSchema/Action.d.ts.map +0 -1
- package/lib/types/external/OrgSchema/Action.js +0 -38
- package/lib/types/external/OrgSchema/Claim.d.ts +0 -35
- package/lib/types/external/OrgSchema/Claim.d.ts.map +0 -1
- package/lib/types/external/OrgSchema/Claim.js +0 -41
- package/lib/types/external/OrgSchema/CreativeWork.d.ts +0 -57
- package/lib/types/external/OrgSchema/CreativeWork.d.ts.map +0 -1
- package/lib/types/external/OrgSchema/CreativeWork.js +0 -52
- package/lib/types/external/OrgSchema/DefinedTerm.d.ts +0 -26
- package/lib/types/external/OrgSchema/DefinedTerm.d.ts.map +0 -1
- package/lib/types/external/OrgSchema/DefinedTerm.js +0 -33
- package/lib/types/external/OrgSchema/Project.d.ts +0 -20
- package/lib/types/external/OrgSchema/Project.d.ts.map +0 -1
- package/lib/types/external/OrgSchema/Project.js +0 -32
- package/lib/types/external/OrgSchema/Thing.d.ts +0 -53
- package/lib/types/external/OrgSchema/Thing.d.ts.map +0 -1
- package/lib/types/external/OrgSchema/Thing.js +0 -54
- package/lib/types/external/OrgSchema/VoteAction.d.ts +0 -22
- package/lib/types/external/OrgSchema/VoteAction.d.ts.map +0 -1
- package/lib/types/external/OrgSchema/VoteAction.js +0 -34
- package/lib/types/external/OrgSchema/private/orgSchemaProperties.d.ts +0 -3
- package/lib/types/external/OrgSchema/private/orgSchemaProperties.d.ts.map +0 -1
- package/lib/types/external/OrgSchema/private/orgSchemaProperties.js +0 -22
- package/lib/types/external/OrgSchema/private/orgSchemaProperty.d.ts +0 -4
- package/lib/types/external/OrgSchema/private/orgSchemaProperty.d.ts.map +0 -1
- package/lib/types/external/OrgSchema/private/orgSchemaProperty.js +0 -15
- package/lib/types/internal/GlobalScopeClock.d.ts +0 -15
- package/lib/types/internal/GlobalScopeClock.d.ts.map +0 -1
- package/lib/types/internal/GlobalScopeClock.js +0 -6
- package/lib/types/internal/Notification.d.ts +0 -10
- package/lib/types/internal/Notification.d.ts.map +0 -1
- package/lib/types/internal/Notification.js +0 -6
- package/lib/types/internal/ReduxState.d.ts +0 -19
- package/lib/types/internal/ReduxState.d.ts.map +0 -1
- package/lib/types/internal/ReduxState.js +0 -6
- package/lib/types/internal/SendStatus.d.ts +0 -7
- package/lib/types/internal/SendStatus.d.ts.map +0 -1
- package/lib/types/internal/SendStatus.js +0 -19
- package/lib/types/internal/WebChatOutgoingActivity.d.ts +0 -49
- package/lib/types/internal/WebChatOutgoingActivity.d.ts.map +0 -1
- package/lib/types/internal/WebChatOutgoingActivity.js +0 -6
- package/lib/utils/dateToLocaleISOString.d.ts +0 -2
- package/lib/utils/dateToLocaleISOString.d.ts.map +0 -1
- package/lib/utils/dateToLocaleISOString.js +0 -52
- package/lib/utils/deleteKey.d.ts +0 -2
- package/lib/utils/deleteKey.d.ts.map +0 -1
- package/lib/utils/deleteKey.js +0 -30
- package/lib/utils/getOrgSchemaMessage.d.ts +0 -4
- package/lib/utils/getOrgSchemaMessage.d.ts.map +0 -1
- package/lib/utils/getOrgSchemaMessage.js +0 -21
- package/lib/utils/isForbiddenPropertyName.d.ts +0 -2
- package/lib/utils/isForbiddenPropertyName.d.ts.map +0 -1
- package/lib/utils/isForbiddenPropertyName.js +0 -16
- package/lib/utils/onErrorResumeNext.d.ts +0 -3
- package/lib/utils/onErrorResumeNext.d.ts.map +0 -1
- package/lib/utils/onErrorResumeNext.js +0 -19
- package/lib/utils/once.d.ts +0 -2
- package/lib/utils/once.d.ts.map +0 -1
- package/lib/utils/once.js +0 -16
- package/lib/utils/singleToArray.d.ts +0 -2
- package/lib/utils/singleToArray.d.ts.map +0 -1
- package/lib/utils/singleToArray.js +0 -10
- package/lib/utils/sleep.d.ts +0 -3
- package/lib/utils/sleep.d.ts.map +0 -1
- package/lib/utils/sleep.js +0 -12
- package/lib/utils/uniqueID.d.ts +0 -2
- package/lib/utils/uniqueID.d.ts.map +0 -1
- package/lib/utils/uniqueID.js +0 -14
- package/lib/utils/warnOnce.d.ts +0 -2
- package/lib/utils/warnOnce.d.ts.map +0 -1
- package/lib/utils/warnOnce.js +0 -14
- package/src/actions/clearSuggestedActions.js +0 -9
- package/src/actions/setSuggestedActions.js +0 -12
- package/src/constants/DictateState.js +0 -7
- package/src/reducers/createActivitiesReducer.ts +0 -304
- package/src/reducers/private/findBeforeAfter.spec.ts +0 -90
- package/src/reducers/private/findBeforeAfter.ts +0 -30
- package/src/reducers/suggestedActions.js +0 -23
- package/src/types/OneOrMany.ts +0 -3
- package/src/types/external/OrgSchema/Action.spec.ts +0 -35
- package/src/types/external/OrgSchema/Action.ts +0 -52
- package/src/types/external/OrgSchema/Claim.spec.ts +0 -45
- package/src/types/external/OrgSchema/Claim.ts +0 -48
- package/src/types/external/OrgSchema/CreativeWork.parseCreativeWork.spec.ts +0 -51
- package/src/types/external/OrgSchema/CreativeWork.ts +0 -83
- package/src/types/external/OrgSchema/DefinedTerm.ts +0 -37
- package/src/types/external/OrgSchema/Project.parseProject.spec.ts +0 -17
- package/src/types/external/OrgSchema/Project.ts +0 -29
- package/src/types/external/OrgSchema/Thing.parseThing.spec.ts +0 -54
- package/src/types/external/OrgSchema/Thing.ts +0 -94
- package/src/types/external/OrgSchema/VoteAction.spec.ts +0 -35
- package/src/types/external/OrgSchema/VoteAction.ts +0 -31
- package/src/types/external/OrgSchema/private/orgSchemaProperties.spec.ts +0 -41
- package/src/types/external/OrgSchema/private/orgSchemaProperties.ts +0 -23
- package/src/types/external/OrgSchema/private/orgSchemaProperty.spec.ts +0 -21
- package/src/types/external/OrgSchema/private/orgSchemaProperty.ts +0 -6
- package/src/utils/isForbiddenPropertyName.spec.js +0 -6
- package/src/utils/isForbiddenPropertyName.ts +0 -33
- package/src/utils/singleToArray.ts +0 -3
- package/src/utils/warnOnce.ts +0 -5
- /package/src/actions/{connectionStatusUpdate.js → connectionStatusUpdate.ts} +0 -0
- /package/src/actions/{disconnect.js → disconnect.ts} +0 -0
- /package/src/actions/{emitTypingIndicator.js → emitTypingIndicator.ts} +0 -0
- /package/src/actions/{queueIncomingActivity.js → queueIncomingActivity.ts} +0 -0
- /package/src/actions/{reconnect.js → reconnect.ts} +0 -0
- /package/src/actions/{startDictate.js → startDictate.ts} +0 -0
- /package/src/actions/{startSpeakingActivity.js → startSpeakingActivity.ts} +0 -0
- /package/src/actions/{stopDictate.js → stopDictate.ts} +0 -0
- /package/src/actions/{stopSpeakingActivity.js → stopSpeakingActivity.ts} +0 -0
- /package/src/actions/{updateConnectionStatus.js → updateConnectionStatus.ts} +0 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const VOICE_STOP_RECORDING = 'WEB_CHAT/VOICE_STOP_RECORDING' as const;
|
|
2
|
+
|
|
3
|
+
type VoiceStopRecordingAction = {
|
|
4
|
+
type: typeof VOICE_STOP_RECORDING;
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
function stopVoiceRecording(): VoiceStopRecordingAction {
|
|
8
|
+
return {
|
|
9
|
+
type: VOICE_STOP_RECORDING
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export default stopVoiceRecording;
|
|
14
|
+
|
|
15
|
+
export { VOICE_STOP_RECORDING };
|
|
16
|
+
|
|
17
|
+
export type { VoiceStopRecordingAction };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const SUBMIT_SEND_BOX = 'WEB_CHAT/SUBMIT_SEND_BOX';
|
|
2
2
|
|
|
3
|
-
export default function submitSendBox(method = 'keyboard', { channelData } = {}) {
|
|
3
|
+
export default function submitSendBox(method = 'keyboard', { channelData } = { channelData: undefined }) {
|
|
4
4
|
return {
|
|
5
5
|
type: SUBMIT_SEND_BOX,
|
|
6
6
|
payload: { channelData, method }
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const VOICE_UNMUTE_RECORDING = 'WEB_CHAT/VOICE_UNMUTE_RECORDING' as const;
|
|
2
|
+
|
|
3
|
+
type VoiceUnmuteRecordingAction = {
|
|
4
|
+
type: typeof VOICE_UNMUTE_RECORDING;
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
function unmuteVoiceRecording(): VoiceUnmuteRecordingAction {
|
|
8
|
+
return {
|
|
9
|
+
type: VOICE_UNMUTE_RECORDING
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export default unmuteVoiceRecording;
|
|
14
|
+
|
|
15
|
+
export { VOICE_UNMUTE_RECORDING };
|
|
16
|
+
|
|
17
|
+
export type { VoiceUnmuteRecordingAction };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type Action } from 'redux';
|
|
2
|
+
import { custom, function_, is, literal, object, pipe, readonly, type InferOutput } from 'valibot';
|
|
3
|
+
|
|
4
|
+
const UNREGISTER_ACTION_SINK = 'WEB_CHAT_INTERNAL/UNREGISTER_ACTION_SINK' as const;
|
|
5
|
+
|
|
6
|
+
const unregisterActionSinkActionSchema = pipe(
|
|
7
|
+
object({
|
|
8
|
+
payload: pipe(
|
|
9
|
+
object({
|
|
10
|
+
sink: custom<(action: Action) => void>(value => is(function_(), value))
|
|
11
|
+
}),
|
|
12
|
+
readonly()
|
|
13
|
+
),
|
|
14
|
+
type: literal(UNREGISTER_ACTION_SINK)
|
|
15
|
+
}),
|
|
16
|
+
readonly()
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
type UnregisterActionSinkAction = InferOutput<typeof unregisterActionSinkActionSchema>;
|
|
20
|
+
|
|
21
|
+
function unregisterActionSink(sink: (action: Action) => void): UnregisterActionSinkAction {
|
|
22
|
+
return {
|
|
23
|
+
payload: { sink },
|
|
24
|
+
type: UNREGISTER_ACTION_SINK
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export default unregisterActionSink;
|
|
29
|
+
export { UNREGISTER_ACTION_SINK, unregisterActionSinkActionSchema, type UnregisterActionSinkAction };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const VOICE_UNREGISTER_HANDLER = 'WEB_CHAT/VOICE_UNREGISTER_HANDLER' as const;
|
|
2
|
+
|
|
3
|
+
type VoiceUnregisterHandlerAction = {
|
|
4
|
+
type: typeof VOICE_UNREGISTER_HANDLER;
|
|
5
|
+
payload: { id: string };
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
function unregisterVoiceHandler(id: string): VoiceUnregisterHandlerAction {
|
|
9
|
+
return {
|
|
10
|
+
type: VOICE_UNREGISTER_HANDLER,
|
|
11
|
+
payload: { id }
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export default unregisterVoiceHandler;
|
|
16
|
+
|
|
17
|
+
export { VOICE_UNREGISTER_HANDLER };
|
|
18
|
+
|
|
19
|
+
export type { VoiceUnregisterHandlerAction };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export { getLocalIdFromActivity, LocalIdSchema, type LocalId } from '../reducers/activities/sort/property/LocalId';
|
|
2
|
+
export {
|
|
3
|
+
getPositionFromActivity,
|
|
4
|
+
PositionSchema,
|
|
5
|
+
queryPositionFromActivity,
|
|
6
|
+
type Position
|
|
7
|
+
} from '../reducers/activities/sort/property/Position';
|
|
8
|
+
export {
|
|
9
|
+
getReceivedAtFromActivity,
|
|
10
|
+
queryReceivedAtFromActivity,
|
|
11
|
+
ReceivedAtSchema,
|
|
12
|
+
type ReceivedAt
|
|
13
|
+
} from '../reducers/activities/sort/property/ReceivedAt';
|
|
14
|
+
export {
|
|
15
|
+
getSendStatusFromOutgoingActivity,
|
|
16
|
+
querySendStatusFromOutgoingActivity,
|
|
17
|
+
SendStatusSchema,
|
|
18
|
+
type SendStatus
|
|
19
|
+
} from '../reducers/activities/sort/property/SendStatus';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export {
|
|
2
|
+
IdentifierSchema,
|
|
3
|
+
isOfType,
|
|
4
|
+
MessageNodeSchema,
|
|
5
|
+
SlantGraph,
|
|
6
|
+
SlantNodeSchema,
|
|
7
|
+
type GraphMiddleware,
|
|
8
|
+
type GraphNode,
|
|
9
|
+
type GraphState,
|
|
10
|
+
type GraphSubscriber,
|
|
11
|
+
type GraphSubscriberRecord,
|
|
12
|
+
type Identifier,
|
|
13
|
+
type MessageNode,
|
|
14
|
+
type ReadableGraph,
|
|
15
|
+
type SlantNode,
|
|
16
|
+
type WritableGraph
|
|
17
|
+
} from '@msinternal/botframework-webchat-core-graph';
|
|
18
|
+
export { default as createGraphFromStore } from '../graph/createGraphFromStore';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export {
|
|
2
|
+
SET_RAW_STATE,
|
|
3
|
+
default as setRawState,
|
|
4
|
+
setRawStateActionSchema,
|
|
5
|
+
type SetRawStateAction
|
|
6
|
+
} from '../internal/actions/setRawState';
|
|
7
|
+
|
|
8
|
+
export { default as StoreDebugAPIRegistry } from '../internal/StoreDebugAPIRegistry';
|
|
9
|
+
export { type StoreDebugAPI } from '../types/StoreDebugAPI';
|
|
10
|
+
|
|
11
|
+
export { RestrictedDebugAPI, type InferPublic } from '@msinternal/botframework-webchat-core-debug-api';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export {
|
|
2
|
+
orgSchemaActionSchema,
|
|
3
|
+
orgSchemaClaimSchema,
|
|
4
|
+
orgSchemaCreativeWorkSchema,
|
|
5
|
+
orgSchemaDefinedTermSchema,
|
|
6
|
+
orgSchemaPersonSchema,
|
|
7
|
+
orgSchemaProjectSchema,
|
|
8
|
+
orgSchemaSoftwareSourceCodeSchema,
|
|
9
|
+
orgSchemaThingSchema,
|
|
10
|
+
orgSchemaUserReviewSchema,
|
|
11
|
+
orgSchemaVoteActionSchema,
|
|
12
|
+
parseAction,
|
|
13
|
+
parseClaim,
|
|
14
|
+
parseCreativeWork,
|
|
15
|
+
parseDefinedTerm,
|
|
16
|
+
parseProject,
|
|
17
|
+
parseThing,
|
|
18
|
+
parseVoteAction,
|
|
19
|
+
type OrgSchemaAction,
|
|
20
|
+
type OrgSchemaClaim,
|
|
21
|
+
type OrgSchemaCreativeWork,
|
|
22
|
+
type OrgSchemaDefinedTerm,
|
|
23
|
+
type OrgSchemaPerson,
|
|
24
|
+
type OrgSchemaProject,
|
|
25
|
+
type OrgSchemaSoftwareSourceCode,
|
|
26
|
+
type OrgSchemaThing,
|
|
27
|
+
type OrgSchemaUserReview,
|
|
28
|
+
type OrgSchemaVoteAction
|
|
29
|
+
} from '@msinternal/botframework-webchat-core-json-ld';
|
package/src/buildInfo.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { createBuildInfo } from '@msinternal/botframework-webchat-base/utils';
|
|
2
|
+
|
|
3
|
+
const buildInfo = createBuildInfo('botframework-webchat:core');
|
|
4
|
+
|
|
5
|
+
buildInfo.set('buildTool', globalThis.WEB_CHAT_BUILD_INFO_BUILD_TOOL);
|
|
6
|
+
buildInfo.set('moduleFormat', globalThis.WEB_CHAT_BUILD_INFO_MODULE_FORMAT);
|
|
7
|
+
buildInfo.set('version', globalThis.WEB_CHAT_BUILD_INFO_VERSION);
|
|
8
|
+
|
|
9
|
+
export default buildInfo;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/** @deprecated This constant is being deprecated, please use string literal instead. Will be remove on or after 2024-07-31. */
|
|
2
|
-
const SEND_FAILED = 'send failed';
|
|
2
|
+
const SEND_FAILED = 'send failed' as const;
|
|
3
3
|
/** @deprecated This constant is being deprecated, please use string literal instead. Will be remove on or after 2024-07-31. */
|
|
4
|
-
const SENDING = 'sending';
|
|
4
|
+
const SENDING = 'sending' as const;
|
|
5
5
|
/** @deprecated This constant is being deprecated, please use string literal instead. Will be remove on or after 2024-07-31. */
|
|
6
|
-
const SENT = 'sent';
|
|
6
|
+
const SENT = 'sent' as const;
|
|
7
7
|
|
|
8
8
|
export { SEND_FAILED, SENDING, SENT };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
const IDLE = 0 as const;
|
|
2
|
+
const WILL_START = 1 as const;
|
|
3
|
+
// eslint-disable-next-line no-magic-numbers
|
|
4
|
+
const STARTING = 2 as const;
|
|
5
|
+
// eslint-disable-next-line no-magic-numbers
|
|
6
|
+
const DICTATING = 3 as const;
|
|
7
|
+
// eslint-disable-next-line no-magic-numbers
|
|
8
|
+
const STOPPING = 4 as const;
|
|
9
|
+
|
|
10
|
+
export { DICTATING, IDLE, STARTING, STOPPING, WILL_START };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { withResolvers } from '@msinternal/botframework-webchat-base/utils';
|
|
2
2
|
|
|
3
3
|
export default function createPromiseQueue() {
|
|
4
|
-
let
|
|
4
|
+
let promiseWithResolvers;
|
|
5
5
|
const queue = [];
|
|
6
6
|
|
|
7
7
|
const push = value => {
|
|
8
|
-
if (
|
|
9
|
-
const { resolve } =
|
|
8
|
+
if (promiseWithResolvers) {
|
|
9
|
+
const { resolve } = promiseWithResolvers;
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
promiseWithResolvers = null;
|
|
12
12
|
resolve(value);
|
|
13
13
|
} else {
|
|
14
14
|
queue.push(value);
|
|
@@ -16,7 +16,9 @@ export default function createPromiseQueue() {
|
|
|
16
16
|
};
|
|
17
17
|
|
|
18
18
|
const shift = () =>
|
|
19
|
-
queue.length
|
|
19
|
+
queue.length
|
|
20
|
+
? Promise.resolve(queue.shift())
|
|
21
|
+
: (promiseWithResolvers || (promiseWithResolvers = withResolvers())).promise;
|
|
20
22
|
|
|
21
23
|
return {
|
|
22
24
|
push,
|
package/src/createReducer.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { combineReducers } from 'redux';
|
|
2
2
|
|
|
3
|
+
import combineActivitiesReducer from './reducers/activities/combineActivitiesReducer';
|
|
3
4
|
import connectivityStatus from './reducers/connectivityStatus';
|
|
4
|
-
import createActivitiesReducer from './reducers/createActivitiesReducer';
|
|
5
5
|
import createInternalReducer from './reducers/createInternalReducer';
|
|
6
6
|
import createNotificationsReducer from './reducers/createNotificationsReducer';
|
|
7
7
|
import createTypingReducer from './reducers/createTypingReducer';
|
|
@@ -16,26 +16,34 @@ import sendTimeout from './reducers/sendTimeout';
|
|
|
16
16
|
import sendTypingIndicator from './reducers/sendTypingIndicator';
|
|
17
17
|
import shouldSpeakIncomingActivity from './reducers/shouldSpeakIncomingActivity';
|
|
18
18
|
import suggestedActions from './reducers/suggestedActions';
|
|
19
|
+
import suggestedActionsOriginActivity from './reducers/suggestedActionsOriginActivity';
|
|
20
|
+
import voiceActivity from './reducers/voiceActivity';
|
|
19
21
|
|
|
20
22
|
import type { GlobalScopePonyfill } from './types/GlobalScopePonyfill';
|
|
23
|
+
import type { RestrictedStoreDebugAPI } from './types/StoreDebugAPI';
|
|
21
24
|
|
|
22
|
-
export default function createReducer(ponyfill: GlobalScopePonyfill) {
|
|
23
|
-
return
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
25
|
+
export default function createReducer(ponyfill: GlobalScopePonyfill, restrictedStoreDebugAPI: RestrictedStoreDebugAPI) {
|
|
26
|
+
return combineActivitiesReducer(
|
|
27
|
+
ponyfill,
|
|
28
|
+
restrictedStoreDebugAPI,
|
|
29
|
+
combineReducers({
|
|
30
|
+
connectivityStatus,
|
|
31
|
+
dictateInterims,
|
|
32
|
+
dictateState,
|
|
33
|
+
internal: createInternalReducer(ponyfill),
|
|
34
|
+
language,
|
|
35
|
+
notifications: createNotificationsReducer(ponyfill),
|
|
36
|
+
readyState,
|
|
37
|
+
referenceGrammarID,
|
|
38
|
+
sendBoxAttachments,
|
|
39
|
+
sendBoxValue,
|
|
40
|
+
sendTimeout,
|
|
41
|
+
sendTypingIndicator,
|
|
42
|
+
shouldSpeakIncomingActivity,
|
|
43
|
+
suggestedActions,
|
|
44
|
+
suggestedActionsOriginActivity,
|
|
45
|
+
typing: createTypingReducer(ponyfill),
|
|
46
|
+
voice: voiceActivity
|
|
47
|
+
})
|
|
48
|
+
);
|
|
41
49
|
}
|
package/src/createSagas.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { type Saga } from 'redux-saga';
|
|
1
2
|
import { fork } from 'redux-saga/effects';
|
|
2
3
|
|
|
4
|
+
import actionSinkSaga from './sagas/actionSinkSaga';
|
|
3
5
|
import clearSuggestedActionsOnPostActivitySaga from './sagas/clearSuggestedActionsOnPostActivitySaga';
|
|
4
6
|
import connectionStatusToNotificationSaga from './sagas/connectionStatusToNotificationSaga';
|
|
5
7
|
import connectionStatusUpdateSaga from './sagas/connectionStatusUpdateSaga';
|
|
@@ -22,9 +24,8 @@ import startSpeakActivityOnPostActivitySaga from './sagas/startSpeakActivityOnPo
|
|
|
22
24
|
import stopDictateOnCardActionSaga from './sagas/stopDictateOnCardActionSaga';
|
|
23
25
|
import stopSpeakingActivityOnInputSaga from './sagas/stopSpeakingActivityOnInputSaga';
|
|
24
26
|
import submitSendBoxSaga from './sagas/submitSendBoxSaga';
|
|
25
|
-
|
|
26
|
-
import type
|
|
27
|
-
import type { Saga } from 'redux-saga';
|
|
27
|
+
import postVoiceActivitySaga from './sagas/postVoiceActivitySaga';
|
|
28
|
+
import { type GlobalScopePonyfill } from './types/GlobalScopePonyfill';
|
|
28
29
|
|
|
29
30
|
type CreateSagasOptions = {
|
|
30
31
|
ponyfill: GlobalScopePonyfill;
|
|
@@ -34,6 +35,7 @@ export default function createSagas({ ponyfill }: CreateSagasOptions): Saga {
|
|
|
34
35
|
return function* () {
|
|
35
36
|
// TODO: [P2] Since fork() silently catches all exceptions, we need to find a way to console.error them out.
|
|
36
37
|
|
|
38
|
+
yield fork(actionSinkSaga);
|
|
37
39
|
yield fork(clearSuggestedActionsOnPostActivitySaga);
|
|
38
40
|
yield fork(connectionStatusToNotificationSaga);
|
|
39
41
|
yield fork(connectionStatusUpdateSaga);
|
|
@@ -43,6 +45,7 @@ export default function createSagas({ ponyfill }: CreateSagasOptions): Saga {
|
|
|
43
45
|
yield fork(markAllAsSpokenOnStopSpeakActivitySaga);
|
|
44
46
|
yield fork(observeActivitySaga);
|
|
45
47
|
yield fork(postActivitySaga, ponyfill);
|
|
48
|
+
yield fork(postVoiceActivitySaga, ponyfill);
|
|
46
49
|
yield fork(queueIncomingActivitySaga, ponyfill);
|
|
47
50
|
yield fork(sendEventToPostActivitySaga);
|
|
48
51
|
yield fork(sendFilesToPostActivitySaga);
|
package/src/createStore.ts
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { composeWithDevTools } from '@redux-devtools/extension';
|
|
2
|
+
import { applyMiddleware, createStore as createReduxStore, type Middleware, type Store } from 'redux';
|
|
3
3
|
import createSagaMiddleware from 'redux-saga';
|
|
4
4
|
|
|
5
|
+
import sagaError from './actions/sagaError';
|
|
5
6
|
import createReducer from './createReducer';
|
|
6
7
|
import createSagas from './createSagas';
|
|
7
|
-
import
|
|
8
|
+
import { RestrictedStoreDebugAPI } from './types/StoreDebugAPI';
|
|
8
9
|
|
|
9
10
|
import type { GlobalScopePonyfill } from './types/GlobalScopePonyfill';
|
|
11
|
+
import StoreDebugAPIRegistry from './internal/StoreDebugAPIRegistry';
|
|
10
12
|
|
|
11
13
|
type CreateStoreOptions = {
|
|
12
14
|
/**
|
|
@@ -29,7 +31,7 @@ type CreateStoreOptions = {
|
|
|
29
31
|
ponyfill?: Partial<GlobalScopePonyfill>;
|
|
30
32
|
};
|
|
31
33
|
|
|
32
|
-
function createEnhancerAndSagaMiddleware(getStore, ...middlewares) {
|
|
34
|
+
function createEnhancerAndSagaMiddleware(getStore: () => any, ...middlewares: readonly Middleware[]) {
|
|
33
35
|
const sagaMiddleware = createSagaMiddleware({
|
|
34
36
|
onError: (...args) => {
|
|
35
37
|
const [err] = args;
|
|
@@ -56,7 +58,11 @@ function createEnhancerAndSagaMiddleware(getStore, ...middlewares) {
|
|
|
56
58
|
|
|
57
59
|
// The complexity is introduced by the check of ponyfill.
|
|
58
60
|
// eslint-disable-next-line complexity
|
|
59
|
-
export function withOptions(
|
|
61
|
+
export function withOptions(
|
|
62
|
+
options: CreateStoreOptions,
|
|
63
|
+
initialState?: any | undefined,
|
|
64
|
+
...middlewares: readonly Middleware[]
|
|
65
|
+
): Store {
|
|
60
66
|
// IE Mode does not have `globalThis`.
|
|
61
67
|
const globalThisOrWindow = typeof globalThis === 'undefined' ? window : globalThis;
|
|
62
68
|
const ponyfillFromOptions: Partial<GlobalScopePonyfill> = options.ponyfill || {};
|
|
@@ -108,15 +114,25 @@ export function withOptions(options: CreateStoreOptions, initialState?, ...middl
|
|
|
108
114
|
(typeof setTimeout === 'function' ? setTimeout.bind(globalThisOrWindow) : undefined)
|
|
109
115
|
};
|
|
110
116
|
|
|
117
|
+
// We are doing lazy init and cyclic dependencies.
|
|
118
|
+
// eslint-disable-next-line prefer-const
|
|
119
|
+
let store: Store | undefined;
|
|
120
|
+
|
|
121
|
+
const restrictedStoreDebugAPI = new RestrictedStoreDebugAPI(() => store?.getState().activities);
|
|
122
|
+
|
|
111
123
|
// We are sure the "getStore" (first argument) is not called on "createEnhancerAndSagaMiddleware()".
|
|
112
|
-
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
113
124
|
const { enhancer, sagaMiddleware } = createEnhancerAndSagaMiddleware(() => store, ...middlewares);
|
|
114
|
-
|
|
115
|
-
|
|
125
|
+
|
|
126
|
+
store = createReduxStore(
|
|
127
|
+
createReducer(ponyfill, restrictedStoreDebugAPI),
|
|
116
128
|
initialState || {},
|
|
117
129
|
options.devTools ? composeWithDevTools(enhancer) : enhancer
|
|
118
130
|
);
|
|
119
131
|
|
|
132
|
+
// TODO: [P1] When we redesign the store and chat adapter, we should have the Debug API stored somewhere else.
|
|
133
|
+
StoreDebugAPIRegistry.set(store, restrictedStoreDebugAPI.toPublic());
|
|
134
|
+
|
|
135
|
+
// TODO: [P1] When we redesign the store and chat adapter, we shoulstore.getState().activities
|
|
120
136
|
sagaMiddleware.run(createSagas({ ponyfill }));
|
|
121
137
|
|
|
122
138
|
return store;
|
|
@@ -127,7 +143,7 @@ export function withOptions(options: CreateStoreOptions, initialState?, ...middl
|
|
|
127
143
|
*
|
|
128
144
|
* This store is critical for Web Chat business logics to operate, please use with cautions.
|
|
129
145
|
*/
|
|
130
|
-
export default function createStore(initialState
|
|
146
|
+
export default function createStore(initialState?: any, ...middlewares: readonly Middleware[]): Store {
|
|
131
147
|
return withOptions({}, initialState, ...middlewares);
|
|
132
148
|
}
|
|
133
149
|
|
|
@@ -138,6 +154,6 @@ export default function createStore(initialState?, ...middlewares): Store {
|
|
|
138
154
|
*
|
|
139
155
|
* @deprecated Use `withOptions` instead and pass `{ devTools: true }`
|
|
140
156
|
*/
|
|
141
|
-
export function withDevTools(initialState
|
|
157
|
+
export function withDevTools(initialState?: any, ...middlewares: readonly Middleware[]): Store {
|
|
142
158
|
return withOptions({ devTools: true }, initialState, ...middlewares);
|
|
143
159
|
}
|
package/src/env.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// For adding things to `globalThis`, TypeScript need `var`, not `const` or `let`.
|
|
2
|
+
/* eslint-disable no-var */
|
|
3
|
+
declare global {
|
|
4
|
+
const clearImmediate: ((timeout: number) => void) | undefined;
|
|
5
|
+
const setImmediate: ((fn: () => void) => number) | undefined;
|
|
6
|
+
|
|
7
|
+
var WEB_CHAT_BUILD_INFO_BUILD_TOOL: string | undefined;
|
|
8
|
+
var WEB_CHAT_BUILD_INFO_MODULE_FORMAT: string | undefined;
|
|
9
|
+
var WEB_CHAT_BUILD_INFO_VERSION: string | undefined;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { SlantGraph, SlantNodeSchema } from '@msinternal/botframework-webchat-core-graph';
|
|
2
|
+
import { parse } from 'valibot';
|
|
3
|
+
import type createStore from '../createStore';
|
|
4
|
+
import { getLocalIdFromActivity } from '../reducers/activities/sort/property/LocalId';
|
|
5
|
+
import { getPositionFromActivity } from '../reducers/activities/sort/property/Position';
|
|
6
|
+
import type { Activity } from '../reducers/activities/sort/types';
|
|
7
|
+
|
|
8
|
+
function createGraphFromStore(store: ReturnType<typeof createStore>): SlantGraph {
|
|
9
|
+
const graph = new SlantGraph();
|
|
10
|
+
let prevActivities: readonly Activity[] | undefined;
|
|
11
|
+
|
|
12
|
+
// TODO: [P0] Except channel audience, we should be specific about all audience, e.g. name.
|
|
13
|
+
const channelAudience = parse(SlantNodeSchema, {
|
|
14
|
+
'@context': 'https://schema.org',
|
|
15
|
+
'@id': '_:audience/channel',
|
|
16
|
+
'@type': ['Audience'],
|
|
17
|
+
audienceType: ['channel']
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
const othersAudience = parse(SlantNodeSchema, {
|
|
21
|
+
'@context': 'https://schema.org',
|
|
22
|
+
'@id': '_:audience/others',
|
|
23
|
+
'@type': ['Audience'],
|
|
24
|
+
audienceType: ['others']
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
const selfAudience = parse(SlantNodeSchema, {
|
|
28
|
+
'@context': 'https://schema.org',
|
|
29
|
+
'@id': '_:audience/user',
|
|
30
|
+
'@type': ['Audience'],
|
|
31
|
+
audienceType: ['self']
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
graph.act(graph => graph.upsert(othersAudience, channelAudience, selfAudience));
|
|
35
|
+
|
|
36
|
+
store.subscribe(() => {
|
|
37
|
+
const { activities }: { activities: readonly Activity[] } = store.getState();
|
|
38
|
+
|
|
39
|
+
if (Object.is(activities, prevActivities)) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const activitySet = new Set(activities);
|
|
44
|
+
const prevActivitySet = new Set(prevActivities);
|
|
45
|
+
|
|
46
|
+
// TODO: [P*] Supports deleting node from the graph.
|
|
47
|
+
const addedActivities = activitySet.difference(prevActivitySet);
|
|
48
|
+
|
|
49
|
+
graph.act(graph => {
|
|
50
|
+
for (const activity of addedActivities) {
|
|
51
|
+
const {
|
|
52
|
+
from: { role }
|
|
53
|
+
} = activity;
|
|
54
|
+
|
|
55
|
+
const localId = getLocalIdFromActivity(activity);
|
|
56
|
+
const position = getPositionFromActivity(activity);
|
|
57
|
+
|
|
58
|
+
// TODO: Should use Person and more specific than just "Others".
|
|
59
|
+
const sender =
|
|
60
|
+
role === 'bot'
|
|
61
|
+
? { '@id': othersAudience['@id'] }
|
|
62
|
+
: role === 'user'
|
|
63
|
+
? { '@id': selfAudience['@id'] }
|
|
64
|
+
: role === 'channel'
|
|
65
|
+
? { '@id': channelAudience['@id'] }
|
|
66
|
+
: undefined;
|
|
67
|
+
|
|
68
|
+
if (activity.type === 'message' || activity.type === 'typing') {
|
|
69
|
+
// TODO: [P*] If this is livestreaming, add isPartOf to indicate the livestream head.
|
|
70
|
+
graph.upsert({
|
|
71
|
+
'@context': 'https://schema.org',
|
|
72
|
+
|
|
73
|
+
'@id': localId,
|
|
74
|
+
'@type': ['Message', `urn:microsoft:webchat:direct-line-activity`],
|
|
75
|
+
|
|
76
|
+
encodingFormat:
|
|
77
|
+
'textFormat' in activity && activity.textFormat !== 'markdown' ? 'text/plain' : 'text/markdown',
|
|
78
|
+
|
|
79
|
+
// TODO: [P0] activity.id could be null here.
|
|
80
|
+
// TODO: [P0] Not sure if we need client activity ID here as we already have permanent ID.
|
|
81
|
+
identifier: [
|
|
82
|
+
...(activity.id ? [`urn:microsoft:webchat:direct-line-activity:id:${activity.id}`] : []),
|
|
83
|
+
...(typeof activity.channelData.clientActivityID === 'string'
|
|
84
|
+
? [`urn:microsoft:webchat:client-activity-id:${activity.channelData.clientActivityID}`]
|
|
85
|
+
: [])
|
|
86
|
+
],
|
|
87
|
+
|
|
88
|
+
position,
|
|
89
|
+
sender,
|
|
90
|
+
text: ('text' in activity && typeof activity.text === 'string' && activity.text) || undefined,
|
|
91
|
+
|
|
92
|
+
'urn:microsoft:webchat:direct-line-activity:raw-json': { '@type': '@json', '@value': activity },
|
|
93
|
+
'urn:microsoft:webchat:direct-line-activity:type': activity.type
|
|
94
|
+
});
|
|
95
|
+
} else if (typeof activity.type === 'string') {
|
|
96
|
+
graph.upsert({
|
|
97
|
+
'@context': 'https://schema.org',
|
|
98
|
+
'@id': localId,
|
|
99
|
+
'@type': Object.freeze(['urn:microsoft:webchat:direct-line-activity']),
|
|
100
|
+
identifier: activity.id && `urn:microsoft:webchat:direct-line-activity:id:${activity.id}`,
|
|
101
|
+
position,
|
|
102
|
+
sender,
|
|
103
|
+
'urn:microsoft:webchat:direct-line-activity:raw-json': { '@type': '@json', '@value': activity },
|
|
104
|
+
'urn:microsoft:webchat:direct-line-activity:type': activity.type
|
|
105
|
+
});
|
|
106
|
+
} else {
|
|
107
|
+
console.warn(
|
|
108
|
+
`botframework-webchat: Activity must have "type" with value of string, ignoring activity without proper "type" field.`,
|
|
109
|
+
{ activity }
|
|
110
|
+
);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
prevActivities = activities;
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
return graph;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export default createGraphFromStore;
|