@bigbinary/neeto-integrations-frontend 4.0.31 → 4.0.33

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.
Files changed (67) hide show
  1. package/app/javascript/src/translations/en.json +23 -2
  2. package/dist/.ready +1 -1
  3. package/dist/Daily.js +2 -2
  4. package/dist/DailyForm.js +2 -2
  5. package/dist/Manage.js +4 -1
  6. package/dist/Manage.js.map +1 -1
  7. package/dist/Telnyx.js +2 -2
  8. package/dist/Twilio.js +200 -68
  9. package/dist/Twilio.js.map +1 -1
  10. package/dist/Zoom.js +2 -2
  11. package/dist/cjs/Daily.js +2 -2
  12. package/dist/cjs/DailyForm.js +2 -2
  13. package/dist/cjs/Manage.js +4 -1
  14. package/dist/cjs/Manage.js.map +1 -1
  15. package/dist/cjs/Telnyx.js +2 -2
  16. package/dist/cjs/Twilio.js +199 -67
  17. package/dist/cjs/Twilio.js.map +1 -1
  18. package/dist/cjs/Zoom.js +2 -2
  19. package/dist/cjs/index.js +15 -15
  20. package/dist/cjs/index.js.map +1 -1
  21. package/dist/cjs/v2/Daily.js +2 -2
  22. package/dist/cjs/v2/DailyForm.js +2 -2
  23. package/dist/cjs/v2/DisconnectedIntegrationsRibbon.js +2 -2
  24. package/dist/cjs/v2/Telnyx.js +2 -2
  25. package/dist/cjs/v2/Twilio.js +199 -67
  26. package/dist/cjs/v2/Twilio.js.map +1 -1
  27. package/dist/cjs/v2/Zoom.js +2 -2
  28. package/dist/cjs/v2/index.js +6 -6
  29. package/dist/index.js +14 -14
  30. package/dist/index.js.map +1 -1
  31. package/dist/{query-CySi2Ki7.js → query-BF3HFRA7.js} +2 -2
  32. package/dist/query-BF3HFRA7.js.map +1 -0
  33. package/dist/{query-B3RhGrNb.js → query-gurbhBqu.js} +2 -2
  34. package/dist/query-gurbhBqu.js.map +1 -0
  35. package/dist/{useDailiesApi-BjcmweuZ.js → useDailiesApi-CEJPknLb.js} +2 -2
  36. package/dist/{useDailiesApi-BjcmweuZ.js.map → useDailiesApi-CEJPknLb.js.map} +1 -1
  37. package/dist/{useDailiesApi-C78LSYFo.js → useDailiesApi-aQmuxf-5.js} +2 -2
  38. package/dist/{useDailiesApi-C78LSYFo.js.map → useDailiesApi-aQmuxf-5.js.map} +1 -1
  39. package/dist/{useDisconnectionAlertsApi-BnfMKA7s.js → useDisconnectionAlertsApi-BOc2pEP_.js} +2 -2
  40. package/dist/{useDisconnectionAlertsApi-BnfMKA7s.js.map → useDisconnectionAlertsApi-BOc2pEP_.js.map} +1 -1
  41. package/dist/{useDisconnectionAlertsApi-C8Q2wbVl.js → useDisconnectionAlertsApi-CWMlpOJD.js} +2 -2
  42. package/dist/{useDisconnectionAlertsApi-C8Q2wbVl.js.map → useDisconnectionAlertsApi-CWMlpOJD.js.map} +1 -1
  43. package/dist/{useTelnyxApi-DnNSPd-d.js → useTelnyxApi-Cv5cIiuo.js} +2 -2
  44. package/dist/{useTelnyxApi-DnNSPd-d.js.map → useTelnyxApi-Cv5cIiuo.js.map} +1 -1
  45. package/dist/{useTelnyxApi-DDTzGMgk.js → useTelnyxApi-DS3IVijP.js} +2 -2
  46. package/dist/{useTelnyxApi-DDTzGMgk.js.map → useTelnyxApi-DS3IVijP.js.map} +1 -1
  47. package/dist/{useTwilioApi-D5HpIaB2.js → useTwilioApi-C57UuOda.js} +20 -12
  48. package/dist/useTwilioApi-C57UuOda.js.map +1 -0
  49. package/dist/{useTwilioApi-DPyyUWOs.js → useTwilioApi-CUL0-Xgf.js} +20 -12
  50. package/dist/useTwilioApi-CUL0-Xgf.js.map +1 -0
  51. package/dist/{useZoomApi-B127NAGl.js → useZoomApi-C8AUYMlp.js} +2 -2
  52. package/dist/{useZoomApi-B127NAGl.js.map → useZoomApi-C8AUYMlp.js.map} +1 -1
  53. package/dist/{useZoomApi-CazQYmYH.js → useZoomApi-CkhVE1e8.js} +2 -2
  54. package/dist/{useZoomApi-CazQYmYH.js.map → useZoomApi-CkhVE1e8.js.map} +1 -1
  55. package/dist/v2/Daily.js +2 -2
  56. package/dist/v2/DailyForm.js +2 -2
  57. package/dist/v2/DisconnectedIntegrationsRibbon.js +2 -2
  58. package/dist/v2/Telnyx.js +2 -2
  59. package/dist/v2/Twilio.js +200 -68
  60. package/dist/v2/Twilio.js.map +1 -1
  61. package/dist/v2/Zoom.js +2 -2
  62. package/dist/v2/index.js +6 -6
  63. package/package.json +14 -14
  64. package/dist/query-B3RhGrNb.js.map +0 -1
  65. package/dist/query-CySi2Ki7.js.map +0 -1
  66. package/dist/useTwilioApi-D5HpIaB2.js.map +0 -1
  67. package/dist/useTwilioApi-DPyyUWOs.js.map +0 -1
@@ -65,14 +65,35 @@
65
65
  "twilio": {
66
66
  "sid": "SID",
67
67
  "authToken": "Auth token",
68
+ "smsSendingMethod": {
69
+ "title": "SMS sending method",
70
+ "subtitle": "Choose how SMS messages should be sent via Twilio."
71
+ },
72
+ "connectionType": {
73
+ "phoneNumber": {
74
+ "label": "Twilio phone number",
75
+ "description": "Send SMS using a single Twilio phone number. Best for simple setups with one phone number and when your clients are primarily in one region."
76
+ },
77
+ "messagingService": {
78
+ "label": "Twilio messaging service",
79
+ "description": "Send SMS using a Twilio messaging service. Best for businesses that need multiple numbers operating in multiple countries or regions and want to improve deliverability and scale.",
80
+ "recommendedBadge": "Recommended"
81
+ }
82
+ },
83
+ "messagingService": {
84
+ "label": "Twilio messaging service",
85
+ "placeholder": "Select a messaging service..."
86
+ },
68
87
  "validations": {
69
88
  "sidReq": "SID is required",
70
89
  "authTokenReq": "Auth token is required",
71
- "phNumReq": "Phone number is required"
90
+ "phNumReq": "Phone number is required",
91
+ "messagingServiceReq": "Messaging service is required"
72
92
  },
73
93
  "smsConfiguration": {
74
94
  "invalidCredentials": "Twilio credentials are invalid",
75
- "invalidPhoneNumberConfig": "Twilio phone number is invalid"
95
+ "invalidPhoneNumberConfig": "Twilio phone number is invalid",
96
+ "invalidMessagingServiceConfig": "Twilio messaging service is invalid"
76
97
  }
77
98
  },
