@bigbinary/neeto-integrations-frontend 4.0.13 → 4.0.14
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.js +2 -2
- package/dist/DailyForm.js +2 -2
- package/dist/{Form-DGYvhKlX.js → Form-DKAK6ylB.js} +2 -2
- package/dist/{Form-DGYvhKlX.js.map → Form-DKAK6ylB.js.map} +1 -1
- package/dist/Telnyx.js +218 -0
- package/dist/Telnyx.js.map +1 -0
- package/dist/Twilio.js +1 -1
- package/dist/Zoom.js +1 -1
- package/dist/cjs/Telnyx.js +239 -0
- package/dist/cjs/Telnyx.js.map +1 -0
- package/dist/cjs/index.js +20 -233
- package/dist/cjs/index.js.map +1 -1
- package/dist/index.js +20 -218
- package/dist/index.js.map +1 -1
- package/dist/{query-CSH3yyWi.js → query-DWavsm0z.js} +2 -2
- package/dist/{query-CSH3yyWi.js.map → query-DWavsm0z.js.map} +1 -1
- package/package.json +5 -5
package/dist/Daily.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import i18next from 'i18next';
|
|
2
2
|
import { isPresent, noop } from '@bigbinary/neeto-cist';
|
|
3
3
|
import { withTitle, useQueryParams } from '@bigbinary/neeto-commons-frontend/react-utils';
|
|
4
|
-
import { u as useFetchDaily, a as useDestroyDaily, F as Form } from './Form-
|
|
4
|
+
import { u as useFetchDaily, a as useDestroyDaily, F as Form } from './Form-DKAK6ylB.js';
|
|
5
5
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
6
6
|
import { useState } from 'react';
|
|
7
7
|
import { buildUrl } from '@bigbinary/neeto-commons-frontend/utils';
|
|
@@ -27,7 +27,7 @@ import '@babel/runtime/helpers/defineProperty';
|
|
|
27
27
|
import '@tanstack/react-query';
|
|
28
28
|
import '@bigbinary/neeto-commons-frontend/constants';
|
|
29
29
|
import 'axios';
|
|
30
|
-
import './query-
|
|
30
|
+
import './query-DWavsm0z.js';
|
|
31
31
|
import 'yup';
|
|
32
32
|
import '@bigbinary/neeto-icons/Check';
|
|
33
33
|
import '@bigbinary/neetoui/Tooltip';
|
package/dist/DailyForm.js
CHANGED
|
@@ -14,7 +14,7 @@ import '@bigbinary/neetoui/formik/ActionBlock';
|
|
|
14
14
|
import 'react-i18next';
|
|
15
15
|
import 'react-router-dom';
|
|
16
16
|
import './WalkthroughModal.js';
|
|
17
|
-
export { F as default } from './Form-
|
|
17
|
+
export { F as default } from './Form-DKAK6ylB.js';
|
|
18
18
|
import 'react/jsx-runtime';
|
|
19
19
|
import '@bigbinary/neeto-cist';
|
|
20
20
|
import '@bigbinary/neeto-commons-frontend/react-utils/withT';
|
|
@@ -23,6 +23,6 @@ import '@babel/runtime/helpers/defineProperty';
|
|
|
23
23
|
import '@tanstack/react-query';
|
|
24
24
|
import '@bigbinary/neeto-commons-frontend/constants';
|
|
25
25
|
import 'axios';
|
|
26
|
-
import './query-
|
|
26
|
+
import './query-DWavsm0z.js';
|
|
27
27
|
import 'yup';
|
|
28
28
|
//# sourceMappingURL=DailyForm.js.map
|
|
@@ -18,7 +18,7 @@ import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
|
18
18
|
import { useQuery } from '@tanstack/react-query';
|
|
19
19
|
import { DEFAULT_STALE_TIME } from '@bigbinary/neeto-commons-frontend/constants';
|
|
20
20
|
import axios from 'axios';
|
|
21
|
-
import {
|
|
21
|
+
import { b as INTEGRATIONS_ENGINE_DAILY_URL, Q as QUERY_KEYS } from './query-DWavsm0z.js';
|
|
22
22
|
import * as yup from 'yup';
|
|
23
23
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
24
24
|
|
|
@@ -166,4 +166,4 @@ var Form = function Form(_ref) {
|
|
|
166
166
|
var Form$1 = withTitle(Form, i18next.t("neetoIntegrations.browserTitles.integrations.dailyco"));
|
|
167
167
|
|
|
168
168
|
export { Form$1 as F, useDestroyDaily as a, useFetchDaily as u };
|
|
169
|
-
//# sourceMappingURL=Form-
|
|
169
|
+
//# sourceMappingURL=Form-DKAK6ylB.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Form-DGYvhKlX.js","sources":["../app/javascript/src/apis/dailies.js","../app/javascript/src/hooks/reactQuery/useDailiesApi.js","../app/javascript/src/components/Integrations/Daily/constants.js","../app/javascript/src/components/Integrations/Daily/Form.jsx"],"sourcesContent":["import axios from \"axios\";\n\nimport { INTEGRATIONS_ENGINE_DAILY_URL } from \"src/constants/urls\";\n\nconst create = payload =>\n axios.post(INTEGRATIONS_ENGINE_DAILY_URL, { daily: payload });\n\nconst show = () => axios.get(INTEGRATIONS_ENGINE_DAILY_URL);\n\nconst destroy = () => axios.delete(INTEGRATIONS_ENGINE_DAILY_URL);\n\nconst dailiesApi = { create, show, destroy };\n\nexport default dailiesApi;\n","import { useQuery } from \"@tanstack/react-query\";\nimport { DEFAULT_STALE_TIME } from \"neetocommons/constants\";\nimport { useMutationWithInvalidation } from \"neetocommons/react-utils\";\n\nimport dailiesApi from \"apis/dailies\";\nimport { QUERY_KEYS } from \"src/constants/query\";\n\nexport const useCreateDaily = (options = {}) =>\n useMutationWithInvalidation(dailiesApi.create, {\n keysToInvalidate: [[QUERY_KEYS.DAILY_CO_DETAILS]],\n ...options,\n });\n\nexport const useFetchDaily = () =>\n useQuery({\n queryKey: [QUERY_KEYS.DAILY_CO_DETAILS],\n queryFn: dailiesApi.show,\n staleTime: DEFAULT_STALE_TIME,\n });\n\nexport const useDestroyDaily = ({ onSuccess }) =>\n useMutationWithInvalidation(dailiesApi.destroy, {\n keysToInvalidate: [[QUERY_KEYS.DAILY_CO_DETAILS]],\n onSuccess,\n });\n","import { t } from \"i18next\";\nimport * as yup from \"yup\";\n\nexport const MANAGE_DAILY_CO_FORM_INITIAL_VALUES = { apiKey: \"\" };\n\nexport const DAILY_CO_VALIDATION_SCHEMA = yup.object().shape({\n apiKey: yup\n .string()\n .trim()\n .required(\n t(\"neetoIntegrations.errors.required\", {\n entity: t(\"neetoIntegrations.daily.apiKey\"),\n })\n ),\n});\n","import { useState } from \"react\";\n\nimport i18next from \"i18next\";\nimport { withTitle } from \"neetocommons/react-utils\";\nimport CardLayout from \"neetomolecules/CardLayout\";\nimport Container from \"neetomolecules/Container\";\nimport Header from \"neetomolecules/Header\";\nimport { Button, Spinner, Typography } from \"neetoui\";\nimport { Input, Form as FormikForm, ActionBlock } from \"neetoui/formik\";\nimport { Trans, useTranslation } from \"react-i18next\";\nimport { useHistory } from \"react-router-dom\";\n\nimport WalkthroughModal from \"components/WalkthroughModal\";\nimport { useCreateDaily } from \"hooks/reactQuery/useDailiesApi\";\n\nimport {\n MANAGE_DAILY_CO_FORM_INITIAL_VALUES,\n DAILY_CO_VALIDATION_SCHEMA,\n} from \"./constants\";\n\nconst Form = ({ helpDocUrl, videoUrl, onConnect, breadcrumbs }) => {\n const { t } = useTranslation();\n const history = useHistory();\n\n const [isDemoModalOpen, setIsDemoModalOpen] = useState(false);\n\n const { mutate: createDaily, isPending: isConnecting } = useCreateDaily({\n onSuccess: () => onConnect?.(),\n });\n\n const handleSubmit = payload => createDaily(payload);\n\n if (isConnecting) {\n return (\n <div className=\"flex h-full w-full items-center justify-center\">\n <Spinner />\n </div>\n );\n }\n\n return (\n <Container isHeaderFixed>\n <Header\n {...{ breadcrumbs }}\n title={t(\"neetoIntegrations.daily.connect.title\")}\n titleHelpPopoverProps={{\n title: t(\"neetoIntegrations.daily.connect.title\"),\n description: (\n <Typography lineHeight=\"normal\" style=\"body2\">\n <Trans\n i18nKey=\"neetoIntegrations.daily.helpDoc\"\n components={{\n videoLink: (\n <Button\n style=\"link\"\n onClick={() => setIsDemoModalOpen(true)}\n />\n ),\n }}\n />\n </Typography>\n ),\n helpLinkProps: {\n href: helpDocUrl,\n \"data-cy\": \"api-key-help-doc-link\",\n },\n }}\n />\n <div className=\"w-full\">\n <FormikForm\n formikProps={{\n initialValues: MANAGE_DAILY_CO_FORM_INITIAL_VALUES,\n validationSchema: DAILY_CO_VALIDATION_SCHEMA,\n onSubmit: handleSubmit,\n }}\n >\n <CardLayout\n actionBlock={\n <ActionBlock\n cancelButtonProps={{ onClick: () => history.goBack() }}\n isSubmitting={isConnecting}\n submitButtonProps={{\n label: t(\"neetoIntegrations.common.connect\"),\n }}\n />\n }\n >\n <Input\n autoFocus\n required\n label={t(\"neetoIntegrations.daily.apiKey\")}\n name=\"apiKey\"\n />\n </CardLayout>\n </FormikForm>\n <WalkthroughModal\n {...{ videoUrl }}\n isOpen={isDemoModalOpen}\n onClose={() => setIsDemoModalOpen(false)}\n />\n </div>\n </Container>\n );\n};\nexport default withTitle(\n Form,\n i18next.t(\"neetoIntegrations.browserTitles.integrations.dailyco\")\n);\n"],"names":["create","payload","axios","post","INTEGRATIONS_ENGINE_DAILY_URL","daily","show","get","destroy","dailiesApi","useCreateDaily","options","arguments","length","undefined","useMutationWithInvalidation","_objectSpread","keysToInvalidate","QUERY_KEYS","DAILY_CO_DETAILS","useFetchDaily","useQuery","queryKey","queryFn","staleTime","DEFAULT_STALE_TIME","useDestroyDaily","_ref","onSuccess","MANAGE_DAILY_CO_FORM_INITIAL_VALUES","apiKey","DAILY_CO_VALIDATION_SCHEMA","yup","object","shape","string","trim","required","t","entity","Form","helpDocUrl","videoUrl","onConnect","breadcrumbs","_useTranslation","useTranslation","history","useHistory","_useState","useState","_useState2","_slicedToArray","isDemoModalOpen","setIsDemoModalOpen","_useCreateDaily","createDaily","mutate","isConnecting","isPending","handleSubmit","_jsx","className","children","Spinner","_jsxs","Container","isHeaderFixed","Header","title","titleHelpPopoverProps","description","Typography","lineHeight","style","Trans","i18nKey","components","videoLink","Button","onClick","helpLinkProps","href","FormikForm","formikProps","initialValues","validationSchema","onSubmit","CardLayout","actionBlock","ActionBlock","cancelButtonProps","goBack","isSubmitting","submitButtonProps","label","Input","autoFocus","name","WalkthroughModal","isOpen","onClose","withTitle","i18next"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAIA,IAAMA,MAAM,GAAG,SAATA,MA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
1
|
+
{"version":3,"file":"Form-DKAK6ylB.js","sources":["../app/javascript/src/apis/dailies.js","../app/javascript/src/hooks/reactQuery/useDailiesApi.js","../app/javascript/src/components/Integrations/Daily/constants.js","../app/javascript/src/components/Integrations/Daily/Form.jsx"],"sourcesContent":["import axios from \"axios\";\n\nimport { INTEGRATIONS_ENGINE_DAILY_URL } from \"src/constants/urls\";\n\nconst create = payload =>\n axios.post(INTEGRATIONS_ENGINE_DAILY_URL, { daily: payload });\n\nconst show = () => axios.get(INTEGRATIONS_ENGINE_DAILY_URL);\n\nconst destroy = () => axios.delete(INTEGRATIONS_ENGINE_DAILY_URL);\n\nconst dailiesApi = { create, show, destroy };\n\nexport default dailiesApi;\n","import { useQuery } from \"@tanstack/react-query\";\nimport { DEFAULT_STALE_TIME } from \"neetocommons/constants\";\nimport { useMutationWithInvalidation } from \"neetocommons/react-utils\";\n\nimport dailiesApi from \"apis/dailies\";\nimport { QUERY_KEYS } from \"src/constants/query\";\n\nexport const useCreateDaily = (options = {}) =>\n useMutationWithInvalidation(dailiesApi.create, {\n keysToInvalidate: [[QUERY_KEYS.DAILY_CO_DETAILS]],\n ...options,\n });\n\nexport const useFetchDaily = () =>\n useQuery({\n queryKey: [QUERY_KEYS.DAILY_CO_DETAILS],\n queryFn: dailiesApi.show,\n staleTime: DEFAULT_STALE_TIME,\n });\n\nexport const useDestroyDaily = ({ onSuccess }) =>\n useMutationWithInvalidation(dailiesApi.destroy, {\n keysToInvalidate: [[QUERY_KEYS.DAILY_CO_DETAILS]],\n onSuccess,\n });\n","import { t } from \"i18next\";\nimport * as yup from \"yup\";\n\nexport const MANAGE_DAILY_CO_FORM_INITIAL_VALUES = { apiKey: \"\" };\n\nexport const DAILY_CO_VALIDATION_SCHEMA = yup.object().shape({\n apiKey: yup\n .string()\n .trim()\n .required(\n t(\"neetoIntegrations.errors.required\", {\n entity: t(\"neetoIntegrations.daily.apiKey\"),\n })\n ),\n});\n","import { useState } from \"react\";\n\nimport i18next from \"i18next\";\nimport { withTitle } from \"neetocommons/react-utils\";\nimport CardLayout from \"neetomolecules/CardLayout\";\nimport Container from \"neetomolecules/Container\";\nimport Header from \"neetomolecules/Header\";\nimport { Button, Spinner, Typography } from \"neetoui\";\nimport { Input, Form as FormikForm, ActionBlock } from \"neetoui/formik\";\nimport { Trans, useTranslation } from \"react-i18next\";\nimport { useHistory } from \"react-router-dom\";\n\nimport WalkthroughModal from \"components/WalkthroughModal\";\nimport { useCreateDaily } from \"hooks/reactQuery/useDailiesApi\";\n\nimport {\n MANAGE_DAILY_CO_FORM_INITIAL_VALUES,\n DAILY_CO_VALIDATION_SCHEMA,\n} from \"./constants\";\n\nconst Form = ({ helpDocUrl, videoUrl, onConnect, breadcrumbs }) => {\n const { t } = useTranslation();\n const history = useHistory();\n\n const [isDemoModalOpen, setIsDemoModalOpen] = useState(false);\n\n const { mutate: createDaily, isPending: isConnecting } = useCreateDaily({\n onSuccess: () => onConnect?.(),\n });\n\n const handleSubmit = payload => createDaily(payload);\n\n if (isConnecting) {\n return (\n <div className=\"flex h-full w-full items-center justify-center\">\n <Spinner />\n </div>\n );\n }\n\n return (\n <Container isHeaderFixed>\n <Header\n {...{ breadcrumbs }}\n title={t(\"neetoIntegrations.daily.connect.title\")}\n titleHelpPopoverProps={{\n title: t(\"neetoIntegrations.daily.connect.title\"),\n description: (\n <Typography lineHeight=\"normal\" style=\"body2\">\n <Trans\n i18nKey=\"neetoIntegrations.daily.helpDoc\"\n components={{\n videoLink: (\n <Button\n style=\"link\"\n onClick={() => setIsDemoModalOpen(true)}\n />\n ),\n }}\n />\n </Typography>\n ),\n helpLinkProps: {\n href: helpDocUrl,\n \"data-cy\": \"api-key-help-doc-link\",\n },\n }}\n />\n <div className=\"w-full\">\n <FormikForm\n formikProps={{\n initialValues: MANAGE_DAILY_CO_FORM_INITIAL_VALUES,\n validationSchema: DAILY_CO_VALIDATION_SCHEMA,\n onSubmit: handleSubmit,\n }}\n >\n <CardLayout\n actionBlock={\n <ActionBlock\n cancelButtonProps={{ onClick: () => history.goBack() }}\n isSubmitting={isConnecting}\n submitButtonProps={{\n label: t(\"neetoIntegrations.common.connect\"),\n }}\n />\n }\n >\n <Input\n autoFocus\n required\n label={t(\"neetoIntegrations.daily.apiKey\")}\n name=\"apiKey\"\n />\n </CardLayout>\n </FormikForm>\n <WalkthroughModal\n {...{ videoUrl }}\n isOpen={isDemoModalOpen}\n onClose={() => setIsDemoModalOpen(false)}\n />\n </div>\n </Container>\n );\n};\nexport default withTitle(\n Form,\n i18next.t(\"neetoIntegrations.browserTitles.integrations.dailyco\")\n);\n"],"names":["create","payload","axios","post","INTEGRATIONS_ENGINE_DAILY_URL","daily","show","get","destroy","dailiesApi","useCreateDaily","options","arguments","length","undefined","useMutationWithInvalidation","_objectSpread","keysToInvalidate","QUERY_KEYS","DAILY_CO_DETAILS","useFetchDaily","useQuery","queryKey","queryFn","staleTime","DEFAULT_STALE_TIME","useDestroyDaily","_ref","onSuccess","MANAGE_DAILY_CO_FORM_INITIAL_VALUES","apiKey","DAILY_CO_VALIDATION_SCHEMA","yup","object","shape","string","trim","required","t","entity","Form","helpDocUrl","videoUrl","onConnect","breadcrumbs","_useTranslation","useTranslation","history","useHistory","_useState","useState","_useState2","_slicedToArray","isDemoModalOpen","setIsDemoModalOpen","_useCreateDaily","createDaily","mutate","isConnecting","isPending","handleSubmit","_jsx","className","children","Spinner","_jsxs","Container","isHeaderFixed","Header","title","titleHelpPopoverProps","description","Typography","lineHeight","style","Trans","i18nKey","components","videoLink","Button","onClick","helpLinkProps","href","FormikForm","formikProps","initialValues","validationSchema","onSubmit","CardLayout","actionBlock","ActionBlock","cancelButtonProps","goBack","isSubmitting","submitButtonProps","label","Input","autoFocus","name","WalkthroughModal","isOpen","onClose","withTitle","i18next"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAIA,IAAMA,MAAM,GAAG,SAATA,MAAMA,CAAGC,OAAO,EAAA;AAAA,EAAA,OACpBC,KAAK,CAACC,IAAI,CA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Ref } from 'react';
|
|
2
|
+
import { findBy, isNotEmpty, noop } from '@bigbinary/neeto-cist';
|
|
3
|
+
import CardLayout from '@bigbinary/neeto-molecules/CardLayout';
|
|
4
|
+
import PageLoader from '@bigbinary/neeto-molecules/PageLoader';
|
|
5
|
+
import ActionBlock from '@bigbinary/neetoui/formik/ActionBlock';
|
|
6
|
+
import Form from '@bigbinary/neetoui/formik/Form';
|
|
7
|
+
import Input from '@bigbinary/neetoui/formik/Input';
|
|
8
|
+
import Select from '@bigbinary/neetoui/formik/Select';
|
|
9
|
+
import { prop, isEmpty } from 'ramda';
|
|
10
|
+
import { useTranslation } from 'react-i18next';
|
|
11
|
+
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
12
|
+
import { useQuery, useMutation } from '@tanstack/react-query';
|
|
13
|
+
import { useMutationWithInvalidation } from '@bigbinary/neeto-commons-frontend/react-utils';
|
|
14
|
+
import axios from 'axios';
|
|
15
|
+
import { T as TELNYX_SMS_CONFIGURATION_URL, c as TELNYX_PHONE_NUMBERS_URL, Q as QUERY_KEYS } from './query-DWavsm0z.js';
|
|
16
|
+
import { t } from 'i18next';
|
|
17
|
+
import * as yup from 'yup';
|
|
18
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
19
|
+
|
|
20
|
+
var fetchTelnyxSmsConfiguration = function fetchTelnyxSmsConfiguration(integrable) {
|
|
21
|
+
return axios.get(TELNYX_SMS_CONFIGURATION_URL, {
|
|
22
|
+
params: integrable
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
var fetchTelnyxPhoneNumbers = function fetchTelnyxPhoneNumbers(_ref) {
|
|
26
|
+
var apiKey = _ref.apiKey,
|
|
27
|
+
messagingProfileId = _ref.messagingProfileId;
|
|
28
|
+
return axios.get(TELNYX_PHONE_NUMBERS_URL, {
|
|
29
|
+
params: {
|
|
30
|
+
telnyx: {
|
|
31
|
+
apiKey: apiKey,
|
|
32
|
+
messagingProfileId: messagingProfileId
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
var createTelnyxSmsConfiguration = function createTelnyxSmsConfiguration(payload) {
|
|
38
|
+
return axios.post(TELNYX_SMS_CONFIGURATION_URL, {
|
|
39
|
+
telnyx: payload
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
var telnyxApi = {
|
|
43
|
+
fetchTelnyxPhoneNumbers: fetchTelnyxPhoneNumbers,
|
|
44
|
+
fetchTelnyxSmsConfiguration: fetchTelnyxSmsConfiguration,
|
|
45
|
+
createTelnyxSmsConfiguration: createTelnyxSmsConfiguration
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
var useFetchTelnyxSmsConfiguration = function useFetchTelnyxSmsConfiguration(_ref) {
|
|
49
|
+
var integrable = _ref.integrable;
|
|
50
|
+
return useQuery({
|
|
51
|
+
queryKey: [QUERY_KEYS.TELNYX_SMS_CONFIGURATION, integrable === null || integrable === void 0 ? void 0 : integrable.integrableType, integrable === null || integrable === void 0 ? void 0 : integrable.integrableId],
|
|
52
|
+
queryFn: function queryFn() {
|
|
53
|
+
return telnyxApi.fetchTelnyxSmsConfiguration(integrable);
|
|
54
|
+
},
|
|
55
|
+
select: prop("smsConfiguration")
|
|
56
|
+
});
|
|
57
|
+
};
|
|
58
|
+
var useFetchTelnyxPhoneNumbers = function useFetchTelnyxPhoneNumbers() {
|
|
59
|
+
return useMutation({
|
|
60
|
+
mutationFn: telnyxApi.fetchTelnyxPhoneNumbers
|
|
61
|
+
});
|
|
62
|
+
};
|
|
63
|
+
var useCreateTelnyxSmsConfiguration = function useCreateTelnyxSmsConfiguration(_ref2) {
|
|
64
|
+
var integrable = _ref2.integrable;
|
|
65
|
+
return useMutationWithInvalidation(telnyxApi.createTelnyxSmsConfiguration, {
|
|
66
|
+
keysToInvalidate: [[QUERY_KEYS.TELNYX_SMS_CONFIGURATION, integrable === null || integrable === void 0 ? void 0 : integrable.integrableType, integrable === null || integrable === void 0 ? void 0 : integrable.integrableId]]
|
|
67
|
+
});
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
var buildPhoneNumberOptions = function buildPhoneNumberOptions(phoneNumbers) {
|
|
71
|
+
return phoneNumbers ? phoneNumbers.map(function (_ref) {
|
|
72
|
+
var id = _ref.id,
|
|
73
|
+
phoneNumber = _ref.phoneNumber;
|
|
74
|
+
return {
|
|
75
|
+
value: id,
|
|
76
|
+
label: phoneNumber
|
|
77
|
+
};
|
|
78
|
+
}) : [];
|
|
79
|
+
};
|
|
80
|
+
var buildTelnyxConfigurationValidationSchema = function buildTelnyxConfigurationValidationSchema(isPhoneNumberRequired) {
|
|
81
|
+
return yup.object().shape({
|
|
82
|
+
apiKey: yup.string().required(t("neetoIntegrations.telnyx.validations.apiKeyRequired")),
|
|
83
|
+
messagingProfileId: yup.string().required(t("neetoIntegrations.telnyx.validations.messagingProfileIdRequired")),
|
|
84
|
+
phoneNumber: isPhoneNumberRequired ? yup.object().shape({
|
|
85
|
+
label: yup.string(),
|
|
86
|
+
value: yup.string()
|
|
87
|
+
}).nullable().required(t("neetoIntegrations.telnyx.validations.phoneNumberRequired")) : yup.mixed().nullable()
|
|
88
|
+
});
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
var useTelnyxForm = function useTelnyxForm(_ref) {
|
|
92
|
+
var integrable = _ref.integrable,
|
|
93
|
+
onConnect = _ref.onConnect;
|
|
94
|
+
var _useState = useState([]),
|
|
95
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
96
|
+
phoneNumbers = _useState2[0],
|
|
97
|
+
setPhoneNumbers = _useState2[1];
|
|
98
|
+
var _useFetchTelnyxSmsCon = useFetchTelnyxSmsConfiguration({
|
|
99
|
+
integrable: integrable
|
|
100
|
+
}),
|
|
101
|
+
configuration = _useFetchTelnyxSmsCon.data,
|
|
102
|
+
isLoading = _useFetchTelnyxSmsCon.isLoading;
|
|
103
|
+
var _useFetchTelnyxPhoneN = useFetchTelnyxPhoneNumbers(),
|
|
104
|
+
fetchTelnyxPhoneNumbers = _useFetchTelnyxPhoneN.mutate,
|
|
105
|
+
isFetchPhoneNumbersLoading = _useFetchTelnyxPhoneN.isPending;
|
|
106
|
+
var _useCreateTelnyxSmsCo = useCreateTelnyxSmsConfiguration({
|
|
107
|
+
integrable: integrable
|
|
108
|
+
}),
|
|
109
|
+
createTelnyxSmsConfiguration = _useCreateTelnyxSmsCo.mutate,
|
|
110
|
+
isCreateSmsConfigurationLoading = _useCreateTelnyxSmsCo.isPending;
|
|
111
|
+
var handleSubmit = function handleSubmit(values) {
|
|
112
|
+
if (isEmpty(phoneNumbers)) {
|
|
113
|
+
var params = {
|
|
114
|
+
apiKey: values.apiKey,
|
|
115
|
+
messagingProfileId: values.messagingProfileId
|
|
116
|
+
};
|
|
117
|
+
fetchTelnyxPhoneNumbers(params, {
|
|
118
|
+
onSuccess: function onSuccess(_ref2) {
|
|
119
|
+
var phoneNumbers = _ref2.phoneNumbers;
|
|
120
|
+
return setPhoneNumbers(phoneNumbers);
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
var payload = {
|
|
126
|
+
apiKey: values.apiKey,
|
|
127
|
+
messagingProfileId: values.messagingProfileId,
|
|
128
|
+
phoneNumberId: values.phoneNumber.value
|
|
129
|
+
};
|
|
130
|
+
createTelnyxSmsConfiguration(payload, {
|
|
131
|
+
onSuccess: onConnect
|
|
132
|
+
});
|
|
133
|
+
};
|
|
134
|
+
var isSubmitting = isFetchPhoneNumbersLoading || isCreateSmsConfigurationLoading;
|
|
135
|
+
var phoneNumberOptions = buildPhoneNumberOptions(phoneNumbers);
|
|
136
|
+
var initialValues = {
|
|
137
|
+
apiKey: (configuration === null || configuration === void 0 ? void 0 : configuration.apiKey) || "",
|
|
138
|
+
messagingProfileId: (configuration === null || configuration === void 0 ? void 0 : configuration.messagingProfileId) || "",
|
|
139
|
+
phoneNumber: findBy({
|
|
140
|
+
label: configuration === null || configuration === void 0 ? void 0 : configuration.phoneNumber
|
|
141
|
+
}, phoneNumberOptions) || null
|
|
142
|
+
};
|
|
143
|
+
return {
|
|
144
|
+
initialValues: initialValues,
|
|
145
|
+
phoneNumberOptions: phoneNumberOptions,
|
|
146
|
+
isSubmitting: isSubmitting,
|
|
147
|
+
isLoading: isLoading,
|
|
148
|
+
handleSubmit: handleSubmit
|
|
149
|
+
};
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
var Telnyx = function Telnyx(_ref) {
|
|
153
|
+
var _ref$integrable = _ref.integrable,
|
|
154
|
+
integrable = _ref$integrable === void 0 ? null : _ref$integrable,
|
|
155
|
+
_ref$onClose = _ref.onClose,
|
|
156
|
+
onClose = _ref$onClose === void 0 ? noop : _ref$onClose,
|
|
157
|
+
_ref$onConnect = _ref.onConnect,
|
|
158
|
+
onConnect = _ref$onConnect === void 0 ? noop : _ref$onConnect;
|
|
159
|
+
var formRef = useRef(null);
|
|
160
|
+
var _useTranslation = useTranslation(),
|
|
161
|
+
t = _useTranslation.t;
|
|
162
|
+
var _useTelnyxForm = useTelnyxForm({
|
|
163
|
+
integrable: integrable,
|
|
164
|
+
onConnect: onConnect
|
|
165
|
+
}),
|
|
166
|
+
initialValues = _useTelnyxForm.initialValues,
|
|
167
|
+
handleSubmit = _useTelnyxForm.handleSubmit,
|
|
168
|
+
phoneNumberOptions = _useTelnyxForm.phoneNumberOptions,
|
|
169
|
+
isSubmitting = _useTelnyxForm.isSubmitting,
|
|
170
|
+
isLoading = _useTelnyxForm.isLoading;
|
|
171
|
+
var isPhoneNumberRequired = isNotEmpty(phoneNumberOptions);
|
|
172
|
+
var submitButtonLabel = isNotEmpty(phoneNumberOptions) ? t("neetoIntegrations.common.saveChanges") : t("neetoIntegrations.common.verify");
|
|
173
|
+
if (isLoading) return /*#__PURE__*/jsx(PageLoader, {});
|
|
174
|
+
return /*#__PURE__*/jsx(Form, {
|
|
175
|
+
className: "w-full",
|
|
176
|
+
formikProps: {
|
|
177
|
+
enableReinitialize: true,
|
|
178
|
+
initialValues: initialValues,
|
|
179
|
+
validationSchema: buildTelnyxConfigurationValidationSchema(isPhoneNumberRequired),
|
|
180
|
+
innerRef: formRef,
|
|
181
|
+
onSubmit: handleSubmit
|
|
182
|
+
},
|
|
183
|
+
children: function children(_ref2) {
|
|
184
|
+
var dirty = _ref2.dirty;
|
|
185
|
+
return /*#__PURE__*/jsx(CardLayout, {
|
|
186
|
+
actionBlock: /*#__PURE__*/jsx(ActionBlock, {
|
|
187
|
+
isSubmitting: isSubmitting,
|
|
188
|
+
cancelButtonProps: {
|
|
189
|
+
onClick: onClose
|
|
190
|
+
},
|
|
191
|
+
submitButtonProps: {
|
|
192
|
+
label: submitButtonLabel,
|
|
193
|
+
// The button is disabled if phoneNumberOptions is empty and there is no apiKey in initialValues while the form is not dirty.
|
|
194
|
+
// If phoneNumberOptions is not empty, the button is disabled when the form is unchanged.
|
|
195
|
+
disabled: isEmpty(phoneNumberOptions) ? !initialValues.apiKey && !dirty : !dirty
|
|
196
|
+
}
|
|
197
|
+
}),
|
|
198
|
+
children: /*#__PURE__*/jsxs("div", {
|
|
199
|
+
className: "space-y-4",
|
|
200
|
+
children: [/*#__PURE__*/jsx(Input, {
|
|
201
|
+
label: t("neetoIntegrations.telnyx.apiKey"),
|
|
202
|
+
name: "apiKey"
|
|
203
|
+
}), /*#__PURE__*/jsx(Input, {
|
|
204
|
+
label: t("neetoIntegrations.telnyx.messagingProfileId"),
|
|
205
|
+
name: "messagingProfileId"
|
|
206
|
+
}), isNotEmpty(phoneNumberOptions) && /*#__PURE__*/jsx(Select, {
|
|
207
|
+
label: t("neetoIntegrations.telnyx.phoneNumber"),
|
|
208
|
+
name: "phoneNumber",
|
|
209
|
+
options: phoneNumberOptions
|
|
210
|
+
})]
|
|
211
|
+
})
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
});
|
|
215
|
+
};
|
|
216
|
+
|
|
217
|
+
export { Telnyx as default };
|
|
218
|
+
//# sourceMappingURL=Telnyx.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Telnyx.js","sources":["../app/javascript/src/apis/telnyx.js","../app/javascript/src/hooks/reactQuery/useTelnyxApi.js","../app/javascript/src/components/Integrations/Telnyx/utils.js","../app/javascript/src/components/Integrations/Telnyx/hooks/useTelnyxForm.js","../app/javascript/src/components/Integrations/Telnyx/index.jsx"],"sourcesContent":["import axios from \"axios\";\n\nimport {\n TELNYX_PHONE_NUMBERS_URL,\n TELNYX_SMS_CONFIGURATION_URL,\n} from \"src/constants/urls\";\n\nconst fetchTelnyxSmsConfiguration = integrable =>\n axios.get(TELNYX_SMS_CONFIGURATION_URL, { params: integrable });\n\nconst fetchTelnyxPhoneNumbers = ({ apiKey, messagingProfileId }) =>\n axios.get(TELNYX_PHONE_NUMBERS_URL, {\n params: { telnyx: { apiKey, messagingProfileId } },\n });\n\nconst createTelnyxSmsConfiguration = payload =>\n axios.post(TELNYX_SMS_CONFIGURATION_URL, { telnyx: payload });\n\nconst telnyxApi = {\n fetchTelnyxPhoneNumbers,\n fetchTelnyxSmsConfiguration,\n createTelnyxSmsConfiguration,\n};\n\nexport default telnyxApi;\n","import { useQuery, useMutation } from \"@tanstack/react-query\";\nimport { useMutationWithInvalidation } from \"neetocommons/react-utils\";\nimport { prop } from \"ramda\";\n\nimport telnyxApi from \"apis/telnyx\";\nimport { QUERY_KEYS } from \"src/constants/query\";\n\nconst useFetchTelnyxSmsConfiguration = ({ integrable }) =>\n useQuery({\n queryKey: [\n QUERY_KEYS.TELNYX_SMS_CONFIGURATION,\n integrable?.integrableType,\n integrable?.integrableId,\n ],\n queryFn: () => telnyxApi.fetchTelnyxSmsConfiguration(integrable),\n select: prop(\"smsConfiguration\"),\n });\n\nconst useFetchTelnyxPhoneNumbers = () =>\n useMutation({ mutationFn: telnyxApi.fetchTelnyxPhoneNumbers });\n\nconst useCreateTelnyxSmsConfiguration = ({ integrable }) =>\n useMutationWithInvalidation(telnyxApi.createTelnyxSmsConfiguration, {\n keysToInvalidate: [\n [\n QUERY_KEYS.TELNYX_SMS_CONFIGURATION,\n integrable?.integrableType,\n integrable?.integrableId,\n ],\n ],\n });\n\nexport {\n useFetchTelnyxPhoneNumbers,\n useFetchTelnyxSmsConfiguration,\n useCreateTelnyxSmsConfiguration,\n};\n","import { t } from \"i18next\";\nimport * as yup from \"yup\";\n\nexport const buildPhoneNumberOptions = phoneNumbers =>\n phoneNumbers\n ? phoneNumbers.map(({ id, phoneNumber }) => ({\n value: id,\n label: phoneNumber,\n }))\n : [];\n\nexport const buildTelnyxConfigurationValidationSchema = isPhoneNumberRequired =>\n yup.object().shape({\n apiKey: yup\n .string()\n .required(t(\"neetoIntegrations.telnyx.validations.apiKeyRequired\")),\n messagingProfileId: yup\n .string()\n .required(\n t(\"neetoIntegrations.telnyx.validations.messagingProfileIdRequired\")\n ),\n phoneNumber: isPhoneNumberRequired\n ? yup\n .object()\n .shape({ label: yup.string(), value: yup.string() })\n .nullable()\n .required(\n t(\"neetoIntegrations.telnyx.validations.phoneNumberRequired\")\n )\n : yup.mixed().nullable(),\n });\n","import { useState } from \"react\";\n\nimport { findBy } from \"neetocist\";\nimport { isEmpty } from \"ramda\";\n\nimport {\n useCreateTelnyxSmsConfiguration,\n useFetchTelnyxPhoneNumbers,\n useFetchTelnyxSmsConfiguration,\n} from \"hooks/reactQuery/useTelnyxApi\";\n\nimport { buildPhoneNumberOptions } from \"../utils\";\n\nconst useTelnyxForm = ({ integrable, onConnect }) => {\n const [phoneNumbers, setPhoneNumbers] = useState([]);\n\n const { data: configuration, isLoading } = useFetchTelnyxSmsConfiguration({\n integrable,\n });\n\n const {\n mutate: fetchTelnyxPhoneNumbers,\n isPending: isFetchPhoneNumbersLoading,\n } = useFetchTelnyxPhoneNumbers();\n\n const {\n mutate: createTelnyxSmsConfiguration,\n isPending: isCreateSmsConfigurationLoading,\n } = useCreateTelnyxSmsConfiguration({ integrable });\n\n const handleSubmit = values => {\n if (isEmpty(phoneNumbers)) {\n const params = {\n apiKey: values.apiKey,\n messagingProfileId: values.messagingProfileId,\n };\n\n fetchTelnyxPhoneNumbers(params, {\n onSuccess: ({ phoneNumbers }) => setPhoneNumbers(phoneNumbers),\n });\n\n return;\n }\n\n const payload = {\n apiKey: values.apiKey,\n messagingProfileId: values.messagingProfileId,\n phoneNumberId: values.phoneNumber.value,\n };\n\n createTelnyxSmsConfiguration(payload, { onSuccess: onConnect });\n };\n\n const isSubmitting =\n isFetchPhoneNumbersLoading || isCreateSmsConfigurationLoading;\n\n const phoneNumberOptions = buildPhoneNumberOptions(phoneNumbers);\n\n const initialValues = {\n apiKey: configuration?.apiKey || \"\",\n messagingProfileId: configuration?.messagingProfileId || \"\",\n phoneNumber:\n findBy({ label: configuration?.phoneNumber }, phoneNumberOptions) || null,\n };\n\n return {\n initialValues,\n phoneNumberOptions,\n isSubmitting,\n isLoading,\n handleSubmit,\n };\n};\n\nexport default useTelnyxForm;\n","import { useRef } from \"react\";\n\nimport { isNotEmpty, noop } from \"neetocist\";\nimport CardLayout from \"neetomolecules/CardLayout\";\nimport PageLoader from \"neetomolecules/PageLoader\";\nimport { ActionBlock, Form, Input, Select } from \"neetoui/formik\";\nimport { isEmpty } from \"ramda\";\nimport { useTranslation } from \"react-i18next\";\n\nimport useTelnyxForm from \"./hooks/useTelnyxForm\";\nimport { buildTelnyxConfigurationValidationSchema } from \"./utils\";\n\nconst Telnyx = ({ integrable = null, onClose = noop, onConnect = noop }) => {\n const formRef = useRef(null);\n\n const { t } = useTranslation();\n\n const {\n initialValues,\n handleSubmit,\n phoneNumberOptions,\n isSubmitting,\n isLoading,\n } = useTelnyxForm({ integrable, onConnect });\n\n const isPhoneNumberRequired = isNotEmpty(phoneNumberOptions);\n\n const submitButtonLabel = isNotEmpty(phoneNumberOptions)\n ? t(\"neetoIntegrations.common.saveChanges\")\n : t(\"neetoIntegrations.common.verify\");\n\n if (isLoading) return <PageLoader />;\n\n return (\n <Form\n className=\"w-full\"\n formikProps={{\n enableReinitialize: true,\n initialValues,\n validationSchema: buildTelnyxConfigurationValidationSchema(\n isPhoneNumberRequired\n ),\n innerRef: formRef,\n onSubmit: handleSubmit,\n }}\n >\n {({ dirty }) => (\n <CardLayout\n actionBlock={\n <ActionBlock\n {...{ isSubmitting }}\n cancelButtonProps={{ onClick: onClose }}\n submitButtonProps={{\n label: submitButtonLabel,\n // The button is disabled if phoneNumberOptions is empty and there is no apiKey in initialValues while the form is not dirty.\n // If phoneNumberOptions is not empty, the button is disabled when the form is unchanged.\n disabled: isEmpty(phoneNumberOptions)\n ? !initialValues.apiKey && !dirty\n : !dirty,\n }}\n />\n }\n >\n <div className=\"space-y-4\">\n <Input label={t(\"neetoIntegrations.telnyx.apiKey\")} name=\"apiKey\" />\n <Input\n label={t(\"neetoIntegrations.telnyx.messagingProfileId\")}\n name=\"messagingProfileId\"\n />\n {isNotEmpty(phoneNumberOptions) && (\n <Select\n label={t(\"neetoIntegrations.telnyx.phoneNumber\")}\n name=\"phoneNumber\"\n options={phoneNumberOptions}\n />\n )}\n </div>\n </CardLayout>\n )}\n </Form>\n );\n};\n\nexport default Telnyx;\n"],"names":["fetchTelnyxSmsConfiguration","integrable","axios","get","TELNYX_SMS_CONFIGURATION_URL","params","fetchTelnyxPhoneNumbers","_ref","apiKey","messagingProfileId","TELNYX_PHONE_NUMBERS_URL","telnyx","createTelnyxSmsConfiguration","payload","post","telnyxApi","useFetchTelnyxSmsConfiguration","useQuery","queryKey","QUERY_KEYS","TELNYX_SMS_CONFIGURATION","integrableType","integrableId","queryFn","select","prop","useFetchTelnyxPhoneNumbers","useMutation","mutationFn","useCreateTelnyxSmsConfiguration","_ref2","useMutationWithInvalidation","keysToInvalidate","buildPhoneNumberOptions","phoneNumbers","map","id","phoneNumber","value","label","buildTelnyxConfigurationValidationSchema","isPhoneNumberRequired","yup","object","shape","string","required","t","nullable","mixed","useTelnyxForm","onConnect","_useState","useState","_useState2","_slicedToArray","setPhoneNumbers","_useFetchTelnyxSmsCon","configuration","data","isLoading","_useFetchTelnyxPhoneN","mutate","isFetchPhoneNumbersLoading","isPending","_useCreateTelnyxSmsCo","isCreateSmsConfigurationLoading","handleSubmit","values","isEmpty","onSuccess","phoneNumberId","isSubmitting","phoneNumberOptions","initialValues","findBy","Telnyx","_ref$integrable","_ref$onClose","onClose","noop","_ref$onConnect","formRef","useRef","_useTranslation","useTranslation","_useTelnyxForm","isNotEmpty","submitButtonLabel","_jsx","PageLoader","Form","className","formikProps","enableReinitialize","validationSchema","innerRef","onSubmit","children","dirty","CardLayout","actionBlock","ActionBlock","cancelButtonProps","onClick","submitButtonProps","disabled","_jsxs","Input","name","Select","options"],"mappings":";;;;;;;;;;;;;;;;;;;AAOA,IAAMA,2BAA2B,GAAG,SAA9BA,2BAA2BA,CAAGC,UAAU,EAAA;AAAA,EAAA,OAC5CC,KAAK,CAACC,GAAG,CAACC,4BAA4B,EAAE;AAAEC,IAAAA,MAAM,EAAEJ;AAAW,GAAC,CAAC;AAAA,CAAA;AAEjE,IAAMK,uBAAuB,GAAG,SAA1BA,uBAAuBA,CAAAC,IAAA,EAAA;AAAA,EAAA,IAAMC,MAAM,GAAAD,IAAA,CAANC,MAAM;IAAEC,kBAAkB,GAAAF,IAAA,CAAlBE,kBAAkB;AAAA,EAAA,OAC3DP,KAAK,CAACC,GAAG,CAACO,wBAAwB,EAAE;AAClCL,IAAAA,MAAM,EAAE;AAAEM,MAAAA,MAAM,EAAE;AAAEH,QAAAA,MAAM,EAANA,MAAM;AAAEC,QAAAA,kBAAkB,EAAlBA;AAAmB;AAAE;AACnD,GAAC,CAAC;AAAA,CAAA;AAEJ,IAAMG,4BAA4B,GAAG,SAA/BA,4BAA4BA,CAAGC,OAAO,EAAA;AAAA,EAAA,OAC1CX,KAAK,CAACY,IAAI,CAACV,4BAA4B,EAAE;AAAEO,IAAAA,MAAM,EAAEE;AAAQ,GAAC,CAAC;AAAA,CAAA;AAE/D,IAAME,SAAS,GAAG;AAChBT,EAAAA,uBAAuB,EAAvBA,u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ime/helpers/slicedToArray';
|
|
|
13
13
|
import { useMutationWithInvalidation, useStateWithDependency } from '@bigbinary/neeto-commons-frontend/react-utils';
|
|
14
14
|
import { useQuery } from '@tanstack/react-query';
|
|
15
15
|
import axios from 'axios';
|
|
16
|
-
import {
|
|
16
|
+
import { d as TWILIO_CONFIGURATION_BASE_URL, Q as QUERY_KEYS } from './query-DWavsm0z.js';
|
|
17
17
|
import i18next from 'i18next';
|
|
18
18
|
import * as yup from 'yup';
|
|
19
19
|
|
package/dist/Zoom.js
CHANGED
|
@@ -9,7 +9,7 @@ import { useQuery } from '@tanstack/react-query';
|
|
|
9
9
|
import { DEFAULT_STALE_TIME } from '@bigbinary/neeto-commons-frontend/constants';
|
|
10
10
|
import { useMutationWithInvalidation } from '@bigbinary/neeto-commons-frontend/react-utils';
|
|
11
11
|
import axios from 'axios';
|
|
12
|
-
import {
|
|
12
|
+
import { I as INTEGRATION_DETAILS_URL, a as INTEGRATIONS_ENGINE_ZOOM_URL, Q as QUERY_KEYS } from './query-DWavsm0z.js';
|
|
13
13
|
import { jsx } from 'react/jsx-runtime';
|
|
14
14
|
import '@babel/runtime/helpers/defineProperty';
|
|
15
15
|
import '@bigbinary/neeto-icons/Check';
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
var neetoCist = require('@bigbinary/neeto-cist');
|
|
5
|
+
var CardLayout = require('@bigbinary/neeto-molecules/CardLayout');
|
|
6
|
+
var PageLoader = require('@bigbinary/neeto-molecules/PageLoader');
|
|
7
|
+
var ActionBlock = require('@bigbinary/neetoui/formik/ActionBlock');
|
|
8
|
+
var Form = require('@bigbinary/neetoui/formik/Form');
|
|
9
|
+
var Input = require('@bigbinary/neetoui/formik/Input');
|
|
10
|
+
var Select = require('@bigbinary/neetoui/formik/Select');
|
|
11
|
+
var ramda = require('ramda');
|
|
12
|
+
var reactI18next = require('react-i18next');
|
|
13
|
+
var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
|
|
14
|
+
var reactQuery = require('@tanstack/react-query');
|
|
15
|
+
var reactUtils = require('@bigbinary/neeto-commons-frontend/react-utils');
|
|
16
|
+
var axios = require('axios');
|
|
17
|
+
var query = require('../query-tu4TNsM9.js');
|
|
18
|
+
var i18next = require('i18next');
|
|
19
|
+
var yup = require('yup');
|
|
20
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
21
|
+
|
|
22
|
+
function _interopNamespaceDefault(e) {
|
|
23
|
+
var n = Object.create(null);
|
|
24
|
+
if (e) {
|
|
25
|
+
Object.keys(e).forEach(function (k) {
|
|
26
|
+
if (k !== 'default') {
|
|
27
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
28
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
29
|
+
enumerable: true,
|
|
30
|
+
get: function () { return e[k]; }
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
n.default = e;
|
|
36
|
+
return Object.freeze(n);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
var yup__namespace = /*#__PURE__*/_interopNamespaceDefault(yup);
|
|
40
|
+
|
|
41
|
+
var fetchTelnyxSmsConfiguration = function fetchTelnyxSmsConfiguration(integrable) {
|
|
42
|
+
return axios.get(query.TELNYX_SMS_CONFIGURATION_URL, {
|
|
43
|
+
params: integrable
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
var fetchTelnyxPhoneNumbers = function fetchTelnyxPhoneNumbers(_ref) {
|
|
47
|
+
var apiKey = _ref.apiKey,
|
|
48
|
+
messagingProfileId = _ref.messagingProfileId;
|
|
49
|
+
return axios.get(query.TELNYX_PHONE_NUMBERS_URL, {
|
|
50
|
+
params: {
|
|
51
|
+
telnyx: {
|
|
52
|
+
apiKey: apiKey,
|
|
53
|
+
messagingProfileId: messagingProfileId
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
};
|
|
58
|
+
var createTelnyxSmsConfiguration = function createTelnyxSmsConfiguration(payload) {
|
|
59
|
+
return axios.post(query.TELNYX_SMS_CONFIGURATION_URL, {
|
|
60
|
+
telnyx: payload
|
|
61
|
+
});
|
|
62
|
+
};
|
|
63
|
+
var telnyxApi = {
|
|
64
|
+
fetchTelnyxPhoneNumbers: fetchTelnyxPhoneNumbers,
|
|
65
|
+
fetchTelnyxSmsConfiguration: fetchTelnyxSmsConfiguration,
|
|
66
|
+
createTelnyxSmsConfiguration: createTelnyxSmsConfiguration
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
var useFetchTelnyxSmsConfiguration = function useFetchTelnyxSmsConfiguration(_ref) {
|
|
70
|
+
var integrable = _ref.integrable;
|
|
71
|
+
return reactQuery.useQuery({
|
|
72
|
+
queryKey: [query.QUERY_KEYS.TELNYX_SMS_CONFIGURATION, integrable === null || integrable === void 0 ? void 0 : integrable.integrableType, integrable === null || integrable === void 0 ? void 0 : integrable.integrableId],
|
|
73
|
+
queryFn: function queryFn() {
|
|
74
|
+
return telnyxApi.fetchTelnyxSmsConfiguration(integrable);
|
|
75
|
+
},
|
|
76
|
+
select: ramda.prop("smsConfiguration")
|
|
77
|
+
});
|
|
78
|
+
};
|
|
79
|
+
var useFetchTelnyxPhoneNumbers = function useFetchTelnyxPhoneNumbers() {
|
|
80
|
+
return reactQuery.useMutation({
|
|
81
|
+
mutationFn: telnyxApi.fetchTelnyxPhoneNumbers
|
|
82
|
+
});
|
|
83
|
+
};
|
|
84
|
+
var useCreateTelnyxSmsConfiguration = function useCreateTelnyxSmsConfiguration(_ref2) {
|
|
85
|
+
var integrable = _ref2.integrable;
|
|
86
|
+
return reactUtils.useMutationWithInvalidation(telnyxApi.createTelnyxSmsConfiguration, {
|
|
87
|
+
keysToInvalidate: [[query.QUERY_KEYS.TELNYX_SMS_CONFIGURATION, integrable === null || integrable === void 0 ? void 0 : integrable.integrableType, integrable === null || integrable === void 0 ? void 0 : integrable.integrableId]]
|
|
88
|
+
});
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
var buildPhoneNumberOptions = function buildPhoneNumberOptions(phoneNumbers) {
|
|
92
|
+
return phoneNumbers ? phoneNumbers.map(function (_ref) {
|
|
93
|
+
var id = _ref.id,
|
|
94
|
+
phoneNumber = _ref.phoneNumber;
|
|
95
|
+
return {
|
|
96
|
+
value: id,
|
|
97
|
+
label: phoneNumber
|
|
98
|
+
};
|
|
99
|
+
}) : [];
|
|
100
|
+
};
|
|
101
|
+
var buildTelnyxConfigurationValidationSchema = function buildTelnyxConfigurationValidationSchema(isPhoneNumberRequired) {
|
|
102
|
+
return yup__namespace.object().shape({
|
|
103
|
+
apiKey: yup__namespace.string().required(i18next.t("neetoIntegrations.telnyx.validations.apiKeyRequired")),
|
|
104
|
+
messagingProfileId: yup__namespace.string().required(i18next.t("neetoIntegrations.telnyx.validations.messagingProfileIdRequired")),
|
|
105
|
+
phoneNumber: isPhoneNumberRequired ? yup__namespace.object().shape({
|
|
106
|
+
label: yup__namespace.string(),
|
|
107
|
+
value: yup__namespace.string()
|
|
108
|
+
}).nullable().required(i18next.t("neetoIntegrations.telnyx.validations.phoneNumberRequired")) : yup__namespace.mixed().nullable()
|
|
109
|
+
});
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
var useTelnyxForm = function useTelnyxForm(_ref) {
|
|
113
|
+
var integrable = _ref.integrable,
|
|
114
|
+
onConnect = _ref.onConnect;
|
|
115
|
+
var _useState = React.useState([]),
|
|
116
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
117
|
+
phoneNumbers = _useState2[0],
|
|
118
|
+
setPhoneNumbers = _useState2[1];
|
|
119
|
+
var _useFetchTelnyxSmsCon = useFetchTelnyxSmsConfiguration({
|
|
120
|
+
integrable: integrable
|
|
121
|
+
}),
|
|
122
|
+
configuration = _useFetchTelnyxSmsCon.data,
|
|
123
|
+
isLoading = _useFetchTelnyxSmsCon.isLoading;
|
|
124
|
+
var _useFetchTelnyxPhoneN = useFetchTelnyxPhoneNumbers(),
|
|
125
|
+
fetchTelnyxPhoneNumbers = _useFetchTelnyxPhoneN.mutate,
|
|
126
|
+
isFetchPhoneNumbersLoading = _useFetchTelnyxPhoneN.isPending;
|
|
127
|
+
var _useCreateTelnyxSmsCo = useCreateTelnyxSmsConfiguration({
|
|
128
|
+
integrable: integrable
|
|
129
|
+
}),
|
|
130
|
+
createTelnyxSmsConfiguration = _useCreateTelnyxSmsCo.mutate,
|
|
131
|
+
isCreateSmsConfigurationLoading = _useCreateTelnyxSmsCo.isPending;
|
|
132
|
+
var handleSubmit = function handleSubmit(values) {
|
|
133
|
+
if (ramda.isEmpty(phoneNumbers)) {
|
|
134
|
+
var params = {
|
|
135
|
+
apiKey: values.apiKey,
|
|
136
|
+
messagingProfileId: values.messagingProfileId
|
|
137
|
+
};
|
|
138
|
+
fetchTelnyxPhoneNumbers(params, {
|
|
139
|
+
onSuccess: function onSuccess(_ref2) {
|
|
140
|
+
var phoneNumbers = _ref2.phoneNumbers;
|
|
141
|
+
return setPhoneNumbers(phoneNumbers);
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
var payload = {
|
|
147
|
+
apiKey: values.apiKey,
|
|
148
|
+
messagingProfileId: values.messagingProfileId,
|
|
149
|
+
phoneNumberId: values.phoneNumber.value
|
|
150
|
+
};
|
|
151
|
+
createTelnyxSmsConfiguration(payload, {
|
|
152
|
+
onSuccess: onConnect
|
|
153
|
+
});
|
|
154
|
+
};
|
|
155
|
+
var isSubmitting = isFetchPhoneNumbersLoading || isCreateSmsConfigurationLoading;
|
|
156
|
+
var phoneNumberOptions = buildPhoneNumberOptions(phoneNumbers);
|
|
157
|
+
var initialValues = {
|
|
158
|
+
apiKey: (configuration === null || configuration === void 0 ? void 0 : configuration.apiKey) || "",
|
|
159
|
+
messagingProfileId: (configuration === null || configuration === void 0 ? void 0 : configuration.messagingProfileId) || "",
|
|
160
|
+
phoneNumber: neetoCist.findBy({
|
|
161
|
+
label: configuration === null || configuration === void 0 ? void 0 : configuration.phoneNumber
|
|
162
|
+
}, phoneNumberOptions) || null
|
|
163
|
+
};
|
|
164
|
+
return {
|
|
165
|
+
initialValues: initialValues,
|
|
166
|
+
phoneNumberOptions: phoneNumberOptions,
|
|
167
|
+
isSubmitting: isSubmitting,
|
|
168
|
+
isLoading: isLoading,
|
|
169
|
+
handleSubmit: handleSubmit
|
|
170
|
+
};
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
var Telnyx = function Telnyx(_ref) {
|
|
174
|
+
var _ref$integrable = _ref.integrable,
|
|
175
|
+
integrable = _ref$integrable === void 0 ? null : _ref$integrable,
|
|
176
|
+
_ref$onClose = _ref.onClose,
|
|
177
|
+
onClose = _ref$onClose === void 0 ? neetoCist.noop : _ref$onClose,
|
|
178
|
+
_ref$onConnect = _ref.onConnect,
|
|
179
|
+
onConnect = _ref$onConnect === void 0 ? neetoCist.noop : _ref$onConnect;
|
|
180
|
+
var formRef = React.useRef(null);
|
|
181
|
+
var _useTranslation = reactI18next.useTranslation(),
|
|
182
|
+
t = _useTranslation.t;
|
|
183
|
+
var _useTelnyxForm = useTelnyxForm({
|
|
184
|
+
integrable: integrable,
|
|
185
|
+
onConnect: onConnect
|
|
186
|
+
}),
|
|
187
|
+
initialValues = _useTelnyxForm.initialValues,
|
|
188
|
+
handleSubmit = _useTelnyxForm.handleSubmit,
|
|
189
|
+
phoneNumberOptions = _useTelnyxForm.phoneNumberOptions,
|
|
190
|
+
isSubmitting = _useTelnyxForm.isSubmitting,
|
|
191
|
+
isLoading = _useTelnyxForm.isLoading;
|
|
192
|
+
var isPhoneNumberRequired = neetoCist.isNotEmpty(phoneNumberOptions);
|
|
193
|
+
var submitButtonLabel = neetoCist.isNotEmpty(phoneNumberOptions) ? t("neetoIntegrations.common.saveChanges") : t("neetoIntegrations.common.verify");
|
|
194
|
+
if (isLoading) return /*#__PURE__*/jsxRuntime.jsx(PageLoader, {});
|
|
195
|
+
return /*#__PURE__*/jsxRuntime.jsx(Form, {
|
|
196
|
+
className: "w-full",
|
|
197
|
+
formikProps: {
|
|
198
|
+
enableReinitialize: true,
|
|
199
|
+
initialValues: initialValues,
|
|
200
|
+
validationSchema: buildTelnyxConfigurationValidationSchema(isPhoneNumberRequired),
|
|
201
|
+
innerRef: formRef,
|
|
202
|
+
onSubmit: handleSubmit
|
|
203
|
+
},
|
|
204
|
+
children: function children(_ref2) {
|
|
205
|
+
var dirty = _ref2.dirty;
|
|
206
|
+
return /*#__PURE__*/jsxRuntime.jsx(CardLayout, {
|
|
207
|
+
actionBlock: /*#__PURE__*/jsxRuntime.jsx(ActionBlock, {
|
|
208
|
+
isSubmitting: isSubmitting,
|
|
209
|
+
cancelButtonProps: {
|
|
210
|
+
onClick: onClose
|
|
211
|
+
},
|
|
212
|
+
submitButtonProps: {
|
|
213
|
+
label: submitButtonLabel,
|
|
214
|
+
// The button is disabled if phoneNumberOptions is empty and there is no apiKey in initialValues while the form is not dirty.
|
|
215
|
+
// If phoneNumberOptions is not empty, the button is disabled when the form is unchanged.
|
|
216
|
+
disabled: ramda.isEmpty(phoneNumberOptions) ? !initialValues.apiKey && !dirty : !dirty
|
|
217
|
+
}
|
|
218
|
+
}),
|
|
219
|
+
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
220
|
+
className: "space-y-4",
|
|
221
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Input, {
|
|
222
|
+
label: t("neetoIntegrations.telnyx.apiKey"),
|
|
223
|
+
name: "apiKey"
|
|
224
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Input, {
|
|
225
|
+
label: t("neetoIntegrations.telnyx.messagingProfileId"),
|
|
226
|
+
name: "messagingProfileId"
|
|
227
|
+
}), neetoCist.isNotEmpty(phoneNumberOptions) && /*#__PURE__*/jsxRuntime.jsx(Select, {
|
|
228
|
+
label: t("neetoIntegrations.telnyx.phoneNumber"),
|
|
229
|
+
name: "phoneNumber",
|
|
230
|
+
options: phoneNumberOptions
|
|
231
|
+
})]
|
|
232
|
+
})
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
});
|
|
236
|
+
};
|
|
237
|
+
|
|
238
|
+
module.exports = Telnyx;
|
|
239
|
+
//# sourceMappingURL=Telnyx.js.map
|