botframework-webchat-core 4.14.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/.eslintrc.yml +4 -198
- package/.prettierrc.yml +1 -1
- 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 +2 -2
- 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/createStore.d.ts.map +1 -1
- package/lib/createStore.js +5 -5
- package/lib/definitions/speakingActivity.js +4 -2
- package/lib/index.d.ts +17 -15
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +12 -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/notifications.js +21 -14
- package/lib/reducers/typing.js +13 -7
- package/lib/sagas/connectionStatusToNotificationSaga.js +1 -1
- 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/queueIncomingActivitySaga.js +1 -1
- package/lib/sagas/sendFilesToPostActivitySaga.js +4 -4
- package/lib/sagas/sendMessageBackToPostActivitySaga.js +1 -1
- package/lib/sagas/sendTypingIndicatorOnSetSendBoxSaga.js +1 -1
- package/lib/sagas/speakActivityAndStartDictateOnIncomingActivityFromOthersSaga.js +1 -1
- package/lib/sagas/startSpeakActivityOnPostActivitySaga.js +1 -1
- package/lib/sagas/stopSpeakingActivityOnInputSaga.js +1 -1
- package/lib/sagas/submitSendBoxSaga.js +1 -1
- package/lib/selectors/activities.js +1 -1
- package/lib/selectors/combineSelectors.js +9 -4
- 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 +2 -2
- 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 +2 -3
- package/lib/utils/isForbiddenPropertyName.d.ts +2 -0
- package/lib/utils/isForbiddenPropertyName.d.ts.map +1 -0
- package/lib/utils/isForbiddenPropertyName.js +21 -0
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/uniqueID.js +1 -1
- package/package.json +20 -23
- package/src/__tests__/detectSlowConnectionSaga.spec.js +1 -1
- package/src/__tests__/observeOnce.spec.js +3 -3
- 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/actions/setNotification.js +8 -2
- package/src/createStore.ts +4 -4
- package/src/definitions/speakingActivity.js +1 -1
- package/src/index.ts +19 -14
- package/src/reducer.ts +0 -2
- package/src/reducers/activities.ts +172 -0
- package/src/reducers/notifications.js +22 -16
- package/src/reducers/typing.js +6 -5
- package/src/sagas/connectionStatusToNotificationSaga.js +1 -1
- 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/queueIncomingActivitySaga.js +40 -39
- package/src/sagas/sendFilesToPostActivitySaga.js +1 -1
- package/src/sagas/sendMessageBackToPostActivitySaga.js +0 -1
- package/src/sagas/sendTypingIndicatorOnSetSendBoxSaga.js +1 -1
- package/src/sagas/speakActivityAndStartDictateOnIncomingActivityFromOthersSaga.js +1 -1
- package/src/sagas/startSpeakActivityOnPostActivitySaga.js +1 -1
- package/src/sagas/stopSpeakingActivityOnInputSaga.js +1 -1
- package/src/sagas/submitSendBoxSaga.js +1 -1
- package/src/selectors/activities.ts +12 -0
- package/src/selectors/combineSelectors.ts +21 -0
- 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 +4 -3
- package/src/types/external/DirectLineAnimationCard.ts +6 -4
- package/src/types/external/DirectLineAttachment.ts +10 -5
- package/src/types/external/DirectLineAudioCard.ts +6 -4
- 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 -4
- package/src/types/external/DirectLineJSBotConnection.ts +1 -2
- package/src/types/external/DirectLineMediaCardEssence.ts +19 -0
- package/src/types/external/DirectLineOAuthCard.ts +7 -4
- package/src/types/external/DirectLineReceiptCard.ts +30 -4
- package/src/types/external/DirectLineSignInCard.ts +8 -4
- package/src/types/external/DirectLineSuggestedAction.ts +6 -4
- package/src/types/external/DirectLineThumbnailCard.ts +6 -4
- package/src/types/external/DirectLineVideoCard.ts +6 -4
- 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.chatham.spec.js +1 -0
- package/src/utils/dateToLocaleISOString.japan.spec.js +1 -0
- package/src/utils/dateToLocaleISOString.pacific.spec.js +1 -0
- package/src/utils/{dateToLocaleISOString.js → dateToLocaleISOString.ts} +6 -6
- package/src/utils/dateToLocaleISOString.utc.spec.js +2 -0
- package/src/utils/deleteKey.ts +9 -0
- package/src/utils/isForbiddenPropertyName.spec.js +6 -0
- package/src/utils/isForbiddenPropertyName.ts +33 -0
- package/src/utils/{sleep.js → sleep.ts} +1 -1
- package/src/utils/uniqueID.ts +7 -0
- package/.eslintignore +0 -9
- 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 -49
- 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/combineSelectors.js +0 -8
- 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 -11
- package/src/utils/mime-wrapper.js +0 -40
- package/src/utils/uniqueID.js +0 -12
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
import dateToLocaleISOString from './dateToLocaleISOString';
|
|
7
7
|
|
|
8
8
|
test('formatting a time in Japan timezone', () => {
|
|
9
|
+
// eslint-disable-next-line no-magic-numbers
|
|
9
10
|
const date = new Date(Date.UTC(2000, 0, 1, 0, 12, 34, 567));
|
|
10
11
|
const actual = dateToLocaleISOString(date);
|
|
11
12
|
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
import dateToLocaleISOString from './dateToLocaleISOString';
|
|
7
7
|
|
|
8
8
|
test('formatting a time in Pacific Standard Time timezone', () => {
|
|
9
|
+
// eslint-disable-next-line no-magic-numbers
|
|
9
10
|
const date = new Date(Date.UTC(2000, 0, 1, 0, 12, 34, 567));
|
|
10
11
|
const actual = dateToLocaleISOString(date);
|
|
11
12
|
|
|
@@ -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
|
}
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
import dateToLocaleISOString from './dateToLocaleISOString';
|
|
7
7
|
|
|
8
8
|
test('formatting a time in UTC timezone', () => {
|
|
9
|
+
// eslint-disable-next-line no-magic-numbers
|
|
9
10
|
const date = new Date(Date.UTC(2000, 0, 1, 0, 12, 34, 567));
|
|
10
11
|
const actual = dateToLocaleISOString(date);
|
|
11
12
|
|
|
@@ -13,6 +14,7 @@ test('formatting a time in UTC timezone', () => {
|
|
|
13
14
|
});
|
|
14
15
|
|
|
15
16
|
test('formatting a time in UTC timezone with zero milliseconds', () => {
|
|
17
|
+
// eslint-disable-next-line no-magic-numbers
|
|
16
18
|
const date = new Date(Date.UTC(2000, 0, 1, 0, 12, 34, 0));
|
|
17
19
|
const actual = dateToLocaleISOString(date);
|
|
18
20
|
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import isForbiddenPropertyName from './isForbiddenPropertyName';
|
|
2
|
+
|
|
3
|
+
test('should forbid "__proto__"', () => expect(isForbiddenPropertyName('__proto__')).toBeTruthy());
|
|
4
|
+
test('should forbid "constructor"', () => expect(isForbiddenPropertyName('constructor')).toBeTruthy());
|
|
5
|
+
test('should forbid "prototype"', () => expect(isForbiddenPropertyName('prototype')).toBeTruthy());
|
|
6
|
+
test('should not forbid "abc"', () => expect(isForbiddenPropertyName('abc')).toBeFalsy());
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
let FORBIDDEN_PROPERTY_NAMES;
|
|
2
|
+
|
|
3
|
+
function getForbiddenPropertyNames(): string[] {
|
|
4
|
+
return (
|
|
5
|
+
FORBIDDEN_PROPERTY_NAMES ||
|
|
6
|
+
(FORBIDDEN_PROPERTY_NAMES = Object.freeze(
|
|
7
|
+
Array.from(
|
|
8
|
+
new Set([
|
|
9
|
+
// As-of writing, `Object.prototype` includes:
|
|
10
|
+
// __defineGetter__
|
|
11
|
+
// __defineSetter__
|
|
12
|
+
// __lookupGetter__
|
|
13
|
+
// __lookupSetter
|
|
14
|
+
// __proto__
|
|
15
|
+
// constructor
|
|
16
|
+
// hasOwnProperty
|
|
17
|
+
// isPrototypeOf
|
|
18
|
+
// propertyIsEnumerable
|
|
19
|
+
// toLocaleString
|
|
20
|
+
// toString
|
|
21
|
+
// valueOf
|
|
22
|
+
...Object.getOwnPropertyNames(Object.prototype),
|
|
23
|
+
|
|
24
|
+
'prototype'
|
|
25
|
+
])
|
|
26
|
+
)
|
|
27
|
+
))
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export default function isForbiddenPropertyName(propertyName: string): boolean {
|
|
32
|
+
return getForbiddenPropertyNames().includes(propertyName);
|
|
33
|
+
}
|
package/.eslintignore
DELETED
|
@@ -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
|
-
}
|
|
41
|
-
|
|
42
|
-
return state;
|
|
43
|
-
}
|
|
44
|
-
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9yZWR1Y2Vycy9jbG9ja1NrZXdBZGp1c3RtZW50LmpzIl0sIm5hbWVzIjpbImNsb2NrU2tld0FkanVzdG1lbnQiLCJzdGF0ZSIsInBheWxvYWQiLCJ0eXBlIiwiSU5DT01JTkdfQUNUSVZJVFkiLCJhY3Rpdml0eSIsImNoYW5uZWxEYXRhIiwiY2xpZW50VGltZXN0YW1wIiwidGltZXN0YW1wIiwiY2xpZW50U2VuZFRpbWU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yBBbmQgaXQgYWxzbyBtZWFucywgdGhlIHVzZXItb3JpZ2luYXRlZCBtZXNzYWdlIGhhcyBoaWdoZXIgcHJvYmFiaWxpdHkgdG8gYXBwZWFyIGJlbG93IGJvdC1vcmlnaW5hdGVkIG1lc3NhZ2UuXG4gICAgICAvLyBBbHRob3VnaCBpdCBoYXMgaGlnaGVyIHByb2JhYmlsaXR5LCBpZiB0aGUgdXNlci1vcmlnaW5hdGVkIG1lc3NhZ2UgaXMgc3RpbGwgc2VuZGluZyAoaS5lLiBkaWQgbm90IGVjaG9iYWNrIHdpdGggc2VydmVyIHRpbWVzdGFtcCB5ZXQpLFxuICAgICAgLy8gdGhlIGluc2VydGlvbi1zb3J0IGxvZ2ljIHdpbGwgcHV0IHRoZSBib3Qtb3JpZ2luYXRlZCBiZWxvdyB0aGUgdXNlci1vcmlnaW5hdGVkIG1lc3NhZ2UuXG5cbiAgICAgIHN0YXRlID0gc2VydmVyVGltZSAtIGNsaWVudFNlbmRUaW1lO1xuICAgIH1cbiAgfSBlbHNlIGlmICh0eXBlID09PSBTRVRfQ0xPQ0tfU0tFV19BREpVU1RNRU5UKSB7XG4gICAgLy8gQ3VycmVudGx5LCB0aGlzIGFjdGlvbiBpcyBmb3IgdGVzdGluZyBwdXJwb3NlIG9ubHkuXG4gICAgc3RhdGUgPSBwYXlsb2FkLnZhbHVlO1xuICB9XG5cbiAgcmV0dXJuIHN0YXRlO1xufVxuIl19
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports["default"] = callUntilEffect;
|
|
9
|
-
|
|
10
|
-
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
11
|
-
|
|
12
|
-
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
13
|
-
|
|
14
|
-
var _effects = require("redux-saga/effects");
|
|
15
|
-
|
|
16
|
-
function callUntilEffect(fn, args, predicate) {
|
|
17
|
-
return (0, _effects.call)( /*#__PURE__*/_regenerator["default"].mark(function callUntil() {
|
|
18
|
-
var result;
|
|
19
|
-
return _regenerator["default"].wrap(function callUntil$(_context) {
|
|
20
|
-
while (1) {
|
|
21
|
-
switch (_context.prev = _context.next) {
|
|
22
|
-
case 0:
|
|
23
|
-
_context.next = 2;
|
|
24
|
-
return _effects.call.apply(void 0, [fn].concat((0, _toConsumableArray2["default"])(args)));
|
|
25
|
-
|
|
26
|
-
case 2:
|
|
27
|
-
result = _context.sent;
|
|
28
|
-
|
|
29
|
-
if (!predicate(result)) {
|
|
30
|
-
_context.next = 5;
|
|
31
|
-
break;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
return _context.abrupt("break", 7);
|
|
35
|
-
|
|
36
|
-
case 5:
|
|
37
|
-
_context.next = 0;
|
|
38
|
-
break;
|
|
39
|
-
|
|
40
|
-
case 7:
|
|
41
|
-
case "end":
|
|
42
|
-
return _context.stop();
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}, callUntil);
|
|
46
|
-
}));
|
|
47
|
-
}
|
|
48
|
-
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9zYWdhcy9lZmZlY3RzL2NhbGxVbnRpbC5qcyJdLCJuYW1lcyI6WyJjYWxsVW50aWxFZmZlY3QiLCJmbiIsImFyZ3MiLCJwcmVkaWNhdGUiLCJjYWxsVW50aWwiLCJjYWxsIiwicmVzdWx0Il0sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7O0FBQUE7O0FBRWUsU0FBU0EsZUFBVCxDQUF5QkMsRUFBekIsRUFBNkJDLElBQTdCLEVBQW1DQyxTQUFuQyxFQUE4QztBQUMzRCxTQUFPLDhEQUFLLFNBQVVDLFNBQVY7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFFTyxtQkFBTUMsNkJBQUtKLEVBQUwsNkNBQVlDLElBQVosR0FBTjs7QUFGUDtBQUVGSSxZQUFBQSxNQUZFOztBQUFBLGlCQUlKSCxTQUFTLENBQUNHLE1BQUQsQ0FKTDtBQUFBO0FBQUE7QUFBQTs7QUFBQTs7QUFBQTtBQUFBO0FBQUE7O0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBLE9BQVVGLFNBQVY7QUFBQSxHQUFMLEVBQVA7QUFTRCIsInNvdXJjZVJvb3QiOiJjb3JlOi8vLyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGNhbGwgfSBmcm9tICdyZWR1eC1zYWdhL2VmZmVjdHMnO1xuXG5leHBvcnQgZGVmYXVsdCBmdW5jdGlvbiBjYWxsVW50aWxFZmZlY3QoZm4sIGFyZ3MsIHByZWRpY2F0ZSkge1xuICByZXR1cm4gY2FsbChmdW5jdGlvbiogY2FsbFVudGlsKCkge1xuICAgIGZvciAoOzspIHtcbiAgICAgIGNvbnN0IHJlc3VsdCA9IHlpZWxkIGNhbGwoZm4sIC4uLmFyZ3MpO1xuXG4gICAgICBpZiAocHJlZGljYXRlKHJlc3VsdCkpIHtcbiAgICAgICAgYnJlYWs7XG4gICAgICB9XG4gICAgfVxuICB9KTtcbn1cbiJdfQ==
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports["default"] = void 0;
|
|
7
|
-
|
|
8
|
-
var _default = function _default(_ref) {
|
|
9
|
-
var clockSkewAdjustment = _ref.clockSkewAdjustment;
|
|
10
|
-
return clockSkewAdjustment;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
exports["default"] = _default;
|
|
14
|
-
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zZWxlY3RvcnMvY2xvY2tTa2V3QWRqdXN0bWVudC5qcyJdLCJuYW1lcyI6WyJjbG9ja1NrZXdBZGp1c3RtZW50Il0sIm1hcHBpbmdzIjoiOzs7Ozs7O2VBQWU7QUFBQSxNQUFHQSxtQkFBSCxRQUFHQSxtQkFBSDtBQUFBLFNBQTZCQSxtQkFBN0I7QUFBQSxDIiwic291cmNlUm9vdCI6ImNvcmU6Ly8vIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGRlZmF1bHQgKHsgY2xvY2tTa2V3QWRqdXN0bWVudCB9KSA9PiBjbG9ja1NrZXdBZGp1c3RtZW50O1xuIl19
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports["default"] = void 0;
|
|
9
|
-
|
|
10
|
-
var _Mime = _interopRequireDefault(require("mime/Mime"));
|
|
11
|
-
|
|
12
|
-
/* eslint no-undef: "off"*/
|
|
13
|
-
|
|
14
|
-
/* eslint node/global-require: "off"*/
|
|
15
|
-
// We adopted the work from mime-wrapper, at https://github.com/marlon360/mime-wrapper.
|
|
16
|
-
// This file wraps the mime library constructor to include '.json' types. This is needed
|
|
17
|
-
// to support Angular CLI web projects, in which the webpack.config files are hidden away
|
|
18
|
-
// from the user, and do not support .json file extension module resolutions.
|
|
19
|
-
//
|
|
20
|
-
// Refer to issue https://github.com/jshttp/mime-types/issues/50#issuecomment-390932678
|
|
21
|
-
// and issue https://github.com/broofa/node-mime/issues/208.
|
|
22
|
-
//
|
|
23
|
-
// This file may need to change if the mime library is bumped a major that may cause a
|
|
24
|
-
// breaking change, as it relies on the internal library file placement.
|
|
25
|
-
// MIT License
|
|
26
|
-
//
|
|
27
|
-
// Copyright (c) 2018 Marlon Lückert
|
|
28
|
-
//
|
|
29
|
-
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
30
|
-
// of this software and associated documentation files (the "Software"), to deal
|
|
31
|
-
// in the Software without restriction, including without limitation the rights
|
|
32
|
-
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
33
|
-
// copies of the Software, and to permit persons to whom the Software is
|
|
34
|
-
// furnished to do so, subject to the following conditions:
|
|
35
|
-
//
|
|
36
|
-
// The above copyright notice and this permission notice shall be included in all
|
|
37
|
-
// copies or substantial portions of the Software.
|
|
38
|
-
//
|
|
39
|
-
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
40
|
-
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
41
|
-
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
42
|
-
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
43
|
-
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
44
|
-
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
45
|
-
// SOFTWARE.
|
|
46
|
-
var _default = new _Mime["default"](require('mime/types/standard'), require('mime/types/other'));
|
|
47
|
-
|
|
48
|
-
exports["default"] = _default;
|
|
49
|
-
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlscy9taW1lLXdyYXBwZXIuanMiXSwibmFtZXMiOlsiTWltZSIsInJlcXVpcmUiXSwibWFwcGluZ3MiOiI7Ozs7Ozs7OztBQXFDQTs7Q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VITY';
|
|
2
|
-
export const POST_ACTIVITY_FULFILLED = `${POST_ACTIVITY}_FULFILLED`;
|
|
3
|
-
export const POST_ACTIVITY_PENDING = `${POST_ACTIVITY}_PENDING`;
|
|
4
|
-
export const POST_ACTIVITY_REJECTED = `${POST_ACTIVITY}_REJECTED`;
|
|
5
|
-
|
|
6
|
-
export default function postActivity(activity, method = 'keyboard') {
|
|
7
|
-
return {
|
|
8
|
-
type: POST_ACTIVITY,
|
|
9
|
-
meta: { method },
|
|
10
|
-
payload: { activity }
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export { POST_ACTIVITY };
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
/* eslint no-magic-numbers: ["error", { "ignore": [0, -1] }] */
|
|
2
|
-
|
|
3
|
-
import updateIn from 'simple-update-in';
|
|
4
|
-
|
|
5
|
-
import { DELETE_ACTIVITY } from '../actions/deleteActivity';
|
|
6
|
-
import { INCOMING_ACTIVITY } from '../actions/incomingActivity';
|
|
7
|
-
import { MARK_ACTIVITY } from '../actions/markActivity';
|
|
8
|
-
|
|
9
|
-
import { POST_ACTIVITY_FULFILLED, POST_ACTIVITY_PENDING, POST_ACTIVITY_REJECTED } from '../actions/postActivity';
|
|
10
|
-
|
|
11
|
-
import { SEND_FAILED, SENDING, SENT } from '../constants/ActivityClientState';
|
|
12
|
-
|
|
13
|
-
const DEFAULT_STATE = [];
|
|
14
|
-
const DIRECT_LINE_PLACEHOLDER_URL =
|
|
15
|
-
'https://docs.botframework.com/static/devportal/client/images/bot-framework-default-placeholder.png';
|
|
16
|
-
|
|
17
|
-
function getClientActivityID({ channelData: { clientActivityID } = {} }) {
|
|
18
|
-
return clientActivityID;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
function findByClientActivityID(clientActivityID) {
|
|
22
|
-
return activity => getClientActivityID(activity) === clientActivityID;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
function patchActivity(activity) {
|
|
26
|
-
// Direct Line channel will return a placeholder image for the user-uploaded image.
|
|
27
|
-
// As observed, the URL for the placeholder image is https://docs.botframework.com/static/devportal/client/images/bot-framework-default-placeholder.png.
|
|
28
|
-
// To make our code simpler, we are removing the value if "contentUrl" is pointing to a placeholder image.
|
|
29
|
-
|
|
30
|
-
// TODO: [P2] #2869 This "contentURL" removal code should be moved to DirectLineJS adapter.
|
|
31
|
-
|
|
32
|
-
// Also, if the "contentURL" starts with "blob:", this means the user is uploading a file (the URL is constructed by URL.createObjectURL)
|
|
33
|
-
// Although the copy/reference of the file is temporary in-memory, to make the UX consistent across page refresh, we do not allow the user to re-download the file either.
|
|
34
|
-
|
|
35
|
-
return updateIn(activity, ['attachments', () => true, 'contentUrl'], contentUrl => {
|
|
36
|
-
if (contentUrl !== DIRECT_LINE_PLACEHOLDER_URL && !/^blob:/iu.test(contentUrl)) {
|
|
37
|
-
return contentUrl;
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
function upsertActivityWithSort(activities, nextActivity) {
|
|
43
|
-
nextActivity = patchActivity(nextActivity);
|
|
44
|
-
|
|
45
|
-
const { channelData: { clientActivityID: nextClientActivityID } = {} } = nextActivity;
|
|
46
|
-
|
|
47
|
-
const nextTimestamp = Date.parse(nextActivity.timestamp);
|
|
48
|
-
const nextActivities = activities.filter(
|
|
49
|
-
({ channelData: { clientActivityID } = {}, id }) =>
|
|
50
|
-
// We will remove all "sending messages" activities and activities with same ID
|
|
51
|
-
// "clientActivityID" is unique and used to track if the message has been sent and echoed back from the server
|
|
52
|
-
!(nextClientActivityID && clientActivityID === nextClientActivityID) && !(id && id === nextActivity.id)
|
|
53
|
-
);
|
|
54
|
-
|
|
55
|
-
// Then, find the right (sorted) place to insert the new activity at, based on timestamp
|
|
56
|
-
// Since clockskew might happen, we will ignore timestamp on messages that are sending
|
|
57
|
-
|
|
58
|
-
const indexToInsert = nextActivities.findIndex(
|
|
59
|
-
({ channelData: { state } = {}, timestamp }) =>
|
|
60
|
-
Date.parse(timestamp) > nextTimestamp && state !== SENDING && state !== SEND_FAILED
|
|
61
|
-
);
|
|
62
|
-
|
|
63
|
-
// If no right place are found, append it
|
|
64
|
-
nextActivities.splice(~indexToInsert ? indexToInsert : nextActivities.length, 0, nextActivity);
|
|
65
|
-
|
|
66
|
-
return nextActivities;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export default function activities(state = DEFAULT_STATE, { meta, payload, type }) {
|
|
70
|
-
switch (type) {
|
|
71
|
-
case DELETE_ACTIVITY:
|
|
72
|
-
state = updateIn(state, [({ id }) => id === payload.activityID]);
|
|
73
|
-
break;
|
|
74
|
-
|
|
75
|
-
case MARK_ACTIVITY:
|
|
76
|
-
state = updateIn(
|
|
77
|
-
state,
|
|
78
|
-
[({ id }) => id === payload.activityID, 'channelData', payload.name],
|
|
79
|
-
() => payload.value
|
|
80
|
-
);
|
|
81
|
-
break;
|
|
82
|
-
|
|
83
|
-
case POST_ACTIVITY_PENDING:
|
|
84
|
-
state = upsertActivityWithSort(
|
|
85
|
-
state,
|
|
86
|
-
updateIn(payload.activity, ['channelData', 'state'], () => SENDING)
|
|
87
|
-
);
|
|
88
|
-
break;
|
|
89
|
-
|
|
90
|
-
case POST_ACTIVITY_REJECTED:
|
|
91
|
-
state = updateIn(
|
|
92
|
-
state,
|
|
93
|
-
[findByClientActivityID(meta.clientActivityID), 'channelData', 'state'],
|
|
94
|
-
() => SEND_FAILED
|
|
95
|
-
);
|
|
96
|
-
break;
|
|
97
|
-
|
|
98
|
-
case POST_ACTIVITY_FULFILLED:
|
|
99
|
-
state = updateIn(state, [findByClientActivityID(meta.clientActivityID)], () =>
|
|
100
|
-
// We will replace the activity with the version from the server
|
|
101
|
-
updateIn(patchActivity(payload.activity), ['channelData', 'state'], () => SENT)
|
|
102
|
-
);
|
|
103
|
-
|
|
104
|
-
break;
|
|
105
|
-
|
|
106
|
-
case INCOMING_ACTIVITY:
|
|
107
|
-
// TODO: [P4] #2100 Move "typing" into Constants.ActivityType
|
|
108
|
-
state = upsertActivityWithSort(state, payload.activity);
|
|
109
|
-
break;
|
|
110
|
-
|
|
111
|
-
default:
|
|
112
|
-
break;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
return state;
|
|
116
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { INCOMING_ACTIVITY } from '../actions/incomingActivity';
|
|
2
|
-
import { SET_CLOCK_SKEW_ADJUSTMENT } from '../actions/setClockSkewAdjustment';
|
|
3
|
-
|
|
4
|
-
export default function clockSkewAdjustment(state = 0, { payload, type }) {
|
|
5
|
-
if (type === INCOMING_ACTIVITY) {
|
|
6
|
-
const {
|
|
7
|
-
activity: { channelData: { clientTimestamp } = {}, timestamp }
|
|
8
|
-
} = payload;
|
|
9
|
-
|
|
10
|
-
const clientSendTime = Date.parse(clientTimestamp);
|
|
11
|
-
const serverTime = Date.parse(timestamp);
|
|
12
|
-
|
|
13
|
-
if (!isNaN(clientSendTime) && !isNaN(serverTime)) {
|
|
14
|
-
// The adjustment include the latency between the client and the server.
|
|
15
|
-
// This means, the adjustment is always larger than the actual value.
|
|
16
|
-
// And it means, after adjustment, client time will be ahead of server time.
|
|
17
|
-
// And it also means, the user-originated message has higher probability to appear below bot-originated message.
|
|
18
|
-
// Although it has higher probability, if the user-originated message is still sending (i.e. did not echoback with server timestamp yet),
|
|
19
|
-
// the insertion-sort logic will put the bot-originated below the user-originated message.
|
|
20
|
-
|
|
21
|
-
state = serverTime - clientSendTime;
|
|
22
|
-
}
|
|
23
|
-
} else if (type === SET_CLOCK_SKEW_ADJUSTMENT) {
|
|
24
|
-
// Currently, this action is for testing purpose only.
|
|
25
|
-
state = payload.value;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
return state;
|
|
29
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { call } from 'redux-saga/effects';
|
|
2
|
-
|
|
3
|
-
export default function callUntilEffect(fn, args, predicate) {
|
|
4
|
-
return call(function* callUntil() {
|
|
5
|
-
for (;;) {
|
|
6
|
-
const result = yield call(fn, ...args);
|
|
7
|
-
|
|
8
|
-
if (predicate(result)) {
|
|
9
|
-
break;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
});
|
|
13
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
const activities = ({ activities }) => activities;
|
|
2
|
-
|
|
3
|
-
const of = predicate => state => activities(state).filter(predicate);
|
|
4
|
-
const ofID = targetID => of(({ id }) => id === targetID);
|
|
5
|
-
const ofType = targetType => of(({ type }) => type === targetType);
|
|
6
|
-
|
|
7
|
-
export default activities;
|
|
8
|
-
export { of, ofID, ofType };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default ({ clockSkewAdjustment }) => clockSkewAdjustment;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export default function combineSelectors(selectors) {
|
|
2
|
-
if (Array.isArray(selectors)) {
|
|
3
|
-
return state => selectors.reduce((combinedState, selector) => [...combinedState, selector(state)], []);
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
return state =>
|
|
7
|
-
Object.keys(selectors).reduce((combinedState, key) => ({ ...combinedState, [key]: selectors[key](state) }), {});
|
|
8
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default ({ dictateState }) => dictateState;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default ({ language }) => language;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default ({ sendBoxValue }) => sendBoxValue;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default ({ sendTimeout }) => sendTimeout;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default ({ sendTypingIndicator }) => sendTypingIndicator;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default ({ shouldSpeakIncomingActivity }) => shouldSpeakIncomingActivity;
|
package/src/utils/deleteKey.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/* eslint no-undef: "off"*/
|
|
2
|
-
/* eslint node/global-require: "off"*/
|
|
3
|
-
|
|
4
|
-
// We adopted the work from mime-wrapper, at https://github.com/marlon360/mime-wrapper.
|
|
5
|
-
|
|
6
|
-
// This file wraps the mime library constructor to include '.json' types. This is needed
|
|
7
|
-
// to support Angular CLI web projects, in which the webpack.config files are hidden away
|
|
8
|
-
// from the user, and do not support .json file extension module resolutions.
|
|
9
|
-
//
|
|
10
|
-
// Refer to issue https://github.com/jshttp/mime-types/issues/50#issuecomment-390932678
|
|
11
|
-
// and issue https://github.com/broofa/node-mime/issues/208.
|
|
12
|
-
//
|
|
13
|
-
// This file may need to change if the mime library is bumped a major that may cause a
|
|
14
|
-
// breaking change, as it relies on the internal library file placement.
|
|
15
|
-
|
|
16
|
-
// MIT License
|
|
17
|
-
//
|
|
18
|
-
// Copyright (c) 2018 Marlon Lückert
|
|
19
|
-
//
|
|
20
|
-
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
21
|
-
// of this software and associated documentation files (the "Software"), to deal
|
|
22
|
-
// in the Software without restriction, including without limitation the rights
|
|
23
|
-
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
24
|
-
// copies of the Software, and to permit persons to whom the Software is
|
|
25
|
-
// furnished to do so, subject to the following conditions:
|
|
26
|
-
//
|
|
27
|
-
// The above copyright notice and this permission notice shall be included in all
|
|
28
|
-
// copies or substantial portions of the Software.
|
|
29
|
-
//
|
|
30
|
-
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
31
|
-
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
32
|
-
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
33
|
-
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
34
|
-
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
35
|
-
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
36
|
-
// SOFTWARE.
|
|
37
|
-
|
|
38
|
-
import Mime from 'mime/Mime';
|
|
39
|
-
|
|
40
|
-
export default new Mime(require('mime/types/standard'), require('mime/types/other'));
|
package/src/utils/uniqueID.js
DELETED