78
99
  "telnyx": {
package/dist/.ready CHANGED
@@ -1 +1 @@
1
- Built at 2026-05-05T12:29:51.162Z
1
+ Built at 2026-05-20T12:43:34.971Z
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 } from './useDailiesApi-C78LSYFo.js';
4
+ import { u as useFetchDaily, a as useDestroyDaily } from './useDailiesApi-aQmuxf-5.js';
5
5
  import Form from './DailyForm.js';
6
6
  import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
7
7
  import { useState } from 'react';
@@ -16,7 +16,7 @@ import '@babel/runtime/helpers/defineProperty';
16
16
  import '@tanstack/react-query';
17
17
  import '@bigbinary/neeto-commons-frontend/constants';
18
18
  import 'axios';
19
- import './query-B3RhGrNb.js';
19
+ import './query-gurbhBqu.js';
20
20
  import '@bigbinary/neeto-molecules/CardLayout';
21
21
  import '@bigbinary/neeto-molecules/Container';
22
22
  import '@bigbinary/neeto-molecules/Header';
package/dist/DailyForm.js CHANGED
@@ -14,7 +14,7 @@ import ActionBlock from '@bigbinary/neetoui/formik/ActionBlock';
14
14
  import { useTranslation, Trans } from 'react-i18next';
15
15
  import { useHistory } from 'react-router-dom';
16
16
  import WalkthroughModal from './WalkthroughModal.js';
17
- import { b as useCreateDaily } from './useDailiesApi-C78LSYFo.js';
17
+ import { b as useCreateDaily } from './useDailiesApi-aQmuxf-5.js';
18
18
  import * as yup from 'yup';
19
19
  import { jsx, jsxs } from 'react/jsx-runtime';
20
20
  import '@bigbinary/neeto-cist';
@@ -24,7 +24,7 @@ import '@babel/runtime/helpers/defineProperty';
24
24
  import '@tanstack/react-query';
25
25
  import '@bigbinary/neeto-commons-frontend/constants';
26
26
  import 'axios';
27
- import './query-B3RhGrNb.js';
27
+ import './query-gurbhBqu.js';
28
28
 
29
29
  var MANAGE_DAILY_CO_FORM_INITIAL_VALUES = {
30
30
  apiKey: ""
package/dist/Manage.js CHANGED
@@ -48,7 +48,10 @@ var Description = function Description(_ref) {
48
48
  children: description
49
49
  });
50
50
  }
51
- return description;
51
+ return /*#__PURE__*/jsx("div", {
52
+ className: "neeto-ui-text-body1 neeto-ui-text-gray-800 wrap-break-word",
53
+ children: description
54
+ });
52
55
  };
53
56
 
