@bigbinary/neeto-integrations-frontend 2.5.3 → 2.6.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/dist/Daily.cjs.js +628 -0
- package/dist/Daily.cjs.js.map +1 -0
- package/dist/Daily.js +597 -0
- package/dist/Daily.js.map +1 -0
- package/dist/Twilio.cjs.js +363 -56
- package/dist/Twilio.cjs.js.map +1 -1
- package/dist/Twilio.js +364 -60
- package/dist/Twilio.js.map +1 -1
- package/dist/index.cjs.js +364 -73
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +362 -71
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/translations/en.json +21 -0
- package/types.d.ts +9 -0
package/dist/Twilio.js
CHANGED
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
import React, { useEffect, useRef
|
|
2
|
-
import { noop, keysToSnakeCase, _findBy } from '@bigbinary/neeto-cist';
|
|
1
|
+
import React, { useState, useEffect, useRef } from 'react';
|
|
2
|
+
import { isNotPresent, isPresent, noop, keysToSnakeCase, _findBy } from '@bigbinary/neeto-cist';
|
|
3
3
|
import '@bigbinary/neeto-molecules/IntegrationCard';
|
|
4
|
-
import '@bigbinary/neeto-molecules/IntegrationDisconnectAlert';
|
|
5
|
-
import '@bigbinary/neeto-molecules/IntegrationWalkthroughModal';
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import { prop, equals } from 'ramda';
|
|
10
|
-
import i18next from 'i18next';
|
|
11
|
-
import { Input, Select, Form, ActionBlock } from '@bigbinary/neetoui/formik';
|
|
12
|
-
import { useMutationWithInvalidation, useStateWithDependency } from '@bigbinary/neeto-commons-frontend/react-utils';
|
|
4
|
+
import DisconnectAlert from '@bigbinary/neeto-molecules/IntegrationDisconnectAlert';
|
|
5
|
+
import WalkthroughModal from '@bigbinary/neeto-molecules/IntegrationWalkthroughModal';
|
|
6
|
+
import i18next, { t as t$1 } from 'i18next';
|
|
7
|
+
import { useMutationWithInvalidation, withTitle, withT, useStateWithDependency } from '@bigbinary/neeto-commons-frontend/react-utils';
|
|
8
|
+
import { DEFAULT_STALE_TIME } from '@bigbinary/neeto-commons-frontend/constants';
|
|
13
9
|
import { useQuery } from 'react-query';
|
|
14
10
|
import axios from 'axios';
|
|
11
|
+
import PageLoader from '@bigbinary/neeto-molecules/PageLoader';
|
|
12
|
+
import { Button, Typography, Modal as Modal$1 } from '@bigbinary/neetoui';
|
|
13
|
+
import { Form as Form$2, Input, Select, ActionBlock } from '@bigbinary/neetoui/formik';
|
|
14
|
+
import { useTranslation, Trans } from 'react-i18next';
|
|
15
|
+
import classnames from 'classnames';
|
|
16
|
+
import { prop, equals } from 'ramda';
|
|
15
17
|
import * as yup from 'yup';
|
|
16
18
|
|
|
17
19
|
function _arrayWithHoles(arr) {
|
|
@@ -69,6 +71,356 @@ function _slicedToArray(arr, i) {
|
|
|
69
71
|
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
70
72
|
}
|
|
71
73
|
|
|
74
|
+
function _typeof(obj) {
|
|
75
|
+
"@babel/helpers - typeof";
|
|
76
|
+
|
|
77
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
78
|
+
return typeof obj;
|
|
79
|
+
} : function (obj) {
|
|
80
|
+
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
81
|
+
}, _typeof(obj);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function _toPrimitive(input, hint) {
|
|
85
|
+
if (_typeof(input) !== "object" || input === null) return input;
|
|
86
|
+
var prim = input[Symbol.toPrimitive];
|
|
87
|
+
if (prim !== undefined) {
|
|
88
|
+
var res = prim.call(input, hint || "default");
|
|
89
|
+
if (_typeof(res) !== "object") return res;
|
|
90
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
91
|
+
}
|
|
92
|
+
return (hint === "string" ? String : Number)(input);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function _toPropertyKey(arg) {
|
|
96
|
+
var key = _toPrimitive(arg, "string");
|
|
97
|
+
return _typeof(key) === "symbol" ? key : String(key);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
function _defineProperty(obj, key, value) {
|
|
101
|
+
key = _toPropertyKey(key);
|
|
102
|
+
if (key in obj) {
|
|
103
|
+
Object.defineProperty(obj, key, {
|
|
104
|
+
value: value,
|
|
105
|
+
enumerable: true,
|
|
106
|
+
configurable: true,
|
|
107
|
+
writable: true
|
|
108
|
+
});
|
|
109
|
+
} else {
|
|
110
|
+
obj[key] = value;
|
|
111
|
+
}
|
|
112
|
+
return obj;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
var INTEGRATIONS_ENGINE_BASE_URL = "/neeto_integrations";
|
|
116
|
+
var TWILIO_CONFIGURATION_BASE_URL = "".concat(INTEGRATIONS_ENGINE_BASE_URL, "/twilio/sms_configurations");
|
|
117
|
+
var INTEGRATIONS_ENGINE_DAILY_URL = "".concat(INTEGRATIONS_ENGINE_BASE_URL, "/daily");
|
|
118
|
+
|
|
119
|
+
var create = function create(payload) {
|
|
120
|
+
return axios.post(INTEGRATIONS_ENGINE_DAILY_URL, {
|
|
121
|
+
daily: payload
|
|
122
|
+
});
|
|
123
|
+
};
|
|
124
|
+
var show = function show() {
|
|
125
|
+
return axios.get(INTEGRATIONS_ENGINE_DAILY_URL);
|
|
126
|
+
};
|
|
127
|
+
var destroy = function destroy() {
|
|
128
|
+
return axios["delete"](INTEGRATIONS_ENGINE_DAILY_URL);
|
|
129
|
+
};
|
|
130
|
+
var dailiesApi = {
|
|
131
|
+
create: create,
|
|
132
|
+
show: show,
|
|
133
|
+
destroy: destroy
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
var QUERY_KEYS = {
|
|
137
|
+
TWILIO_SMS_CONFIGURATION: "twilio-sms-configuration",
|
|
138
|
+
TWILIO_PHONE_NUMBERS: "twilio-phone-numbers",
|
|
139
|
+
DAILY_CO_DETAILS: "daily-co-details"
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
function ownKeys$3(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
143
|
+
function _objectSpread$3(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$3(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$3(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
144
|
+
var useCreateDaily = function useCreateDaily() {
|
|
145
|
+
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
146
|
+
return useMutationWithInvalidation(dailiesApi.create, _objectSpread$3({
|
|
147
|
+
keysToInvalidate: [QUERY_KEYS.DAILY_CO_DETAILS]
|
|
148
|
+
}, options));
|
|
149
|
+
};
|
|
150
|
+
var useFetchDaily = function useFetchDaily() {
|
|
151
|
+
return useQuery(QUERY_KEYS.DAILY_CO_DETAILS, dailiesApi.show, {
|
|
152
|
+
staleTime: DEFAULT_STALE_TIME
|
|
153
|
+
});
|
|
154
|
+
};
|
|
155
|
+
var useDestroyDaily = function useDestroyDaily(_ref) {
|
|
156
|
+
var onSuccess = _ref.onSuccess;
|
|
157
|
+
return useMutationWithInvalidation(dailiesApi.destroy, {
|
|
158
|
+
keysToInvalidate: [QUERY_KEYS.DAILY_CO_DETAILS],
|
|
159
|
+
onSuccess: onSuccess
|
|
160
|
+
});
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
function _extends() {
|
|
164
|
+
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
165
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
166
|
+
var source = arguments[i];
|
|
167
|
+
for (var key in source) {
|
|
168
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
169
|
+
target[key] = source[key];
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
return target;
|
|
174
|
+
};
|
|
175
|
+
return _extends.apply(this, arguments);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
179
|
+
if (source == null) return {};
|
|
180
|
+
var target = {};
|
|
181
|
+
var sourceKeys = Object.keys(source);
|
|
182
|
+
var key, i;
|
|
183
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
184
|
+
key = sourceKeys[i];
|
|
185
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
186
|
+
target[key] = source[key];
|
|
187
|
+
}
|
|
188
|
+
return target;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
function _objectWithoutProperties(source, excluded) {
|
|
192
|
+
if (source == null) return {};
|
|
193
|
+
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
194
|
+
var key, i;
|
|
195
|
+
if (Object.getOwnPropertySymbols) {
|
|
196
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
197
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
198
|
+
key = sourceSymbolKeys[i];
|
|
199
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
200
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
201
|
+
target[key] = source[key];
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
return target;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
var _excluded = ["className", "children"];
|
|
208
|
+
var ExternalLink = function ExternalLink(_ref) {
|
|
209
|
+
var _ref$className = _ref.className,
|
|
210
|
+
className = _ref$className === void 0 ? "" : _ref$className,
|
|
211
|
+
_ref$children = _ref.children,
|
|
212
|
+
children = _ref$children === void 0 ? null : _ref$children,
|
|
213
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
214
|
+
return /*#__PURE__*/React.createElement("a", _extends({
|
|
215
|
+
className: classnames(["neeto-ui-text-primary-800 hover:neeto-ui-text-primary-800 visited:neeto-ui-text-primary-600 font-medium", className])
|
|
216
|
+
}, props), children);
|
|
217
|
+
};
|
|
218
|
+
var ExternalLink$1 = /*#__PURE__*/React.memo(ExternalLink);
|
|
219
|
+
|
|
220
|
+
var MANAGE_DAILY_CO_FORM_INITIAL_VALUES = {
|
|
221
|
+
apiKey: ""
|
|
222
|
+
};
|
|
223
|
+
var DAILY_CO_VALIDATION_SCHEMA = yup.object().shape({
|
|
224
|
+
apiKey: yup.string().trim().required(t$1("neetoIntegrations.errors.required", {
|
|
225
|
+
entity: t$1("neetoIntegrations.daily.apiKey")
|
|
226
|
+
}))
|
|
227
|
+
});
|
|
228
|
+
|
|
229
|
+
var Form = function Form(_ref) {
|
|
230
|
+
var helpDocUrl = _ref.helpDocUrl,
|
|
231
|
+
videoUrl = _ref.videoUrl,
|
|
232
|
+
onConnect = _ref.onConnect;
|
|
233
|
+
var _useTranslation = useTranslation(),
|
|
234
|
+
t = _useTranslation.t;
|
|
235
|
+
var _useState = useState(false),
|
|
236
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
237
|
+
isDemoModalOpen = _useState2[0],
|
|
238
|
+
setIsDemoModalOpen = _useState2[1];
|
|
239
|
+
var _useCreateDaily = useCreateDaily({
|
|
240
|
+
onSuccess: function onSuccess() {
|
|
241
|
+
return onConnect === null || onConnect === void 0 ? void 0 : onConnect();
|
|
242
|
+
}
|
|
243
|
+
}),
|
|
244
|
+
createDaily = _useCreateDaily.mutate,
|
|
245
|
+
isConnecting = _useCreateDaily.isLoading;
|
|
246
|
+
var handleSubmit = function handleSubmit(payload) {
|
|
247
|
+
return createDaily(payload);
|
|
248
|
+
};
|
|
249
|
+
if (isConnecting) {
|
|
250
|
+
return /*#__PURE__*/React.createElement(PageLoader, null);
|
|
251
|
+
}
|
|
252
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
253
|
+
className: "mx-auto w-full max-w-md"
|
|
254
|
+
}, /*#__PURE__*/React.createElement(Form$2, {
|
|
255
|
+
formikProps: {
|
|
256
|
+
initialValues: MANAGE_DAILY_CO_FORM_INITIAL_VALUES,
|
|
257
|
+
validationSchema: DAILY_CO_VALIDATION_SCHEMA,
|
|
258
|
+
onSubmit: handleSubmit
|
|
259
|
+
}
|
|
260
|
+
}, function (_ref2) {
|
|
261
|
+
var dirty = _ref2.dirty;
|
|
262
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
263
|
+
className: "mt-10 w-full space-y-5"
|
|
264
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
265
|
+
className: "block"
|
|
266
|
+
}, /*#__PURE__*/React.createElement(Input, {
|
|
267
|
+
autoFocus: true,
|
|
268
|
+
required: true,
|
|
269
|
+
label: t("neetoIntegrations.daily.apiKey"),
|
|
270
|
+
name: "apiKey",
|
|
271
|
+
helpText: /*#__PURE__*/React.createElement(Trans, {
|
|
272
|
+
i18nKey: "neetoIntegrations.daily.helpDoc",
|
|
273
|
+
components: {
|
|
274
|
+
externalLink: /*#__PURE__*/React.createElement(ExternalLink$1, {
|
|
275
|
+
href: helpDocUrl,
|
|
276
|
+
rel: "noreferrer",
|
|
277
|
+
target: "_blank"
|
|
278
|
+
})
|
|
279
|
+
}
|
|
280
|
+
})
|
|
281
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
|
282
|
+
className: "mt-8",
|
|
283
|
+
label: t("neetoIntegrations.daily.walkthroughText"),
|
|
284
|
+
style: "link",
|
|
285
|
+
onClick: function onClick() {
|
|
286
|
+
return setIsDemoModalOpen(true);
|
|
287
|
+
}
|
|
288
|
+
})), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Button, {
|
|
289
|
+
disabled: isConnecting || !dirty,
|
|
290
|
+
label: t("neetoIntegrations.common.connect"),
|
|
291
|
+
loading: isConnecting,
|
|
292
|
+
type: "submit"
|
|
293
|
+
})));
|
|
294
|
+
}), /*#__PURE__*/React.createElement(WalkthroughModal, {
|
|
295
|
+
isOpen: isDemoModalOpen,
|
|
296
|
+
videoUrl: videoUrl,
|
|
297
|
+
onClose: function onClose() {
|
|
298
|
+
return setIsDemoModalOpen(false);
|
|
299
|
+
}
|
|
300
|
+
}));
|
|
301
|
+
};
|
|
302
|
+
var Form$1 = withTitle(Form, i18next.t("neetoIntegrations.browserTitles.integrations.dailyco"));
|
|
303
|
+
|
|
304
|
+
var Manage$1 = withT(function (_ref) {
|
|
305
|
+
var t = _ref.t,
|
|
306
|
+
title = _ref.title,
|
|
307
|
+
description = _ref.description,
|
|
308
|
+
integration = _ref.integration,
|
|
309
|
+
isDisconnectAlertOpen = _ref.isDisconnectAlertOpen,
|
|
310
|
+
setIsDisconnectAlertOpen = _ref.setIsDisconnectAlertOpen,
|
|
311
|
+
isDisconnecting = _ref.isDisconnecting,
|
|
312
|
+
onDisconnect = _ref.onDisconnect,
|
|
313
|
+
onClose = _ref.onClose;
|
|
314
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
315
|
+
className: "mx-auto w-full max-w-md"
|
|
316
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
317
|
+
className: "mt-10 w-full space-y-4"
|
|
318
|
+
}, /*#__PURE__*/React.createElement(Typography, {
|
|
319
|
+
className: "neeto-ui-text-gray-800 mb-0.5",
|
|
320
|
+
style: "h3",
|
|
321
|
+
weight: "semibold"
|
|
322
|
+
}, title), /*#__PURE__*/React.createElement(Typography, {
|
|
323
|
+
className: "neeto-ui-text-gray-600 break-all",
|
|
324
|
+
style: "body1",
|
|
325
|
+
weight: "normal"
|
|
326
|
+
}, description), /*#__PURE__*/React.createElement(Button, {
|
|
327
|
+
label: t("neetoIntegrations.common.disconnect"),
|
|
328
|
+
style: "danger",
|
|
329
|
+
onClick: function onClick() {
|
|
330
|
+
return setIsDisconnectAlertOpen(true);
|
|
331
|
+
}
|
|
332
|
+
}))), /*#__PURE__*/React.createElement(DisconnectAlert, {
|
|
333
|
+
isDisconnecting: isDisconnecting,
|
|
334
|
+
onClose: onClose,
|
|
335
|
+
onDisconnect: onDisconnect,
|
|
336
|
+
isOpen: isDisconnectAlertOpen,
|
|
337
|
+
message: t("neetoIntegrations.".concat(integration, ".disconnect.message")),
|
|
338
|
+
title: t("neetoIntegrations.".concat(integration, ".disconnect.title"))
|
|
339
|
+
}));
|
|
340
|
+
});
|
|
341
|
+
|
|
342
|
+
var Manage = function Manage(_ref) {
|
|
343
|
+
var onDisconnect = _ref.onDisconnect;
|
|
344
|
+
var _useState = useState(false),
|
|
345
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
346
|
+
isDisconnectAlertOpen = _useState2[0],
|
|
347
|
+
setIsDisconnectAlertOpen = _useState2[1];
|
|
348
|
+
var _useFetchDaily = useFetchDaily(),
|
|
349
|
+
_useFetchDaily$data = _useFetchDaily.data,
|
|
350
|
+
_useFetchDaily$data2 = _useFetchDaily$data === void 0 ? {} : _useFetchDaily$data,
|
|
351
|
+
_useFetchDaily$data2$ = _useFetchDaily$data2.metadata,
|
|
352
|
+
metadata = _useFetchDaily$data2$ === void 0 ? {} : _useFetchDaily$data2$,
|
|
353
|
+
isLoading = _useFetchDaily.isLoading;
|
|
354
|
+
var _ref2 = metadata || {},
|
|
355
|
+
_ref2$apiKey = _ref2.apiKey,
|
|
356
|
+
apiKey = _ref2$apiKey === void 0 ? null : _ref2$apiKey;
|
|
357
|
+
var _useTranslation = useTranslation(),
|
|
358
|
+
t = _useTranslation.t;
|
|
359
|
+
var _useDestroyDaily = useDestroyDaily({
|
|
360
|
+
onSuccess: function onSuccess() {
|
|
361
|
+
setIsDisconnectAlertOpen(false);
|
|
362
|
+
onDisconnect === null || onDisconnect === void 0 ? void 0 : onDisconnect();
|
|
363
|
+
}
|
|
364
|
+
}),
|
|
365
|
+
destroyIntegration = _useDestroyDaily.mutate,
|
|
366
|
+
isDisconnecting = _useDestroyDaily.isLoading;
|
|
367
|
+
var handleDisconnect = function handleDisconnect() {
|
|
368
|
+
return destroyIntegration("daily");
|
|
369
|
+
};
|
|
370
|
+
if (isLoading || isDisconnecting) {
|
|
371
|
+
return /*#__PURE__*/React.createElement(PageLoader, null);
|
|
372
|
+
}
|
|
373
|
+
if (isNotPresent(apiKey)) {
|
|
374
|
+
onDisconnect === null || onDisconnect === void 0 ? void 0 : onDisconnect();
|
|
375
|
+
}
|
|
376
|
+
return /*#__PURE__*/React.createElement(Manage$1, {
|
|
377
|
+
isDisconnectAlertOpen: isDisconnectAlertOpen,
|
|
378
|
+
isDisconnecting: isDisconnecting,
|
|
379
|
+
setIsDisconnectAlertOpen: setIsDisconnectAlertOpen,
|
|
380
|
+
description: t("neetoIntegrations.daily.yourApiKey", {
|
|
381
|
+
apiKey: apiKey
|
|
382
|
+
}),
|
|
383
|
+
integration: "daily",
|
|
384
|
+
title: t("neetoIntegrations.daily.connected"),
|
|
385
|
+
onClose: function onClose() {
|
|
386
|
+
return setIsDisconnectAlertOpen(false);
|
|
387
|
+
},
|
|
388
|
+
onDisconnect: handleDisconnect
|
|
389
|
+
});
|
|
390
|
+
};
|
|
391
|
+
|
|
392
|
+
var Daily = function Daily(_ref) {
|
|
393
|
+
var _ref$isOnboarding = _ref.isOnboarding,
|
|
394
|
+
isOnboarding = _ref$isOnboarding === void 0 ? false : _ref$isOnboarding,
|
|
395
|
+
_ref$helpDocUrl = _ref.helpDocUrl,
|
|
396
|
+
helpDocUrl = _ref$helpDocUrl === void 0 ? "" : _ref$helpDocUrl,
|
|
397
|
+
_ref$videoUrl = _ref.videoUrl,
|
|
398
|
+
videoUrl = _ref$videoUrl === void 0 ? "" : _ref$videoUrl,
|
|
399
|
+
_ref$onConnect = _ref.onConnect,
|
|
400
|
+
onConnect = _ref$onConnect === void 0 ? noop : _ref$onConnect,
|
|
401
|
+
_ref$onDisconnect = _ref.onDisconnect,
|
|
402
|
+
onDisconnect = _ref$onDisconnect === void 0 ? noop : _ref$onDisconnect;
|
|
403
|
+
var _useFetchDaily = useFetchDaily(),
|
|
404
|
+
_useFetchDaily$data = _useFetchDaily.data,
|
|
405
|
+
_useFetchDaily$data2 = _useFetchDaily$data === void 0 ? {} : _useFetchDaily$data,
|
|
406
|
+
_useFetchDaily$data2$ = _useFetchDaily$data2.metadata,
|
|
407
|
+
metadata = _useFetchDaily$data2$ === void 0 ? {} : _useFetchDaily$data2$;
|
|
408
|
+
var _ref2 = metadata || {},
|
|
409
|
+
_ref2$apiKey = _ref2.apiKey,
|
|
410
|
+
apiKey = _ref2$apiKey === void 0 ? null : _ref2$apiKey;
|
|
411
|
+
if (isPresent(apiKey) && !isOnboarding) {
|
|
412
|
+
return /*#__PURE__*/React.createElement(Manage, {
|
|
413
|
+
onDisconnect: onDisconnect
|
|
414
|
+
});
|
|
415
|
+
}
|
|
416
|
+
return /*#__PURE__*/React.createElement(Form$1, {
|
|
417
|
+
onConnect: onConnect,
|
|
418
|
+
helpDocUrl: helpDocUrl,
|
|
419
|
+
videoUrl: videoUrl
|
|
420
|
+
});
|
|
421
|
+
};
|
|
422
|
+
withTitle(Daily, i18next.t("neetoIntegrations.browserTitles.integrations.dailyco"));
|
|
423
|
+
|
|
72
424
|
var Stepper = function Stepper(_ref) {
|
|
73
425
|
var _ref$steps = _ref.steps,
|
|
74
426
|
steps = _ref$steps === void 0 ? {} : _ref$steps;
|
|
@@ -308,47 +660,6 @@ var TWILIO_INTEGRATION_STEPS = [{
|
|
|
308
660
|
isCompleted: false
|
|
309
661
|
}];
|
|
310
662
|
|
|
311
|
-
function _typeof(obj) {
|
|
312
|
-
"@babel/helpers - typeof";
|
|
313
|
-
|
|
314
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
315
|
-
return typeof obj;
|
|
316
|
-
} : function (obj) {
|
|
317
|
-
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
318
|
-
}, _typeof(obj);
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
function _toPrimitive(input, hint) {
|
|
322
|
-
if (_typeof(input) !== "object" || input === null) return input;
|
|
323
|
-
var prim = input[Symbol.toPrimitive];
|
|
324
|
-
if (prim !== undefined) {
|
|
325
|
-
var res = prim.call(input, hint || "default");
|
|
326
|
-
if (_typeof(res) !== "object") return res;
|
|
327
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
328
|
-
}
|
|
329
|
-
return (hint === "string" ? String : Number)(input);
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
function _toPropertyKey(arg) {
|
|
333
|
-
var key = _toPrimitive(arg, "string");
|
|
334
|
-
return _typeof(key) === "symbol" ? key : String(key);
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
function _defineProperty(obj, key, value) {
|
|
338
|
-
key = _toPropertyKey(key);
|
|
339
|
-
if (key in obj) {
|
|
340
|
-
Object.defineProperty(obj, key, {
|
|
341
|
-
value: value,
|
|
342
|
-
enumerable: true,
|
|
343
|
-
configurable: true,
|
|
344
|
-
writable: true
|
|
345
|
-
});
|
|
346
|
-
} else {
|
|
347
|
-
obj[key] = value;
|
|
348
|
-
}
|
|
349
|
-
return obj;
|
|
350
|
-
}
|
|
351
|
-
|
|
352
663
|
function ownKeys$2(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
353
664
|
function _objectSpread$2(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$2(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$2(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
354
665
|
var ConfigurationForm = function ConfigurationForm(_ref) {
|
|
@@ -422,8 +733,6 @@ function _toConsumableArray(arr) {
|
|
|
422
733
|
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
423
734
|
}
|
|
424
735
|
|
|
425
|
-
var TWILIO_CONFIGURATION_BASE_URL = "/neeto_integrations/twilio/sms_configurations";
|
|
426
|
-
|
|
427
736
|
var twilioApi = {
|
|
428
737
|
fetchTwilioSmsConfiguration: function fetchTwilioSmsConfiguration() {
|
|
429
738
|
return axios.get(TWILIO_CONFIGURATION_BASE_URL);
|
|
@@ -441,11 +750,6 @@ var twilioApi = {
|
|
|
441
750
|
}
|
|
442
751
|
};
|
|
443
752
|
|
|
444
|
-
var QUERY_KEYS = {
|
|
445
|
-
TWILIO_SMS_CONFIGURATION: "twilio-sms-configuration",
|
|
446
|
-
TWILIO_PHONE_NUMBERS: "twilio-phone-numbers"
|
|
447
|
-
};
|
|
448
|
-
|
|
449
753
|
var useFetchTwilioSmsConfiguration = function useFetchTwilioSmsConfiguration() {
|
|
450
754
|
return useQuery(QUERY_KEYS.TWILIO_SMS_CONFIGURATION, twilioApi.fetchTwilioSmsConfiguration, {
|
|
451
755
|
select: function select(response) {
|
|
@@ -632,7 +936,7 @@ var TwilioConfiguration = function TwilioConfiguration(_ref) {
|
|
|
632
936
|
selectedPhoneNumber: selectedPhoneNumber
|
|
633
937
|
});
|
|
634
938
|
};
|
|
635
|
-
return /*#__PURE__*/React.createElement(Form, {
|
|
939
|
+
return /*#__PURE__*/React.createElement(Form$2, {
|
|
636
940
|
className: "mx-auto flex w-full max-w-md flex-col",
|
|
637
941
|
formikProps: {
|
|
638
942
|
enableReinitialize: true,
|