54
57
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
@@ -1 +1 @@
1
- {"version":3,"file":"Manage.js","sources":["../node_modules/rollup-plugin-styles/dist/runtime/inject-css.js","../app/javascript/src/components/commons/Description.jsx","../app/javascript/src/components/commons/Manage.jsx"],"sourcesContent":["var e=[],t=[];function n(n,r){if(n&&\"undefined\"!=typeof document){var a,s=!0===r.prepend?\"prepend\":\"append\",d=!0===r.singleTag,i=\"string\"==typeof r.container?document.querySelector(r.container):document.getElementsByTagName(\"head\")[0];if(d){var u=e.indexOf(i);-1===u&&(u=e.push(i)-1,t[u]={}),a=t[u]&&t[u][s]?t[u][s]:t[u][s]=c()}else a=c();65279===n.charCodeAt(0)&&(n=n.substring(1)),a.styleSheet?a.styleSheet.cssText+=n:a.appendChild(document.createTextNode(n))}function c(){var e=document.createElement(\"style\");if(e.setAttribute(\"type\",\"text/css\"),r.attributes)for(var t=Object.keys(r.attributes),n=0;n<t.length;n++)e.setAttribute(t[n],r.attributes[t[n]]);var a=\"prepend\"===s?\"afterbegin\":\"beforeend\";return i.insertAdjacentElement(a,e),e}}export{n as default};\n","import { Typography } from \"neetoui\";\n\nconst Description = ({ description }) => {\n if (typeof description === \"string\") {\n return (\n <Typography\n className=\"neeto-ui-text-gray-800 wrap-break-word\"\n style=\"body1\"\n weight=\"normal\"\n >\n {description}\n </Typography>\n );\n }\n\n return description;\n};\n\nexport default Description;\n","import { humanize, isNotEmpty, noop } from \"neetocist\";\nimport { withT } from \"neetocommons/react-utils\";\nimport { Check, ExternalLink } from \"neetoicons\";\nimport { Button, Callout, Tooltip, Typography } from \"neetoui\";\n\nimport DisconnectAlert from \"components/DisconnectAlert\";\n// eslint-disable-next-line import/extensions\nimport \"src/stylesheets/main.css\";\n\nimport Description from \"./Description\";\n\nconst Manage = withT(\n ({\n t,\n title = \"\",\n description = \"\",\n integration = \"\",\n isDisconnectAlertOpen = false,\n setIsDisconnectAlertOpen = noop,\n isDisconnecting = false,\n onConnect = undefined,\n onDisconnect = undefined,\n onClose = noop,\n Icon = null,\n isConnected = false,\n connectPath = \"\",\n connectUrl = \"\",\n helpDocUrl = \"\",\n managePath = \"\",\n manageUrl = \"\",\n integrationName = \"\",\n disconnectMessage = \"\",\n disconnectTitle = \"\",\n isConnectDisabled = false,\n connectTooltipProps = null,\n buttonProps = {},\n secondaryButtonProps = {},\n calloutProps = {},\n }) => (\n <>\n <div className=\"mx-auto w-full max-w-3xl\">\n <div className=\"neeto-ui-border-gray-300 neeto-ui-rounded-lg neeto-integrations__manage my-6 w-full border\">\n <div className=\"space-y-4 md:p-8 p-6\">\n <div className=\"flex md:flex-row flex-col items-start gap-6\">\n {Icon && (\n <div className=\"neeto-ui-rounded-lg neeto-ui-shadow-xs neeto-ui-border-gray-200 mt-0.5 flex shrink-0 items-center justify-center border p-2\">\n <Icon className=\"neeto-ui-text-gray-600\" size={44} />\n </div>\n )}\n <div className=\"flex min-w-0 flex-1 flex-col gap-6\">\n <div className=\"flex flex-col gap-2\">\n <div className=\"flex items-center space-x-3\">\n <Typography\n className=\"neeto-ui-text-gray-800 mb-0.5\"\n style=\"h2\"\n weight=\"semibold\"\n >\n {title}\n </Typography>\n {isConnected && (\n <div className=\"neeto-ui-bg-success-500 neeto-ui-text-white neeto-ui-rounded-full flex items-center justify-center p-1\">\n <Check size={20} />\n </div>\n )}\n </div>\n <div className=\"flex flex-col gap-2\">\n <Description {...{ description }} />\n {helpDocUrl && (\n <Button\n className=\"underline [--neeto-ui-btn-gap:0.25rem]\"\n data-testid=\"help-doc-link\"\n href={helpDocUrl}\n icon={ExternalLink}\n style=\"link\"\n target=\"_blank\"\n label={t(\"neetoIntegrations.common.learnMore\", {\n integration: integrationName || humanize(integration),\n })}\n />\n )}\n {isNotEmpty(calloutProps) && <Callout {...calloutProps} />}\n </div>\n </div>\n {isConnected ? (\n <div className=\"w-full flex gap-2\">\n {(managePath || manageUrl) && (\n <Button\n data-testid=\"manage-button\"\n href={manageUrl}\n target={manageUrl ? \"_blank\" : \"_self\"}\n to={managePath}\n label={t(\"neetoIntegrations.common.manageIntegration\", {\n integration: integrationName || humanize(integration),\n })}\n {...buttonProps}\n />\n )}\n {onDisconnect && (\n <Button\n data-testid=\"disconnect-button\"\n style=\"secondary\"\n label={t(\n \"neetoIntegrations.common.disconnectIntegration\",\n {\n integration:\n integrationName || humanize(integration),\n }\n )}\n onClick={() => setIsDisconnectAlertOpen(true)}\n {...secondaryButtonProps}\n />\n )}\n </div>\n ) : (\n <Tooltip\n disabled={!isConnectDisabled}\n {...connectTooltipProps}\n >\n {(connectPath || connectUrl || onConnect) && (\n <div className=\"w-full\">\n <Button\n data-testid=\"connect-button\"\n disabled={isConnectDisabled}\n href={connectUrl}\n to={connectPath}\n label={t(\n \"neetoIntegrations.common.connectIntegration\",\n {\n integration:\n integrationName || humanize(integration),\n }\n )}\n onClick={onConnect}\n {...buttonProps}\n />\n </div>\n )}\n </Tooltip>\n )}\n </div>\n </div>\n </div>\n </div>\n </div>\n <DisconnectAlert\n {...{ isDisconnecting, onClose, onDisconnect }}\n isOpen={isDisconnectAlertOpen}\n message={\n disconnectMessage ||\n t(`adminPanel.integrations.${integration}.disconnect.message`)\n }\n title={\n disconnectTitle ||\n t(`adminPanel.integrations.${integration}.disconnect.title`)\n }\n />\n </>\n )\n);\n\nexport default Manage;\n"],"names":["e","t","n","r","document","a","s","prepend","d","singleTag","i","container","querySelector","getElementsByTagName","u","indexOf","push","c","charCodeAt","substring","styleSheet","cssText","appendChild","createTextNode","createElement","setAttribute","attributes","Object","keys","length","insertAdjacentElement","Description","_ref","description","_jsx","Typography","className","style","weight","children","Manage","withT","_ref$title","title","_ref$description","_ref$integration","integration","_ref$isDisconnectAler","isDisconnectAlertOpen","_ref$setIsDisconnectA","setIsDisconnectAlertOpen","noop","_ref$isDisconnecting","isDisconnecting","_ref$onConnect","onConnect","undefined","_ref$onDisconnect","onDisconnect","_ref$onClose","onClose","_ref$Icon","Icon","_ref$isConnected","isConnected","_ref$connectPath","connectPath","_ref$connectUrl","connectUrl","_ref$helpDocUrl","helpDocUrl","_ref$managePath","managePath","_ref$manageUrl","manageUrl","_ref$integrationName","integrationName","_ref$disconnectMessag","disconnectMessage","_ref$disconnectTitle","disconnectTitle","_ref$isConnectDisable","isConnectDisabled","_ref$connectTooltipPr","connectTooltipProps","_ref$buttonProps","buttonProps","_ref$secondaryButtonP","secondaryButtonProps","_ref$calloutProps","calloutProps","_jsxs","_Fragment","size","Check","Button","href","icon","ExternalLink","target","label","humanize","isNotEmpty","Callout","_objectSpread","to","onClick","Tooltip","disabled","DisconnectAlert","isOpen","message","concat"],"mappings":";;;;;;;;;;;;;;;AAAA,IAAIA,CAAC,GAAC,EAAE;AAACC,EAAAA,CAAC,GAAC,EAAE;AAAC,SAASC,CAACA,CAACA,CAAC,EAACC,CAAC,EAAC;AAAC,EAAA,IAAGD,CAAC,IAAE,WAAW,IAAE,OAAOE,QAAQ,EAAC;AAAC,IAAA,IAAIC,CAAC;MAACC,CAAC,GAAC,IAAE,KAAGH,CAAC,CAACI,OAAO,GAAC,SAAS,GAAC,QAAQ;AAACC,MAAAA,CAAC,GAAC,IAAE,KAAGL,CAAC,CAACM,SAAS;MAACC,CAAC,GAAC,QAAQ,IAAE,OAAOP,CAAC,CAACQ,SAAS,GAACP,QAAQ,CAACQ,aAAa,CAACT,CAAC,CAACQ,SAAS,CAAC,GAACP,QAAQ,CA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AC5CoD,MAAAA,MAAM,EAAE9D,qBAAsB;MAC9B+D,OAAO,EACLjC,iBAAiB,IACjB7E,CAAC,4BAAA+G,MAAA,CAA4BlE,WAAW,EAAA,qBAAA,CAAqB,CAC9D;MACDH,KAAK,EACHqC,eAAe,IACf/E,CAAC,4BAAA+G,MAAA,CAA4BlE,WAAW,EAAA,mBAAA,CAAmB;AAC5D,KACF,CAAC;AAAA,GACF,CAAC;AAAA,CAEP;;;;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"Manage.js","sources":["../node_modules/rollup-plugin-styles/dist/runtime/inject-css.js","../app/javascript/src/components/commons/Description.jsx","../app/javascript/src/components/commons/Manage.jsx"],"sourcesContent":["var e=[],t=[];function n(n,r){if(n&&\"undefined\"!=typeof document){var a,s=!0===r.prepend?\"prepend\":\"append\",d=!0===r.singleTag,i=\"string\"==typeof r.container?document.querySelector(r.container):document.getElementsByTagName(\"head\")[0];if(d){var u=e.indexOf(i);-1===u&&(u=e.push(i)-1,t[u]={}),a=t[u]&&t[u][s]?t[u][s]:t[u][s]=c()}else a=c();65279===n.charCodeAt(0)&&(n=n.substring(1)),a.styleSheet?a.styleSheet.cssText+=n:a.appendChild(document.createTextNode(n))}function c(){var e=document.createElement(\"style\");if(e.setAttribute(\"type\",\"text/css\"),r.attributes)for(var t=Object.keys(r.attributes),n=0;n<t.length;n++)e.setAttribute(t[n],r.attributes[t[n]]);var a=\"prepend\"===s?\"afterbegin\":\"beforeend\";return i.insertAdjacentElement(a,e),e}}export{n as default};\n","import { Typography } from \"neetoui\";\n\nconst Description = ({ description }) => {\n if (typeof description === \"string\") {\n return (\n <Typography\n className=\"neeto-ui-text-gray-800 wrap-break-word\"\n style=\"body1\"\n weight=\"normal\"\n >\n {description}\n </Typography>\n );\n }\n\n return (\n <div className=\"neeto-ui-text-body1 neeto-ui-text-gray-800 wrap-break-word\">\n {description}\n </div>\n );\n};\n\nexport default Description;\n","import { humanize, isNotEmpty, noop } from \"neetocist\";\nimport { withT } from \"neetocommons/react-utils\";\nimport { Check, ExternalLink } from \"neetoicons\";\nimport { Button, Callout, Tooltip, Typography } from \"neetoui\";\n\nimport DisconnectAlert from \"components/DisconnectAlert\";\n// eslint-disable-next-line import/extensions\nimport \"src/stylesheets/main.css\";\n\nimport Description from \"./Description\";\n\nconst Manage = withT(\n ({\n t,\n title = \"\",\n description = \"\",\n integration = \"\",\n isDisconnectAlertOpen = false,\n setIsDisconnectAlertOpen = noop,\n isDisconnecting = false,\n onConnect = undefined,\n onDisconnect = undefined,\n onClose = noop,\n Icon = null,\n isConnected = false,\n connectPath = \"\",\n connectUrl = \"\",\n helpDocUrl = \"\",\n managePath = \"\",\n manageUrl = \"\",\n integrationName = \"\",\n disconnectMessage = \"\",\n disconnectTitle = \"\",\n isConnectDisabled = false,\n connectTooltipProps = null,\n buttonProps = {},\n secondaryButtonProps = {},\n calloutProps = {},\n }) => (\n <>\n <div className=\"mx-auto w-full max-w-3xl\">\n <div className=\"neeto-ui-border-gray-300 neeto-ui-rounded-lg neeto-integrations__manage my-6 w-full border\">\n <div className=\"space-y-4 md:p-8 p-6\">\n <div className=\"flex md:flex-row flex-col items-start gap-6\">\n {Icon && (\n <div className=\"neeto-ui-rounded-lg neeto-ui-shadow-xs neeto-ui-border-gray-200 mt-0.5 flex shrink-0 items-center justify-center border p-2\">\n <Icon className=\"neeto-ui-text-gray-600\" size={44} />\n </div>\n )}\n <div className=\"flex min-w-0 flex-1 flex-col gap-6\">\n <div className=\"flex flex-col gap-2\">\n <div className=\"flex items-center space-x-3\">\n <Typography\n className=\"neeto-ui-text-gray-800 mb-0.5\"\n style=\"h2\"\n weight=\"semibold\"\n >\n {title}\n </Typography>\n {isConnected && (\n <div className=\"neeto-ui-bg-success-500 neeto-ui-text-white neeto-ui-rounded-full flex items-center justify-center p-1\">\n <Check size={20} />\n </div>\n )}\n </div>\n <div className=\"flex flex-col gap-2\">\n <Description {...{ description }} />\n {helpDocUrl && (\n <Button\n className=\"underline [--neeto-ui-btn-gap:0.25rem]\"\n data-testid=\"help-doc-link\"\n href={helpDocUrl}\n icon={ExternalLink}\n style=\"link\"\n target=\"_blank\"\n label={t(\"neetoIntegrations.common.learnMore\", {\n integration: integrationName || humanize(integration),\n })}\n />\n )}\n {isNotEmpty(calloutProps) && <Callout {...calloutProps} />}\n </div>\n </div>\n {isConnected ? (\n <div className=\"w-full flex gap-2\">\n {(managePath || manageUrl) && (\n <Button\n data-testid=\"manage-button\"\n href={manageUrl}\n target={manageUrl ? \"_blank\" : \"_self\"}\n to={managePath}\n label={t(\"neetoIntegrations.common.manageIntegration\", {\n integration: integrationName || humanize(integration),\n })}\n {...buttonProps}\n />\n )}\n {onDisconnect && (\n <Button\n data-testid=\"disconnect-button\"\n style=\"secondary\"\n label={t(\n \"neetoIntegrations.common.disconnectIntegration\",\n {\n integration:\n integrationName || humanize(integration),\n }\n )}\n onClick={() => setIsDisconnectAlertOpen(true)}\n {...secondaryButtonProps}\n />\n )}\n </div>\n ) : (\n <Tooltip\n disabled={!isConnectDisabled}\n {...connectTooltipProps}\n >\n {(connectPath || connectUrl || onConnect) && (\n <div className=\"w-full\">\n <Button\n data-testid=\"connect-button\"\n disabled={isConnectDisabled}\n href={connectUrl}\n to={connectPath}\n label={t(\n \"neetoIntegrations.common.connectIntegration\",\n {\n integration:\n integrationName || humanize(integration),\n }\n )}\n onClick={onConnect}\n {...buttonProps}\n />\n </div>\n )}\n </Tooltip>\n )}\n </div>\n </div>\n </div>\n </div>\n </div>\n <DisconnectAlert\n {...{ isDisconnecting, onClose, onDisconnect }}\n isOpen={isDisconnectAlertOpen}\n message={\n disconnectMessage ||\n t(`adminPanel.integrations.${integration}.disconnect.message`)\n }\n title={\n disconnectTitle ||\n t(`adminPanel.integrations.${integration}.disconnect.title`)\n }\n />\n </>\n )\n);\n\nexport default Manage;\n"],"names":["e","t","n","r","document","a","s","prepend","d","singleTag","i","container","querySelector","getElementsByTagName","u","indexOf","push","c","charCodeAt","substring","styleSheet","cssText","appendChild","createTextNode","createElement","setAttribute","attributes","Object","keys","length","insertAdjacentElement","Description","_ref","description","_jsx","Typography","className","style","weight","children","Manage","withT","_ref$title","title","_ref$description","_ref$integration","integration","_ref$isDisconnectAler","isDisconnectAlertOpen","_ref$setIsDisconnectA","setIsDisconnectAlertOpen","noop","_ref$isDisconnecting","isDisconnecting","_ref$onConnect","onConnect","undefined","_ref$onDisconnect","onDisconnect","_ref$onClose","onClose","_ref$Icon","Icon","_ref$isConnected","isConnected","_ref$connectPath","connectPath","_ref$connectUrl","connectUrl","_ref$helpDocUrl","helpDocUrl","_ref$managePath","managePath","_ref$manageUrl","manageUrl","_ref$integrationName","integrationName","_ref$disconnectMessag","disconnectMessage","_ref$disconnectTitle","disconnectTitle","_ref$isConnectDisable","isConnectDisabled","_ref$connectTooltipPr","connectTooltipProps","_ref$buttonProps","buttonProps","_ref$secondaryButtonP","secondaryButtonProps","_ref$calloutProps","calloutProps","_jsxs","_Fragment","size","Check","Button","href","icon","ExternalLink","target","label","humanize","isNotEmpty","Callout","_objectSpread","to","onClick","Tooltip","disabled","DisconnectAlert","isOpen","message","concat"],"mappings":";;;;;;;;;;;;;;;AAAA,IAAIA,CAAC,GAAC,EAAE;AAACC,EAAAA,CAAC,GAAC,EAAE;AAAC,SAASC,CAACA,CAACA,CAAC,EAACC,CAAC,EAAC;AAAC,EAAA,IAAGD,CAAC,IAAE,WAAW,IAAE,OAAOE,QAAQ,EAAC;AAAC,IAAA,IAAIC,CAAC;MAACC,CAAC,GAAC,IAAE,KAAGH,CAAC,CAACI,OAAO,GAAC,SAAS,GAAC,QAAQ;AAACC,MAAAA,CAAC,GAAC,IAAE,KAAGL,CAAC,CAACM,SAAS;MAACC,CAAC,GAAC,QAAQ,IAAE,OAAOP,CAAC,CAACQ,SAAS,GAACP,QAAQ,CAACQ,aAAa,CAACT,CAAC,CAACQ,SAAS,CAAC,GAACP,QAAQ,CAACS,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AAAC,I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,OAAO;AAAEF,MAAAA,YAAY,EAAZA,YAAY;AAC5CoD,MAAAA,MAAM,EAAE9D,qBAAsB;MAC9B+D,OAAO,EACLjC,iBAAiB,IACjB7E,CAAC,4BAAA+G,MAAA,CAA4BlE,WAAW,EAAA,qBAAA,CAAqB,CAC9D;MACDH,KAAK,EACHqC,eAAe,IACf/E,CAAC,4BAAA+G,MAAA,CAA4BlE,WAAW,EAAA,mBAAA,CAAmB;AAC5D,KACF,CAAC;AAAA,GACF,CAAC;AAAA,CAEP;;;;","x_google_ignoreList":[0]}
package/dist/Telnyx.js CHANGED
@@ -9,14 +9,14 @@ import Select from '@bigbinary/neetoui/formik/Select';
9
9
  import { useTranslation } from 'react-i18next';
10
10
  import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
11
11
  import { isEmpty } from 'ramda';
12
- import { u as useFetchTelnyxSmsConfiguration, a as useFetchTelnyxPhoneNumbers, b as useCreateTelnyxSmsConfiguration } from './useTelnyxApi-DnNSPd-d.js';
12
+ import { u as useFetchTelnyxSmsConfiguration, a as useFetchTelnyxPhoneNumbers, b as useCreateTelnyxSmsConfiguration } from './useTelnyxApi-Cv5cIiuo.js';
13
13
  import { t } from 'i18next';
14
14
  import * as yup from 'yup';
15
15
  import { jsx, jsxs } from 'react/jsx-runtime';
16
16
  import '@tanstack/react-query';
17
17
  import '@bigbinary/neeto-commons-frontend/react-utils';
18
18
  import 'axios';
19
- import './query-B3RhGrNb.js';
19
+ import './query-gurbhBqu.js';
20
20
 
21
21
  var buildPhoneNumberOptions = function buildPhoneNumberOptions(phoneNumbers) {
22
22
  return phoneNumbers ? phoneNumbers.map(function (_ref) {
package/dist/Twilio.js CHANGED
@@ -1,5 +1,4 @@
1
- import _defineProperty from '@babel/runtime/helpers/defineProperty';
2
- import { useEffect, useRef } from 'react';
1
+ import { useRef } from 'react';
3
2
  import { noop, _findBy } from '@bigbinary/neeto-cist';
4
3
  import CardLayout from '@bigbinary/neeto-molecules/CardLayout';
5
4
  import ActionBlock from '@bigbinary/neetoui/formik/ActionBlock';
@@ -8,23 +7,72 @@ import { equals } from 'ramda';
8
7
  import { useTranslation } from 'react-i18next';
9
8
  import Input from '@bigbinary/neetoui/formik/Input';
10
9
  import Select from '@bigbinary/neetoui/formik/Select';
10
+ import Tag from '@bigbinary/neetoui/Tag';
11
11
  import { jsxs, jsx } from 'react/jsx-runtime';
12
+ import _defineProperty from '@babel/runtime/helpers/defineProperty';
12
13
  import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
13
14
  import { useStateWithDependency } from '@bigbinary/neeto-commons-frontend/react-utils';
14
- import { u as useFetchTwilioSmsConfiguration, a as useFetchTwilioPhoneNumbers, b as useCreateTwilioConfiguration } from './useTwilioApi-D5HpIaB2.js';
15
+ import { u as useFetchTwilioSmsConfiguration, a as useFetchTwilioSenderOptions, b as useCreateTwilioConfiguration } from './useTwilioApi-C57UuOda.js';
15
16
  import i18next from 'i18next';
16
17
  import * as yup from 'yup';
17
18
  import '@tanstack/react-query';
18
19
  import 'axios';
19
- import './query-B3RhGrNb.js';
20
+ import './query-gurbhBqu.js';
21
+
22
+ var CONNECTION_TYPES = {
23
+ PHONE_NUMBER: "phone_number",
24
+ MESSAGING_SERVICE: "messaging_service"
25
+ };
26
+
27
+ var ConnectionTypeCard = function ConnectionTypeCard(_ref) {
28
+ var value = _ref.value,
29
+ selected = _ref.selected,
30
+ title = _ref.title,
31
+ description = _ref.description,
32
+ _ref$recommended = _ref.recommended,
33
+ recommended = _ref$recommended === void 0 ? false : _ref$recommended,
34
+ onSelect = _ref.onSelect,
35
+ children = _ref.children;
36
+ var _useTranslation = useTranslation(),
37
+ t = _useTranslation.t;
38
+ var isSelected = selected === value;
39
+ var cardClass = "flex w-full cursor-pointer flex-col gap-y-2 neeto-ui-rounded border p-4 ".concat(isSelected ? "neeto-ui-border-success-500 neeto-ui-bg-success-100" : "neeto-ui-border-gray-200");
40
+ return /*#__PURE__*/jsxs("div", {
41
+ className: cardClass,
42
+ onClick: function onClick() {
43
+ return onSelect(value);
44
+ },
45
+ children: [/*#__PURE__*/jsxs("div", {
46
+ className: "flex items-center gap-x-2",
47
+ children: [/*#__PURE__*/jsx("input", {
48
+ value: value,
49
+ checked: isSelected,
50
+ name: "connectionType",
51
+ type: "radio",
52
+ onChange: function onChange() {
53
+ return onSelect(value);
54
+ },
55
+ onClick: function onClick(e) {
56
+ return e.stopPropagation();
57
+ }
58
+ }), /*#__PURE__*/jsx("div", {
59
+ className: "font-semibold",
60
+ children: title
61
+ }), recommended && /*#__PURE__*/jsx(Tag, {
62
+ style: "success",
63
+ label: t("neetoIntegrations.twilio.connectionType.messagingService.recommendedBadge")
64
+ })]
65
+ }), /*#__PURE__*/jsx("div", {
66
+ className: "text-sm neeto-ui-text-gray-600",
67
+ children: description
68
+ }), isSelected && children]
69
+ });
70
+ };
20
71
 
21
- function ownKeys$1(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
22
- function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
23
72
  var ConfigurationForm = function ConfigurationForm(_ref) {
24
- var _errors$twilioPhoneNu;
73
+ var _errors$twilioPhoneNu, _errors$twilioMessagi;
25
74
  var phoneNumberOptions = _ref.phoneNumberOptions,
26
- _ref$selectedPhoneNum = _ref.selectedPhoneNumber,
27
- selectedPhoneNumber = _ref$selectedPhoneNum === void 0 ? null : _ref$selectedPhoneNum,
75
+ messagingServiceOptions = _ref.messagingServiceOptions,
28
76
  _ref$initialFocusRef = _ref.initialFocusRef,
29
77
  initialFocusRef = _ref$initialFocusRef === void 0 ? null : _ref$initialFocusRef,
30
78
  _ref$isUsingOverlay = _ref.isUsingOverlay,
@@ -34,51 +82,88 @@ var ConfigurationForm = function ConfigurationForm(_ref) {
34
82
  var _useTranslation = useTranslation(),
35
83
  t = _useTranslation.t;
36
84
  var setFieldValue = formikProps.setFieldValue,
37
- setValues = formikProps.setValues,
38
- errors = formikProps.errors,
39
85
  values = formikProps.values,
40
- initialValues = formikProps.initialValues;
41
- useEffect(function () {
42
- selectedPhoneNumber && setFieldValue("twilioPhoneNumber", selectedPhoneNumber);
43
- }, [selectedPhoneNumber, initialValues]);
86
+ errors = formikProps.errors;
87
+ var handleConnectionTypeChange = function handleConnectionTypeChange(nextType) {
88
+ setFieldValue("connectionType", nextType);
89
+ if (nextType === CONNECTION_TYPES.PHONE_NUMBER) {
90
+ setFieldValue("twilioMessagingService", null);
91
+ } else {
92
+ setFieldValue("twilioPhoneNumber", null);
93
+ }
94
+ };
95
+ var senderOptionsAvailable = phoneNumberOptions !== null || messagingServiceOptions !== null;
44
96
  return /*#__PURE__*/jsxs("div", {
45
- className: "flex w-full flex-col gap-y-4",
46
- children: [/*#__PURE__*/jsx("div", {
47
- className: "flex w-full",
48
- children: /*#__PURE__*/jsx(Input, {
97
+ className: "flex w-full flex-col gap-y-6",
98
+ children: [/*#__PURE__*/jsxs("div", {
99
+ className: "flex w-full flex-col gap-y-4",
100
+ children: [/*#__PURE__*/jsx(Input, {
49
101
  required: true,
50
102
  autoFocus: !isUsingOverlay,
51
103
  "data-testid": "integrations-twilio-sid",
52
104
  label: t("neetoIntegrations.twilio.sid"),
53
105
  name: "twilioSid",
54
106
  ref: initialFocusRef
55
- })
56
- }), /*#__PURE__*/jsx("div", {
57
- className: "flex w-full",
58
- children: /*#__PURE__*/jsx(Input, {
107
+ }), /*#__PURE__*/jsx(Input, {
59
108
  required: true,
60
109
  "data-testid": "integrations-twilio-auth-token",
61
110
  label: t("neetoIntegrations.twilio.authToken"),
62
111
  name: "twilioAuthToken"
63
- })
64
- }), phoneNumberOptions && /*#__PURE__*/jsx("div", {
65
- className: "flex w-full",
66
- children: /*#__PURE__*/jsx(Select, {
67
- error: (_errors$twilioPhoneNu = errors.twilioPhoneNumber) === null || _errors$twilioPhoneNu === void 0 ? void 0 : _errors$twilioPhoneNu.value,
68
- label: t("neetoIntegrations.common.phNo"),
69
- name: "twilioPhoneNumber",
70
- options: phoneNumberOptions,
71
- size: "large",
72
- onChange: function onChange(selected) {
73
- return setValues(_objectSpread$1(_objectSpread$1({}, values), {}, {
74
- twilioPhoneNumber: selected
75
- }));
76
- }
77
- })
112
+ })]
113
+ }), senderOptionsAvailable && /*#__PURE__*/jsxs("div", {
114
+ className: "flex w-full flex-col gap-y-4",
115
+ children: [/*#__PURE__*/jsxs("div", {
116
+ children: [/*#__PURE__*/jsx("div", {
117
+ className: "font-semibold",
118
+ children: t("neetoIntegrations.twilio.smsSendingMethod.title")
119
+ }), /*#__PURE__*/jsx("div", {
120
+ className: "text-sm neeto-ui-text-gray-600",
121
+ children: t("neetoIntegrations.twilio.smsSendingMethod.subtitle")
122
+ })]
123
+ }), /*#__PURE__*/jsxs("div", {
124
+ className: "flex w-full flex-col gap-y-3",
125
+ children: [/*#__PURE__*/jsx(ConnectionTypeCard, {
126
+ selected: values.connectionType,
127
+ value: CONNECTION_TYPES.PHONE_NUMBER,
128
+ description: t("neetoIntegrations.twilio.connectionType.phoneNumber.description"),
129
+ title: t("neetoIntegrations.twilio.connectionType.phoneNumber.label"),
130
+ onSelect: handleConnectionTypeChange,
131
+ children: /*#__PURE__*/jsx(Select, {
132
+ error: (_errors$twilioPhoneNu = errors.twilioPhoneNumber) === null || _errors$twilioPhoneNu === void 0 ? void 0 : _errors$twilioPhoneNu.value,
133
+ label: t("neetoIntegrations.common.phNo"),
134
+ name: "twilioPhoneNumber",
135
+ options: phoneNumberOptions !== null && phoneNumberOptions !== void 0 ? phoneNumberOptions : [],
136
+ size: "large",
137
+ onChange: function onChange(selected) {
138
+ return setFieldValue("twilioPhoneNumber", selected);
139
+ }
140
+ })
141
+ }), /*#__PURE__*/jsx(ConnectionTypeCard, {
142
+ recommended: true,
143
+ selected: values.connectionType,
144
+ value: CONNECTION_TYPES.MESSAGING_SERVICE,
145
+ description: t("neetoIntegrations.twilio.connectionType.messagingService.description"),
146
+ title: t("neetoIntegrations.twilio.connectionType.messagingService.label"),
147
+ onSelect: handleConnectionTypeChange,
148
+ children: /*#__PURE__*/jsx(Select, {
149
+ error: (_errors$twilioMessagi = errors.twilioMessagingService) === null || _errors$twilioMessagi === void 0 ? void 0 : _errors$twilioMessagi.value,
150
+ label: t("neetoIntegrations.twilio.messagingService.label"),
151
+ name: "twilioMessagingService",
152
+ options: messagingServiceOptions !== null && messagingServiceOptions !== void 0 ? messagingServiceOptions : [],
153
+ size: "large",
154
+ placeholder: t("neetoIntegrations.twilio.messagingService.placeholder"),
155
+ onChange: function onChange(selected) {
156
+ return setFieldValue("twilioMessagingService", selected);
157
+ }
158
+ })
159
+ })]
160
+ })]
78
161
  })]
79
162
  });
80
163
  };
81
164
 
165
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
166
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
82
167
  var useTwilio = function useTwilio(_ref) {
83
168
  var _ref$onConnect = _ref.onConnect,
84
169
  onConnect = _ref$onConnect === void 0 ? noop : _ref$onConnect,
@@ -96,28 +181,37 @@ var useTwilio = function useTwilio(_ref) {
96
181
  _useStateWithDependen2 = _slicedToArray(_useStateWithDependen, 2),
97
182
  credentials = _useStateWithDependen2[0],
98
183
  setCredentials = _useStateWithDependen2[1];
99
- var _useFetchTwilioPhoneN = useFetchTwilioPhoneNumbers({
184
+ var _useFetchTwilioSender = useFetchTwilioSenderOptions({
100
185
  credentials: credentials,
101
186
  formRef: formRef
102
187
  }),
103
- phoneNumbers = _useFetchTwilioPhoneN.data,
104
- isPhoneNumbersLoading = _useFetchTwilioPhoneN.isLoading;
188
+ senderOptions = _useFetchTwilioSender.data,
189
+ isSenderOptionsLoading = _useFetchTwilioSender.isLoading;
190
+ var phoneNumbers = senderOptions === null || senderOptions === void 0 ? void 0 : senderOptions.phoneNumbers;
191
+ var messagingServices = senderOptions === null || senderOptions === void 0 ? void 0 : senderOptions.messagingServices;
105
192
  var _useCreateTwilioConfi = useCreateTwilioConfiguration({
106
193
  integrable: integrable
107
194
  }),
108
195
  saveConfiguration = _useCreateTwilioConfi.mutate,
109
196
  isSubmitting = _useCreateTwilioConfi.isPending;
110
197
  var handleSubmit = function handleSubmit(values) {
111
- var _values$twilioPhoneNu;
112
- var payload = {
198
+ var _values$twilioMessagi, _values$twilioMessagi2, _values$twilioPhoneNu;
199
+ var credentialsPayload = {
113
200
  twilio_sid: values.twilioSid,
114
- twilio_auth_token: values.twilioAuthToken,
115
- twilio_phone_number_sid: (_values$twilioPhoneNu = values.twilioPhoneNumber) === null || _values$twilioPhoneNu === void 0 ? void 0 : _values$twilioPhoneNu.value
201
+ twilio_auth_token: values.twilioAuthToken
116
202
  };
117
- if (!phoneNumbers && !(configuration !== null && configuration !== void 0 && configuration.twilioPhoneNumber)) {
118
- setCredentials(payload);
203
+ if (!senderOptions && !(configuration !== null && configuration !== void 0 && configuration.connectionType)) {
204
+ setCredentials(credentialsPayload);
119
205
  return;
120
206
  }
207
+ var payload = values.connectionType === CONNECTION_TYPES.MESSAGING_SERVICE ? _objectSpread(_objectSpread({}, credentialsPayload), {}, {
208
+ connection_type: CONNECTION_TYPES.MESSAGING_SERVICE,
209
+ twilio_messaging_service_sid: (_values$twilioMessagi = values.twilioMessagingService) === null || _values$twilioMessagi === void 0 ? void 0 : _values$twilioMessagi.value,
210
+ twilio_messaging_service_friendly_name: (_values$twilioMessagi2 = values.twilioMessagingService) === null || _values$twilioMessagi2 === void 0 ? void 0 : _values$twilioMessagi2.label
211
+ }) : _objectSpread(_objectSpread({}, credentialsPayload), {}, {
212
+ connection_type: CONNECTION_TYPES.PHONE_NUMBER,
213
+ twilio_phone_number_sid: (_values$twilioPhoneNu = values.twilioPhoneNumber) === null || _values$twilioPhoneNu === void 0 ? void 0 : _values$twilioPhoneNu.value
214
+ });
121
215
  saveConfiguration(payload, {
122
216
  onSuccess: onConnect
123
217
  });
@@ -125,37 +219,64 @@ var useTwilio = function useTwilio(_ref) {
125
219
  return {
126
220
  handleSubmit: handleSubmit,
127
221
  phoneNumbers: phoneNumbers,
222
+ messagingServices: messagingServices,
128
223
  isConfigurationLoading: isConfigurationLoading,
129
- isPhoneNumbersLoading: isPhoneNumbersLoading,
224
+ isSenderOptionsLoading: isSenderOptionsLoading,
130
225
  isSubmitting: isSubmitting,
131
226
  configuration: configuration
132
227
  };
133
228
  };
134
229
 
135
- var buildTwilioConfigurationValidationSchema = function buildTwilioConfigurationValidationSchema(isTwilioPhoneRequired) {
230
+ var buildTwilioConfigurationValidationSchema = function buildTwilioConfigurationValidationSchema() {
136
231
  return yup.object().shape({
137
232
  twilioSid: yup.string().required(i18next.t("neetoIntegrations.twilio.validations.sidReq")),
138
233
  twilioAuthToken: yup.string().required(i18next.t("neetoIntegrations.twilio.validations.authTokenReq")),
139
- twilioPhoneNumber: isTwilioPhoneRequired ? yup.object().shape({
140
- label: yup.string(),
141
- value: yup.string().required(i18next.t("neetoIntegrations.twilio.validations.phNumReq"))
142
- }) : null
234
+ connectionType: yup.string().oneOf([CONNECTION_TYPES.PHONE_NUMBER, CONNECTION_TYPES.MESSAGING_SERVICE]).required(),
235
+ twilioPhoneNumber: yup.object().nullable().when("connectionType", {
236
+ is: CONNECTION_TYPES.PHONE_NUMBER,
237
+ then: function then(schema) {
238
+ return schema.shape({
239
+ label: yup.string(),
240
+ value: yup.string().required(i18next.t("neetoIntegrations.twilio.validations.phNumReq"))
241
+ });
242
+ }
243
+ }),
244
+ twilioMessagingService: yup.object().nullable().when("connectionType", {
245
+ is: CONNECTION_TYPES.MESSAGING_SERVICE,
246
+ then: function then(schema) {
247
+ return schema.shape({
248
+ label: yup.string(),
249
+ value: yup.string().required(i18next.t("neetoIntegrations.twilio.validations.messagingServiceReq"))
250
+ });
251
+ }
252
+ })
143
253
  });
144
254
  };
145
255
  var buildPhoneNumberOptions = function buildPhoneNumberOptions(phoneNumbers) {
146
- return phoneNumbers === null || phoneNumbers === void 0 ? void 0 : phoneNumbers.map(function (_ref) {
256
+ var _phoneNumbers$map;
257
+ return (_phoneNumbers$map = phoneNumbers === null || phoneNumbers === void 0 ? void 0 : phoneNumbers.map(function (_ref) {
147
258
  var phoneNumber = _ref.phoneNumber,
148
259
  sid = _ref.sid;
149
260
  return {
150
261
  label: phoneNumber,
151
262
  value: sid
152
263
  };
153
- });
264
+ })) !== null && _phoneNumbers$map !== void 0 ? _phoneNumbers$map : [];
265
+ };
266
+ var buildMessagingServiceOptions = function buildMessagingServiceOptions(messagingServices) {
267
+ var _messagingServices$ma;
268
+ return (_messagingServices$ma = messagingServices === null || messagingServices === void 0 ? void 0 : messagingServices.map(function (_ref2) {
269
+ var sid = _ref2.sid,
270
+ friendlyName = _ref2.friendlyName;
271
+ return {
272
+ label: friendlyName,
273
+ value: sid
274
+ };
275
+ })) !== null && _messagingServices$ma !== void 0 ? _messagingServices$ma : [];
154
276
  };
155
277
 
156
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
157
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
158
278
  var Twilio = function Twilio(_ref) {
279
+ var _configuration$twilio, _configuration$twilio2;
159
280
  var _ref$integrable = _ref.integrable,
160
281
  integrable = _ref$integrable === void 0 ? null : _ref$integrable,
161
282
  _ref$onClose = _ref.onClose,
@@ -173,26 +294,37 @@ var Twilio = function Twilio(_ref) {
173
294
  }),
174
295
  handleSubmit = _useTwilio.handleSubmit,
175
296
  phoneNumbers = _useTwilio.phoneNumbers,
297
+ messagingServices = _useTwilio.messagingServices,
176
298
  isConfigurationLoading = _useTwilio.isConfigurationLoading,
177
- isPhoneNumbersLoading = _useTwilio.isPhoneNumbersLoading,
299
+ isSenderOptionsLoading = _useTwilio.isSenderOptionsLoading,
178
300
  isSubmitting = _useTwilio.isSubmitting,
179
301
  configuration = _useTwilio.configuration;
180
302
  var phoneNumberOptions = buildPhoneNumberOptions(phoneNumbers);
303
+ var messagingServiceOptions = buildMessagingServiceOptions(messagingServices);
181
304
  var selectedPhoneNumber = _findBy({
182
305
  label: configuration === null || configuration === void 0 ? void 0 : configuration.twilioPhoneNumber
183
306
  }, phoneNumberOptions);
184
- var isLoading = isPhoneNumbersLoading || isConfigurationLoading;
307
+ var selectedMessagingService = _findBy({
308
+ value: configuration === null || configuration === void 0 ? void 0 : configuration.twilioMessagingServiceSid
309
+ }, messagingServiceOptions);
310
+ var initialValues = {
311
+ twilioSid: (_configuration$twilio = configuration === null || configuration === void 0 ? void 0 : configuration.twilioSid) !== null && _configuration$twilio !== void 0 ? _configuration$twilio : "",
312
+ twilioAuthToken: (_configuration$twilio2 = configuration === null || configuration === void 0 ? void 0 : configuration.twilioAuthToken) !== null && _configuration$twilio2 !== void 0 ? _configuration$twilio2 : "",
313
+ connectionType: (configuration === null || configuration === void 0 ? void 0 : configuration.connectionType) || CONNECTION_TYPES.PHONE_NUMBER,
314
+ twilioPhoneNumber: selectedPhoneNumber !== null && selectedPhoneNumber !== void 0 ? selectedPhoneNumber : null,
315
+ twilioMessagingService: selectedMessagingService !== null && selectedMessagingService !== void 0 ? selectedMessagingService : null
316
+ };
317
+ var senderOptionsAvailable = !!phoneNumbers || !!messagingServices;
318
+ var isLoading = isSenderOptionsLoading || isConfigurationLoading;
185
319
  var isSubmitDisabled = function isSubmitDisabled(values) {
186
- return equals(_objectSpread(_objectSpread({}, configuration), {}, {
187
- twilioPhoneNumber: selectedPhoneNumber
188
- }), values) || isLoading;
320
+ return equals(initialValues, values) || isLoading;
189
321
  };
190
322
  return /*#__PURE__*/jsx(Form, {
191
323
  className: "w-full",
192
324
  formikProps: {
193
325
  enableReinitialize: true,
194
- validationSchema: buildTwilioConfigurationValidationSchema(!!phoneNumbers),
195
- initialValues: configuration,
326
+ validationSchema: buildTwilioConfigurationValidationSchema(),
327
+ initialValues: initialValues,
196
328
  innerRef: formRef,
197
329
  onSubmit: handleSubmit
198
330
  },
@@ -204,16 +336,16 @@ var Twilio = function Twilio(_ref) {
204
336
  onClick: onClose
205
337
  },
206
338
  submitButtonProps: {
207
- label: phoneNumberOptions ? t("neetoIntegrations.common.saveChanges") : t("neetoIntegrations.common.verify"),
339
+ label: senderOptionsAvailable ? t("neetoIntegrations.common.saveChanges") : t("neetoIntegrations.common.verify"),
208
340
  disabled: isSubmitDisabled(formikProps.values) || isSubmitting,
209
- loading: isSubmitting || isPhoneNumbersLoading && !(configuration !== null && configuration !== void 0 && configuration.twilioAuthToken)
341
+ loading: isSubmitting || isSenderOptionsLoading && !(configuration !== null && configuration !== void 0 && configuration.twilioAuthToken)
210
342
  }
211
343
  }),
212
344
  children: /*#__PURE__*/jsx(ConfigurationForm, {
213
345
  formikProps: formikProps,
214
346
  initialFocusRef: initialFocusRef,
215
- phoneNumberOptions: phoneNumberOptions,
216
- selectedPhoneNumber: selectedPhoneNumber
347
+ messagingServiceOptions: senderOptionsAvailable ? messagingServiceOptions : null,
348
+ phoneNumberOptions: senderOptionsAvailable ? phoneNumberOptions : null
217
349
  })
218
350
  });
219
351
  }