@bigbinary/neeto-email-delivery-frontend 1.0.29 → 1.0.30
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/app/javascript/src/translations/de.json +18 -1
- package/dist/EmailDeliveryScreen.js +8 -10
- package/dist/EmailDeliveryScreen.js.map +1 -1
- package/dist/SparkpostDomainSetup.js +4 -4
- package/dist/SparkpostDomainSetup.js.map +1 -1
- package/dist/SparkpostDomainVerify.js +3 -3
- package/dist/SparkpostDomainVerify.js.map +1 -1
- package/dist/cjs/EmailDeliveryScreen.js +8 -10
- package/dist/cjs/EmailDeliveryScreen.js.map +1 -1
- package/dist/cjs/SparkpostDomainSetup.js +3 -3
- package/dist/cjs/SparkpostDomainSetup.js.map +1 -1
- package/dist/cjs/SparkpostDomainVerify.js +3 -3
- package/dist/cjs/SparkpostDomainVerify.js.map +1 -1
- package/dist/cjs/hooks.js +2 -2
- package/dist/cjs/index.js +25 -7
- package/dist/cjs/index.js.map +1 -1
- package/dist/constants-DPhFGbtO.js.map +1 -1
- package/dist/constants-DbB8UFcr.js.map +1 -1
- package/dist/hooks.js +2 -2
- package/dist/{index-C7KroEtv.js → index-53D1H-cp.js} +6 -29
- package/dist/index-53D1H-cp.js.map +1 -0
- package/dist/{index-BKKcEEt1.js → index-DmRq-yH1.js} +6 -29
- package/dist/index-DmRq-yH1.js.map +1 -0
- package/dist/index.js +26 -8
- package/dist/index.js.map +1 -1
- package/dist/{useEmailDeliveryIntegrationApi-BD6h2h5w.js → useEmailDeliveryIntegrationApi-BcQDhMIH.js} +2 -2
- package/dist/{useEmailDeliveryIntegrationApi-BD6h2h5w.js.map → useEmailDeliveryIntegrationApi-BcQDhMIH.js.map} +1 -1
- package/dist/{useEmailDeliveryIntegrationApi-NUL8d1xC.js → useEmailDeliveryIntegrationApi-Dk9WPotT.js} +2 -2
- package/dist/{useEmailDeliveryIntegrationApi-NUL8d1xC.js.map → useEmailDeliveryIntegrationApi-Dk9WPotT.js.map} +1 -1
- package/dist/{useSparkpostApi-tYImubXZ.js → useSparkpostApi-B-D8RNRF.js} +5 -5
- package/dist/{useSparkpostApi-C7cHCa3T.js.map → useSparkpostApi-B-D8RNRF.js.map} +1 -1
- package/dist/{useSparkpostApi-C7cHCa3T.js → useSparkpostApi-DlgW14Wu.js} +5 -5
- package/dist/{useSparkpostApi-tYImubXZ.js.map → useSparkpostApi-DlgW14Wu.js.map} +1 -1
- package/dist/{useSparkpostDomain-BiZb7l8r.js → useSparkpostDomain-CXs_VuGP.js} +2 -2
- package/dist/{useSparkpostDomain-BiZb7l8r.js.map → useSparkpostDomain-CXs_VuGP.js.map} +1 -1
- package/dist/{useSparkpostDomain-CmX8ka38.js → useSparkpostDomain-DA1nrWS3.js} +2 -2
- package/dist/{useSparkpostDomain-CmX8ka38.js.map → useSparkpostDomain-DA1nrWS3.js.map} +1 -1
- package/package.json +10 -10
- package/dist/index-BKKcEEt1.js.map +0 -1
- package/dist/index-C7KroEtv.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { u as useGmail, a as useOutlook, b as useSmtp } from './index-
|
|
2
|
-
export { E as EmailDeliveryScreen } from './index-
|
|
1
|
+
import { u as useGmail, a as useOutlook, b as useSmtp } from './index-DmRq-yH1.js';
|
|
2
|
+
export { E as EmailDeliveryScreen } from './index-DmRq-yH1.js';
|
|
3
3
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
4
4
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
5
5
|
import { useState } from 'react';
|
|
6
|
+
import { isPresent, humanize } from '@bigbinary/neeto-cist';
|
|
7
|
+
import { useQueryParams } from '@bigbinary/neeto-commons-frontend/react-utils';
|
|
6
8
|
import { buildUrl } from '@bigbinary/neeto-commons-frontend/utils';
|
|
7
9
|
import Check from '@bigbinary/neeto-icons/Check';
|
|
8
10
|
import Warning from '@bigbinary/neeto-icons/Warning';
|
|
@@ -10,10 +12,11 @@ import CardLayout from '@bigbinary/neeto-molecules/CardLayout';
|
|
|
10
12
|
import Button from '@bigbinary/neetoui/Button';
|
|
11
13
|
import Callout from '@bigbinary/neetoui/Callout';
|
|
12
14
|
import Spinner from '@bigbinary/neetoui/Spinner';
|
|
15
|
+
import Toastr from '@bigbinary/neetoui/Toastr';
|
|
13
16
|
import Typography from '@bigbinary/neetoui/Typography';
|
|
14
17
|
import { useTranslation, Trans } from 'react-i18next';
|
|
15
18
|
import { useHistory } from 'react-router-dom';
|
|
16
|
-
import { g as useCreateSmtp, O as OUTLOOK_OAUTH_CONNECT_URL, G as GMAIL_OAUTH_CONNECT_URL } from './useSparkpostApi-
|
|
19
|
+
import { g as useCreateSmtp, O as OUTLOOK_OAUTH_CONNECT_URL, G as GMAIL_OAUTH_CONNECT_URL } from './useSparkpostApi-B-D8RNRF.js';
|
|
17
20
|
import Pane from '@bigbinary/neetoui/Pane';
|
|
18
21
|
import Form from '@bigbinary/neetoui/formik/Form';
|
|
19
22
|
import Input from '@bigbinary/neetoui/formik/Input';
|
|
@@ -22,16 +25,13 @@ import ActionBlock from '@bigbinary/neetoui/formik/ActionBlock';
|
|
|
22
25
|
import { t } from 'i18next';
|
|
23
26
|
import * as yup from 'yup';
|
|
24
27
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
25
|
-
import { u as useSparkpostDomain } from './useSparkpostDomain-
|
|
26
|
-
import { u as useFetchConnectedIntegration } from './useEmailDeliveryIntegrationApi-
|
|
28
|
+
import { u as useSparkpostDomain } from './useSparkpostDomain-DA1nrWS3.js';
|
|
29
|
+
import { u as useFetchConnectedIntegration } from './useEmailDeliveryIntegrationApi-Dk9WPotT.js';
|
|
27
30
|
import MailSend from '@bigbinary/neeto-icons/MailSend';
|
|
28
31
|
import GmailIcon from '@bigbinary/neeto-icons/misc/Gmail';
|
|
29
32
|
import OutlookIcon from '@bigbinary/neeto-icons/misc/Outlook';
|
|
30
33
|
export { default as SparkpostDomainSetup } from './SparkpostDomainSetup.js';
|
|
31
34
|
export { default as SparkpostDomainVerify } from './SparkpostDomainVerify.js';
|
|
32
|
-
import '@bigbinary/neeto-cist';
|
|
33
|
-
import '@bigbinary/neeto-commons-frontend/react-utils';
|
|
34
|
-
import '@bigbinary/neetoui/Toastr';
|
|
35
35
|
import '@tanstack/react-query';
|
|
36
36
|
import '@bigbinary/neetoui/Tag';
|
|
37
37
|
import 'axios';
|
|
@@ -183,6 +183,12 @@ var SmtpSetup = function SmtpSetup(_ref) {
|
|
|
183
183
|
});
|
|
184
184
|
};
|
|
185
185
|
|
|
186
|
+
var ERROR_MESSAGES = {
|
|
187
|
+
gmail_permission_not_given: t("neetoEmailDelivery.gmail.permissionNotGiven"),
|
|
188
|
+
outlook_permission_not_given: t("neetoEmailDelivery.outlook.permissionNotGiven"),
|
|
189
|
+
outlook_invalid_client: t("neetoEmailDelivery.outlook.invalidClient"),
|
|
190
|
+
outlook_nil_json_web_token: t("neetoEmailDelivery.outlook.nilJsonWebToken")
|
|
191
|
+
};
|
|
186
192
|
var INTEGRATION_TYPES = {
|
|
187
193
|
GMAIL: "gmail",
|
|
188
194
|
OUTLOOK: "outlook",
|
|
@@ -207,10 +213,22 @@ var IntegrationDetailPage = function IntegrationDetailPage(_ref) {
|
|
|
207
213
|
var _useTranslation = useTranslation(),
|
|
208
214
|
t = _useTranslation.t;
|
|
209
215
|
var history = useHistory();
|
|
216
|
+
var _useQueryParams = useQueryParams(),
|
|
217
|
+
error = _useQueryParams.error,
|
|
218
|
+
errorDescription = _useQueryParams.errorDescription;
|
|
210
219
|
var _useState = useState(false),
|
|
211
220
|
_useState2 = _slicedToArray(_useState, 2),
|
|
212
221
|
isSmtpPaneOpen = _useState2[0],
|
|
213
222
|
setIsSmtpPaneOpen = _useState2[1];
|
|
223
|
+
if (isPresent(error)) {
|
|
224
|
+
var _errorMessage2, _integrationRoutes$ty;
|
|
225
|
+
var _errorMessage = ERROR_MESSAGES[error];
|
|
226
|
+
if (errorDescription) {
|
|
227
|
+
_errorMessage = "".concat(_errorMessage, " ").concat(errorDescription);
|
|
228
|
+
}
|
|
229
|
+
Toastr.error((_errorMessage2 = _errorMessage) !== null && _errorMessage2 !== void 0 ? _errorMessage2 : humanize(error));
|
|
230
|
+
history.replace((_integrationRoutes$ty = integrationRoutes === null || integrationRoutes === void 0 ? void 0 : integrationRoutes[type]) !== null && _integrationRoutes$ty !== void 0 ? _integrationRoutes$ty : indexRoute);
|
|
231
|
+
}
|
|
214
232
|
var providerLabel = PROVIDER_LABELS[type];
|
|
215
233
|
var Icon = PROVIDER_ICONS[type];
|
|
216
234
|
var description = t("neetoEmailDelivery.".concat(type, ".description"));
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../app/javascript/src/components/Smtp/constants.js","../app/javascript/src/components/Smtp/Setup.jsx","../app/javascript/src/components/IntegrationDetailPage/constants.js","../app/javascript/src/components/IntegrationDetailPage/index.jsx"],"sourcesContent":["import { t } from \"i18next\";\nimport * as yup from \"yup\";\n\nexport const ENCRYPTION_OPTIONS = [\n { label: \"None\", value: \"none\" },\n { label: \"StartTLS\", value: \"starttls\" },\n { label: \"SSL\", value: \"ssl\" },\n];\n\nexport const SMTP_ACCOUNT_INITIAL_VALUES = {\n host: \"\",\n port: 587,\n username: \"\",\n password: \"\",\n email: \"\",\n encryption: \"starttls\",\n displayName: \"\",\n};\n\nexport const SMTP_ACCOUNT_VALIDATION_SCHEMA = yup.object().shape({\n host: yup\n .string()\n .trim()\n .required(\n t(\"neetoEmailDelivery.smtp.setup.requiredField\", {\n field: t(\"neetoEmailDelivery.smtp.setup.hostLabel\"),\n })\n ),\n port: yup.number().required(\n t(\"neetoEmailDelivery.smtp.setup.requiredField\", {\n field: t(\"neetoEmailDelivery.smtp.setup.portLabel\"),\n })\n ),\n username: yup\n .string()\n .trim()\n .required(\n t(\"neetoEmailDelivery.smtp.setup.requiredField\", {\n field: t(\"neetoEmailDelivery.smtp.setup.usernameLabel\"),\n })\n ),\n password: yup\n .string()\n .trim()\n .required(\n t(\"neetoEmailDelivery.smtp.setup.requiredField\", {\n field: t(\"neetoEmailDelivery.smtp.setup.passwordLabel\"),\n })\n ),\n email: yup\n .string()\n .trim()\n .required(\n t(\"neetoEmailDelivery.smtp.setup.requiredField\", {\n field: t(\"neetoEmailDelivery.smtp.setup.emailLabel\"),\n })\n )\n .email(t(\"neetoEmailDelivery.smtp.setup.emailInvalid\")),\n displayName: yup\n .string()\n .trim()\n .required(\n t(\"neetoEmailDelivery.smtp.setup.requiredField\", {\n field: t(\"neetoEmailDelivery.smtp.setup.displayNameLabel\"),\n })\n ),\n encryption: yup\n .string()\n .trim()\n .required(\n t(\"neetoEmailDelivery.smtp.setup.requiredField\", {\n field: t(\"neetoEmailDelivery.smtp.setup.encryptionLabel\"),\n })\n ),\n});\n","import { Callout, Pane, Typography } from \"neetoui\";\nimport { Form, Input, Radio, ActionBlock } from \"neetoui/formik\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { useCreateSmtp } from \"hooks/reactQuery/integrations/useSmtpIntegrationApi\";\n\nimport {\n SMTP_ACCOUNT_INITIAL_VALUES,\n SMTP_ACCOUNT_VALIDATION_SCHEMA,\n ENCRYPTION_OPTIONS,\n} from \"./constants\";\n\nconst SmtpSetup = ({ ownerId, onDone, onCancel, isOpen }) => {\n const { t } = useTranslation();\n\n const { isPending: isCreating, mutate: createSmtp } = useCreateSmtp({\n ownerId,\n });\n\n const handleSubmit = values => {\n createSmtp({ smtp_account: values }, { onSuccess: onDone });\n };\n\n return (\n <Pane {...{ isOpen }} size=\"lg\" onClose={onCancel}>\n <Pane.Header>\n <Typography style=\"h2\" weight=\"semibold\">\n {t(\"neetoEmailDelivery.smtp.setup.title\")}\n </Typography>\n </Pane.Header>\n <Form\n className=\"w-full\"\n formikProps={{\n initialValues: SMTP_ACCOUNT_INITIAL_VALUES,\n validationSchema: SMTP_ACCOUNT_VALIDATION_SCHEMA,\n onSubmit: handleSubmit,\n }}\n >\n <Pane.Body className=\"space-y-4\">\n <div className=\"flex flex-col gap-6\">\n <Callout style=\"warning\">\n {t(\"neetoEmailDelivery.smtp.setup.note\")}\n </Callout>\n <Input\n required\n label={t(\"neetoEmailDelivery.smtp.setup.hostLabel\")}\n name=\"host\"\n />\n <Input\n required\n label={t(\"neetoEmailDelivery.smtp.setup.portLabel\")}\n name=\"port\"\n type=\"number\"\n />\n <Input\n required\n label={t(\"neetoEmailDelivery.smtp.setup.usernameLabel\")}\n name=\"username\"\n />\n <Input\n required\n label={t(\"neetoEmailDelivery.smtp.setup.passwordLabel\")}\n name=\"password\"\n type=\"password\"\n />\n <Input\n required\n label={t(\"neetoEmailDelivery.smtp.setup.emailLabel\")}\n name=\"email\"\n type=\"email\"\n />\n <Input\n required\n label={t(\"neetoEmailDelivery.smtp.setup.displayNameLabel\")}\n name=\"displayName\"\n />\n <Radio\n label={t(\"neetoEmailDelivery.smtp.setup.encryptionLabel\")}\n name=\"encryption\"\n >\n {ENCRYPTION_OPTIONS.map(option => (\n <Radio.Item\n key={option.value}\n label={option.label}\n value={option.value}\n />\n ))}\n </Radio>\n </div>\n </Pane.Body>\n <Pane.Footer>\n <ActionBlock\n cancelButtonProps={{ onClick: onCancel }}\n isSubmitting={isCreating}\n submitButtonProps={{\n label: t(\"neetoEmailDelivery.smtp.setup.saveAndActivate\"),\n }}\n />\n </Pane.Footer>\n </Form>\n </Pane>\n );\n};\n\nexport default SmtpSetup;\n","import { MailSend } from \"neetoicons\";\nimport { Gmail as GmailIcon, Outlook as OutlookIcon } from \"neetoicons/misc\";\n\nexport const INTEGRATION_TYPES = {\n GMAIL: \"gmail\",\n OUTLOOK: \"outlook\",\n SPARKPOST: \"sparkpost\",\n SMTP: \"smtp\",\n};\n\nexport const PROVIDER_LABELS = {\n [INTEGRATION_TYPES.GMAIL]: \"Gmail\",\n [INTEGRATION_TYPES.OUTLOOK]: \"Outlook\",\n [INTEGRATION_TYPES.SPARKPOST]: \"Custom email provider\",\n [INTEGRATION_TYPES.SMTP]: \"SMTP\",\n};\n\nexport const PROVIDER_ICONS = {\n [INTEGRATION_TYPES.GMAIL]: GmailIcon,\n [INTEGRATION_TYPES.OUTLOOK]: OutlookIcon,\n [INTEGRATION_TYPES.SPARKPOST]: MailSend,\n [INTEGRATION_TYPES.SMTP]: MailSend,\n};\n","import { useState } from \"react\";\n\nimport { buildUrl } from \"neetocommons/utils\";\nimport { Check, Warning } from \"neetoicons\";\nimport CardLayout from \"neetomolecules/CardLayout\";\nimport { Button, Callout, Spinner, Typography } from \"neetoui\";\nimport { Trans, useTranslation } from \"react-i18next\";\nimport { useHistory } from \"react-router-dom\";\n\nimport {\n GMAIL_OAUTH_CONNECT_URL,\n OUTLOOK_OAUTH_CONNECT_URL,\n} from \"apis/integrations/constants\";\nimport SmtpSetup from \"components/Smtp/Setup\";\nimport useGmail from \"hooks/integrations/useGmail\";\nimport useOutlook from \"hooks/integrations/useOutlook\";\nimport useSmtp from \"hooks/integrations/useSmtp\";\nimport useSparkpostDomain from \"hooks/integrations/useSparkpostDomain\";\nimport { useFetchConnectedIntegration } from \"hooks/reactQuery/integrations/useEmailDeliveryIntegrationApi\";\n\nimport {\n INTEGRATION_TYPES,\n PROVIDER_LABELS,\n PROVIDER_ICONS,\n} from \"./constants\";\n\nconst IntegrationDetailPage = ({\n type,\n ownerId,\n canManageIntegrations,\n appName,\n scopeText,\n connectedScopeText,\n helpArticleUrl,\n indexRoute,\n integrationRoutes,\n ownDomainSetupRoute,\n ownDomainVerifyRoute,\n}) => {\n const { t } = useTranslation();\n const history = useHistory();\n const [isSmtpPaneOpen, setIsSmtpPaneOpen] = useState(false);\n\n const providerLabel = PROVIDER_LABELS[type];\n const Icon = PROVIDER_ICONS[type];\n const description = t(`neetoEmailDelivery.${type}.description`);\n\n const gmailIntegration = useGmail({\n ownerId,\n indexRoute,\n canManageIntegrations,\n });\n\n const outlookIntegration = useOutlook({\n ownerId,\n indexRoute,\n canManageIntegrations,\n });\n\n const sparkpostIntegration = useSparkpostDomain({\n ownerId,\n canManageIntegrations,\n });\n\n const smtpIntegration = useSmtp({ ownerId, canManageIntegrations });\n\n const { integration: connectedIntegration, isLoading: isIntegrationLoading } =\n useFetchConnectedIntegration(ownerId);\n\n const integrationMap = {\n [INTEGRATION_TYPES.GMAIL]: gmailIntegration,\n [INTEGRATION_TYPES.OUTLOOK]: outlookIntegration,\n [INTEGRATION_TYPES.SPARKPOST]: sparkpostIntegration,\n [INTEGRATION_TYPES.SMTP]: smtpIntegration,\n };\n\n const currentIntegration = integrationMap[type];\n const {\n isConnected,\n isDestroying,\n onDisconnect,\n data = {},\n errorMessage,\n } = currentIntegration;\n\n const connectedEmail = data?.email;\n\n const isOutlookPending =\n type === INTEGRATION_TYPES.OUTLOOK &&\n outlookIntegration.isWaitingForTestEmail;\n\n const isSparkpostPending =\n type === INTEGRATION_TYPES.SPARKPOST &&\n sparkpostIntegration.exists &&\n !isConnected;\n\n const isPending = isOutlookPending || isSparkpostPending;\n\n const isLoading =\n gmailIntegration.isLoading ||\n outlookIntegration.isLoading ||\n sparkpostIntegration.isLoading ||\n smtpIntegration.isLoading ||\n isIntegrationLoading;\n\n const isBlocked = connectedIntegration && connectedIntegration.type !== type;\n\n const activeProviderLabel = isBlocked\n ? PROVIDER_LABELS[connectedIntegration.type]\n : null;\n\n const activeProviderRoute = isBlocked\n ? integrationRoutes?.[connectedIntegration.type]\n : null;\n\n const handleConnect = () => {\n switch (type) {\n case INTEGRATION_TYPES.GMAIL:\n window.location.href = buildUrl(GMAIL_OAUTH_CONNECT_URL, { ownerId });\n break;\n case INTEGRATION_TYPES.OUTLOOK:\n window.location.href = buildUrl(OUTLOOK_OAUTH_CONNECT_URL, {\n ownerId,\n });\n break;\n case INTEGRATION_TYPES.SPARKPOST:\n history.push(ownDomainSetupRoute);\n break;\n case INTEGRATION_TYPES.SMTP:\n setIsSmtpPaneOpen(true);\n break;\n default:\n break;\n }\n };\n\n const getConnectButtonLabel = () => {\n switch (type) {\n case INTEGRATION_TYPES.GMAIL:\n return t(\"neetoEmailDelivery.integrationDetail.connectGmail\");\n case INTEGRATION_TYPES.OUTLOOK:\n return t(\"neetoEmailDelivery.integrationDetail.connectOutlook\");\n case INTEGRATION_TYPES.SPARKPOST:\n return t(\"neetoEmailDelivery.integrationDetail.setupDomain\");\n case INTEGRATION_TYPES.SMTP:\n return t(\"neetoEmailDelivery.integrationDetail.connectSmtp\");\n default:\n return \"\";\n }\n };\n\n const renderTitle = () => {\n if (isConnected) {\n return (\n <div className=\"flex items-center gap-2\">\n <span>\n {t(\"neetoEmailDelivery.integrationDetail.connectedTitle\", {\n provider: providerLabel,\n })}\n </span>\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={24} />\n </div>\n </div>\n );\n }\n\n if (isPending) {\n return (\n <div className=\"flex items-center gap-2\">\n <span>\n {t(\"neetoEmailDelivery.integrationDetail.pendingTitle\", {\n provider: providerLabel,\n })}\n </span>\n <div className=\"neeto-ui-text-warning-500 flex items-center justify-center p-1\">\n <Warning size={24} />\n </div>\n </div>\n );\n }\n\n return t(\"neetoEmailDelivery.integrationDetail.connectTitle\", {\n appName,\n provider: providerLabel,\n });\n };\n\n const renderActionBlock = () => {\n if (isConnected) {\n return (\n <Button\n data-testid=\"disconnect-button\"\n label={t(\"neetoEmailDelivery.integrationDetail.disconnect\")}\n loading={isDestroying}\n style=\"danger\"\n onClick={onDisconnect}\n />\n );\n }\n\n if (isPending) {\n return (\n <div className=\"flex items-center gap-2\">\n {isSparkpostPending && (\n <Button\n data-testid=\"continue-verification-button\"\n to={ownDomainVerifyRoute}\n label={t(\n \"neetoEmailDelivery.sparkpost.emailDelivery.continueVerification\"\n )}\n />\n )}\n <Button\n data-testid=\"disconnect-button\"\n label={t(\"neetoEmailDelivery.integrationDetail.disconnect\")}\n loading={isDestroying}\n style=\"danger\"\n onClick={onDisconnect}\n />\n </div>\n );\n }\n\n if (isBlocked) return null;\n\n return (\n <Button\n data-testid=\"connect-button\"\n label={getConnectButtonLabel()}\n style=\"primary\"\n onClick={handleConnect}\n />\n );\n };\n\n if (isLoading) {\n return (\n <div className=\"flex grow items-center justify-center w-full\">\n <Spinner />\n </div>\n );\n }\n\n return (\n <>\n <CardLayout\n actionBlock={renderActionBlock()}\n icon={<Icon size={48} />}\n title={renderTitle()}\n description={\n isConnected ? (\n <Trans\n components={{ bold: <strong /> }}\n i18nKey=\"neetoEmailDelivery.integrationDetail.connectedEmail\"\n values={{ email: connectedEmail }}\n />\n ) : (\n description\n )\n }\n >\n {(isConnected ? connectedScopeText || scopeText : scopeText) && (\n <Typography style=\"body1\">\n {isConnected ? connectedScopeText || scopeText : scopeText}\n </Typography>\n )}\n {!isConnected && helpArticleUrl && (\n <Typography className=\"my-2\" style=\"body2\">\n <Trans\n i18nKey=\"neetoEmailDelivery.integrationDetail.helpArticleText\"\n values={{ provider: providerLabel }}\n components={{\n helpLink: (\n <Button\n data-testid=\"help-doc-link\"\n href={helpArticleUrl}\n style=\"link\"\n target=\"_blank\"\n />\n ),\n }}\n />\n </Typography>\n )}\n {!isConnected && !isPending && isBlocked && (\n <Callout\n style={connectedIntegration.isPending ? \"warning\" : \"danger\"}\n >\n <p>\n <Trans\n components={{\n disconnectLink: (\n <Button\n data-testid=\"disconnect-link\"\n href={activeProviderRoute}\n style=\"link\"\n />\n ),\n }}\n i18nKey={\n connectedIntegration.isPending\n ? \"neetoEmailDelivery.integrationDetail.pendingIntegrationBlocked\"\n : \"neetoEmailDelivery.integrationDetail.onlyOneIntegration\"\n }\n values={{\n activeProvider: activeProviderLabel,\n targetProvider: providerLabel,\n }}\n />\n </p>\n </Callout>\n )}\n {errorMessage && <Callout style=\"danger\">{errorMessage}</Callout>}\n {isOutlookPending && (\n <Callout style=\"warning\">\n {t(\"neetoEmailDelivery.outlook.waitingForTestEmail\", {\n email: connectedEmail,\n })}\n </Callout>\n )}\n {isSparkpostPending && (\n <Callout style=\"warning\">\n {t(\n \"neetoEmailDelivery.sparkpost.emailDelivery.verificationPending\",\n { domain: data?.domain }\n )}\n </Callout>\n )}\n </CardLayout>\n {type === INTEGRATION_TYPES.SMTP && (\n <SmtpSetup\n {...{ ownerId }}\n isOpen={isSmtpPaneOpen}\n onCancel={() => setIsSmtpPaneOpen(false)}\n onDone={() => setIsSmtpPaneOpen(false)}\n />\n )}\n </>\n );\n};\n\nexport default IntegrationDetailPage;\n"],"names":["ENCRYPTION_OPTIONS","label","value","SMTP_ACCOUNT_INITIAL_VALUES","host","port","username","password","email","encryption","displayName","SMTP_ACCOUNT_VALIDATION_SCHEMA","yup","object","shape","string","trim","required","t","field","number","SmtpSetup","_ref","ownerId","onDone","onCancel","isOpen","_useTranslation","useTranslation","_useCreateSmtp","useCreateSmtp","isCreating","isPending","createSmtp","mutate","handleSubmit","values","smtp_account","onSuccess","_jsxs","Pane","size","onClose","children","_jsx","Header","Typography","style","weight","Form","className","formikProps","initialValues","validationSchema","onSubmit","Body","Callout","Input","name","type","Radio","map","option","Item","Footer","ActionBlock","cancelButtonProps","onClick","isSubmitting","submitButtonProps","INTEGRATION_TYPES","GMAIL","OUTLOOK","SPARKPOST","SMTP","PROVIDER_LABELS","_defineProperty","PROVIDER_ICONS","GmailIcon","OutlookIcon","MailSend","IntegrationDetailPage","canManageIntegrations","appName","scopeText","connectedScopeText","helpArticleUrl","indexRoute","integrationRoutes","ownDomainSetupRoute","ownDomainVerifyRoute","history","useHistory","_useState","useState","_useState2","_slicedToArray","isSmtpPaneOpen","setIsSmtpPaneOpen","providerLabel","Icon","description","concat","gmailIntegration","useGmail","outlookIntegration","useOutlook","sparkpostIntegration","useSparkpostDomain","smtpIntegration","useSmtp","_useFetchConnectedInt","useFetchConnectedIntegration","connectedIntegration","integration","isIntegrationLoading","isLoading","integrationMap","currentIntegration","isConnected","isDestroying","onDisconnect","_currentIntegration$d","data","errorMessage","connectedEmail","isOutlookPending","isWaitingForTestEmail","isSparkpostPending","exists","isBlocked","activeProviderLabel","activeProviderRoute","handleConnect","window","location","href","buildUrl","GMAIL_OAUTH_CONNECT_URL","OUTLOOK_OAUTH_CONNECT_URL","push","getConnectButtonLabel","renderTitle","provider","Check","Warning","renderActionBlock","Button","loading","to","Spinner","_Fragment","CardLayout","actionBlock","icon","title","Trans","components","bold","i18nKey","helpLink","target","disconnectLink","activeProvider","targetProvider","domain"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGO,IAAMA,kBAAkB,GAAG,CAChC;AAAEC,EAAAA,KAAK,EAAE,MAAM;AAAEC,EAAAA,KAAK,EAAE;AAAO,CAAC,EAChC;AAAED,EAAAA,KAAK,EAAE,UAAU;AAAEC,EAAAA,KAAK,EAAE;AAAW,CAAC,EACxC;AAAED,EAAAA,KAAK,EAAE,KAAK;AAAEC,EAAAA,KAAK,EAAE;AAAM,CAAC,CAC/B;AAEM,IAAMC,2BAA2B,GAAG;AACzCC,EAAAA,IAAI,EAAE,EAAE;AACRC,EAAAA,IAAI,EAAE,GAAG;AACTC,EAAAA,QAAQ,EAAE,EAAE;AACZC,EAAAA,QAAQ,EAAE,EAAE;AACZC,EAAAA,KAAK,EAAE,EAAE;AACTC,EAAAA,UAAU,EAAE,UAAU;AACtBC,EAAAA,WAAW,EAAE;AACf,CAAC;AAEM,IAAMC,8BAA8B,GAAGC,GAAG,CAACC,MAAM,EAAE,CAACC,KAAK,CAAC;AAC/DV,EAAAA,IAAI,EAAEQ,GAAG,CACNG,MAAM,EAAE,CACRC,IAAI,EAAE,CACNC,QAAQ,CACPC,CAAC,CAAC,6CAA6C,EAAE;IAC/CC,KAAK,EAAED,CAAC,CAAC,yCAAyC;AACpD,GAAC,CACH,CAAC;AACHb,EAAAA,IAAI,EAAEO,GAAG,CAACQ,MAAM,EAAE,CAACH,QAAQ,CACzBC,CAAC,CAAC,6CAA6C,EAAE;IAC/CC,KAAK,EAAED,CAAC,CAAC,yCAAyC;AACpD,GAAC,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A,GAAA;QAAA,OAAQ0E,iBAAiB,CAAC,KAAK,CAAC;AAAA;AAAC,KACxC,CACF;AAAA,GACD,CAAC;AAEP;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../app/javascript/src/components/Smtp/constants.js","../app/javascript/src/components/Smtp/Setup.jsx","../app/javascript/src/components/IntegrationDetailPage/constants.js","../app/javascript/src/components/IntegrationDetailPage/index.jsx"],"sourcesContent":["import { t } from \"i18next\";\nimport * as yup from \"yup\";\n\nexport const ENCRYPTION_OPTIONS = [\n { label: \"None\", value: \"none\" },\n { label: \"StartTLS\", value: \"starttls\" },\n { label: \"SSL\", value: \"ssl\" },\n];\n\nexport const SMTP_ACCOUNT_INITIAL_VALUES = {\n host: \"\",\n port: 587,\n username: \"\",\n password: \"\",\n email: \"\",\n encryption: \"starttls\",\n displayName: \"\",\n};\n\nexport const SMTP_ACCOUNT_VALIDATION_SCHEMA = yup.object().shape({\n host: yup\n .string()\n .trim()\n .required(\n t(\"neetoEmailDelivery.smtp.setup.requiredField\", {\n field: t(\"neetoEmailDelivery.smtp.setup.hostLabel\"),\n })\n ),\n port: yup.number().required(\n t(\"neetoEmailDelivery.smtp.setup.requiredField\", {\n field: t(\"neetoEmailDelivery.smtp.setup.portLabel\"),\n })\n ),\n username: yup\n .string()\n .trim()\n .required(\n t(\"neetoEmailDelivery.smtp.setup.requiredField\", {\n field: t(\"neetoEmailDelivery.smtp.setup.usernameLabel\"),\n })\n ),\n password: yup\n .string()\n .trim()\n .required(\n t(\"neetoEmailDelivery.smtp.setup.requiredField\", {\n field: t(\"neetoEmailDelivery.smtp.setup.passwordLabel\"),\n })\n ),\n email: yup\n .string()\n .trim()\n .required(\n t(\"neetoEmailDelivery.smtp.setup.requiredField\", {\n field: t(\"neetoEmailDelivery.smtp.setup.emailLabel\"),\n })\n )\n .email(t(\"neetoEmailDelivery.smtp.setup.emailInvalid\")),\n displayName: yup\n .string()\n .trim()\n .required(\n t(\"neetoEmailDelivery.smtp.setup.requiredField\", {\n field: t(\"neetoEmailDelivery.smtp.setup.displayNameLabel\"),\n })\n ),\n encryption: yup\n .string()\n .trim()\n .required(\n t(\"neetoEmailDelivery.smtp.setup.requiredField\", {\n field: t(\"neetoEmailDelivery.smtp.setup.encryptionLabel\"),\n })\n ),\n});\n","import { Callout, Pane, Typography } from \"neetoui\";\nimport { Form, Input, Radio, ActionBlock } from \"neetoui/formik\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { useCreateSmtp } from \"hooks/reactQuery/integrations/useSmtpIntegrationApi\";\n\nimport {\n SMTP_ACCOUNT_INITIAL_VALUES,\n SMTP_ACCOUNT_VALIDATION_SCHEMA,\n ENCRYPTION_OPTIONS,\n} from \"./constants\";\n\nconst SmtpSetup = ({ ownerId, onDone, onCancel, isOpen }) => {\n const { t } = useTranslation();\n\n const { isPending: isCreating, mutate: createSmtp } = useCreateSmtp({\n ownerId,\n });\n\n const handleSubmit = values => {\n createSmtp({ smtp_account: values }, { onSuccess: onDone });\n };\n\n return (\n <Pane {...{ isOpen }} size=\"lg\" onClose={onCancel}>\n <Pane.Header>\n <Typography style=\"h2\" weight=\"semibold\">\n {t(\"neetoEmailDelivery.smtp.setup.title\")}\n </Typography>\n </Pane.Header>\n <Form\n className=\"w-full\"\n formikProps={{\n initialValues: SMTP_ACCOUNT_INITIAL_VALUES,\n validationSchema: SMTP_ACCOUNT_VALIDATION_SCHEMA,\n onSubmit: handleSubmit,\n }}\n >\n <Pane.Body className=\"space-y-4\">\n <div className=\"flex flex-col gap-6\">\n <Callout style=\"warning\">\n {t(\"neetoEmailDelivery.smtp.setup.note\")}\n </Callout>\n <Input\n required\n label={t(\"neetoEmailDelivery.smtp.setup.hostLabel\")}\n name=\"host\"\n />\n <Input\n required\n label={t(\"neetoEmailDelivery.smtp.setup.portLabel\")}\n name=\"port\"\n type=\"number\"\n />\n <Input\n required\n label={t(\"neetoEmailDelivery.smtp.setup.usernameLabel\")}\n name=\"username\"\n />\n <Input\n required\n label={t(\"neetoEmailDelivery.smtp.setup.passwordLabel\")}\n name=\"password\"\n type=\"password\"\n />\n <Input\n required\n label={t(\"neetoEmailDelivery.smtp.setup.emailLabel\")}\n name=\"email\"\n type=\"email\"\n />\n <Input\n required\n label={t(\"neetoEmailDelivery.smtp.setup.displayNameLabel\")}\n name=\"displayName\"\n />\n <Radio\n label={t(\"neetoEmailDelivery.smtp.setup.encryptionLabel\")}\n name=\"encryption\"\n >\n {ENCRYPTION_OPTIONS.map(option => (\n <Radio.Item\n key={option.value}\n label={option.label}\n value={option.value}\n />\n ))}\n </Radio>\n </div>\n </Pane.Body>\n <Pane.Footer>\n <ActionBlock\n cancelButtonProps={{ onClick: onCancel }}\n isSubmitting={isCreating}\n submitButtonProps={{\n label: t(\"neetoEmailDelivery.smtp.setup.saveAndActivate\"),\n }}\n />\n </Pane.Footer>\n </Form>\n </Pane>\n );\n};\n\nexport default SmtpSetup;\n","import { t } from \"i18next\";\nimport { MailSend } from \"neetoicons\";\nimport { Gmail as GmailIcon, Outlook as OutlookIcon } from \"neetoicons/misc\";\n\nexport const ERROR_MESSAGES = {\n gmail_permission_not_given: t(\"neetoEmailDelivery.gmail.permissionNotGiven\"),\n outlook_permission_not_given: t(\n \"neetoEmailDelivery.outlook.permissionNotGiven\"\n ),\n outlook_invalid_client: t(\"neetoEmailDelivery.outlook.invalidClient\"),\n outlook_nil_json_web_token: t(\"neetoEmailDelivery.outlook.nilJsonWebToken\"),\n};\n\nexport const INTEGRATION_TYPES = {\n GMAIL: \"gmail\",\n OUTLOOK: \"outlook\",\n SPARKPOST: \"sparkpost\",\n SMTP: \"smtp\",\n};\n\nexport const PROVIDER_LABELS = {\n [INTEGRATION_TYPES.GMAIL]: \"Gmail\",\n [INTEGRATION_TYPES.OUTLOOK]: \"Outlook\",\n [INTEGRATION_TYPES.SPARKPOST]: \"Custom email provider\",\n [INTEGRATION_TYPES.SMTP]: \"SMTP\",\n};\n\nexport const PROVIDER_ICONS = {\n [INTEGRATION_TYPES.GMAIL]: GmailIcon,\n [INTEGRATION_TYPES.OUTLOOK]: OutlookIcon,\n [INTEGRATION_TYPES.SPARKPOST]: MailSend,\n [INTEGRATION_TYPES.SMTP]: MailSend,\n};\n","import { useState } from \"react\";\n\nimport { humanize, isPresent } from \"neetocist\";\nimport { useQueryParams } from \"neetocommons/react-utils\";\nimport { buildUrl } from \"neetocommons/utils\";\nimport { Check, Warning } from \"neetoicons\";\nimport CardLayout from \"neetomolecules/CardLayout\";\nimport { Button, Callout, Spinner, Toastr, Typography } from \"neetoui\";\nimport { Trans, useTranslation } from \"react-i18next\";\nimport { useHistory } from \"react-router-dom\";\n\nimport {\n GMAIL_OAUTH_CONNECT_URL,\n OUTLOOK_OAUTH_CONNECT_URL,\n} from \"apis/integrations/constants\";\nimport SmtpSetup from \"components/Smtp/Setup\";\nimport useGmail from \"hooks/integrations/useGmail\";\nimport useOutlook from \"hooks/integrations/useOutlook\";\nimport useSmtp from \"hooks/integrations/useSmtp\";\nimport useSparkpostDomain from \"hooks/integrations/useSparkpostDomain\";\nimport { useFetchConnectedIntegration } from \"hooks/reactQuery/integrations/useEmailDeliveryIntegrationApi\";\n\nimport {\n ERROR_MESSAGES,\n INTEGRATION_TYPES,\n PROVIDER_LABELS,\n PROVIDER_ICONS,\n} from \"./constants\";\n\nconst IntegrationDetailPage = ({\n type,\n ownerId,\n canManageIntegrations,\n appName,\n scopeText,\n connectedScopeText,\n helpArticleUrl,\n indexRoute,\n integrationRoutes,\n ownDomainSetupRoute,\n ownDomainVerifyRoute,\n}) => {\n const { t } = useTranslation();\n const history = useHistory();\n const { error, errorDescription } = useQueryParams();\n const [isSmtpPaneOpen, setIsSmtpPaneOpen] = useState(false);\n\n if (isPresent(error)) {\n let errorMessage = ERROR_MESSAGES[error];\n if (errorDescription) {\n errorMessage = `${errorMessage} ${errorDescription}`;\n }\n Toastr.error(errorMessage ?? humanize(error));\n history.replace(integrationRoutes?.[type] ?? indexRoute);\n }\n\n const providerLabel = PROVIDER_LABELS[type];\n const Icon = PROVIDER_ICONS[type];\n const description = t(`neetoEmailDelivery.${type}.description`);\n\n const gmailIntegration = useGmail({\n ownerId,\n indexRoute,\n canManageIntegrations,\n });\n\n const outlookIntegration = useOutlook({\n ownerId,\n indexRoute,\n canManageIntegrations,\n });\n\n const sparkpostIntegration = useSparkpostDomain({\n ownerId,\n canManageIntegrations,\n });\n\n const smtpIntegration = useSmtp({ ownerId, canManageIntegrations });\n\n const { integration: connectedIntegration, isLoading: isIntegrationLoading } =\n useFetchConnectedIntegration(ownerId);\n\n const integrationMap = {\n [INTEGRATION_TYPES.GMAIL]: gmailIntegration,\n [INTEGRATION_TYPES.OUTLOOK]: outlookIntegration,\n [INTEGRATION_TYPES.SPARKPOST]: sparkpostIntegration,\n [INTEGRATION_TYPES.SMTP]: smtpIntegration,\n };\n\n const currentIntegration = integrationMap[type];\n const {\n isConnected,\n isDestroying,\n onDisconnect,\n data = {},\n errorMessage,\n } = currentIntegration;\n\n const connectedEmail = data?.email;\n\n const isOutlookPending =\n type === INTEGRATION_TYPES.OUTLOOK &&\n outlookIntegration.isWaitingForTestEmail;\n\n const isSparkpostPending =\n type === INTEGRATION_TYPES.SPARKPOST &&\n sparkpostIntegration.exists &&\n !isConnected;\n\n const isPending = isOutlookPending || isSparkpostPending;\n\n const isLoading =\n gmailIntegration.isLoading ||\n outlookIntegration.isLoading ||\n sparkpostIntegration.isLoading ||\n smtpIntegration.isLoading ||\n isIntegrationLoading;\n\n const isBlocked = connectedIntegration && connectedIntegration.type !== type;\n\n const activeProviderLabel = isBlocked\n ? PROVIDER_LABELS[connectedIntegration.type]\n : null;\n\n const activeProviderRoute = isBlocked\n ? integrationRoutes?.[connectedIntegration.type]\n : null;\n\n const handleConnect = () => {\n switch (type) {\n case INTEGRATION_TYPES.GMAIL:\n window.location.href = buildUrl(GMAIL_OAUTH_CONNECT_URL, { ownerId });\n break;\n case INTEGRATION_TYPES.OUTLOOK:\n window.location.href = buildUrl(OUTLOOK_OAUTH_CONNECT_URL, {\n ownerId,\n });\n break;\n case INTEGRATION_TYPES.SPARKPOST:\n history.push(ownDomainSetupRoute);\n break;\n case INTEGRATION_TYPES.SMTP:\n setIsSmtpPaneOpen(true);\n break;\n default:\n break;\n }\n };\n\n const getConnectButtonLabel = () => {\n switch (type) {\n case INTEGRATION_TYPES.GMAIL:\n return t(\"neetoEmailDelivery.integrationDetail.connectGmail\");\n case INTEGRATION_TYPES.OUTLOOK:\n return t(\"neetoEmailDelivery.integrationDetail.connectOutlook\");\n case INTEGRATION_TYPES.SPARKPOST:\n return t(\"neetoEmailDelivery.integrationDetail.setupDomain\");\n case INTEGRATION_TYPES.SMTP:\n return t(\"neetoEmailDelivery.integrationDetail.connectSmtp\");\n default:\n return \"\";\n }\n };\n\n const renderTitle = () => {\n if (isConnected) {\n return (\n <div className=\"flex items-center gap-2\">\n <span>\n {t(\"neetoEmailDelivery.integrationDetail.connectedTitle\", {\n provider: providerLabel,\n })}\n </span>\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={24} />\n </div>\n </div>\n );\n }\n\n if (isPending) {\n return (\n <div className=\"flex items-center gap-2\">\n <span>\n {t(\"neetoEmailDelivery.integrationDetail.pendingTitle\", {\n provider: providerLabel,\n })}\n </span>\n <div className=\"neeto-ui-text-warning-500 flex items-center justify-center p-1\">\n <Warning size={24} />\n </div>\n </div>\n );\n }\n\n return t(\"neetoEmailDelivery.integrationDetail.connectTitle\", {\n appName,\n provider: providerLabel,\n });\n };\n\n const renderActionBlock = () => {\n if (isConnected) {\n return (\n <Button\n data-testid=\"disconnect-button\"\n label={t(\"neetoEmailDelivery.integrationDetail.disconnect\")}\n loading={isDestroying}\n style=\"danger\"\n onClick={onDisconnect}\n />\n );\n }\n\n if (isPending) {\n return (\n <div className=\"flex items-center gap-2\">\n {isSparkpostPending && (\n <Button\n data-testid=\"continue-verification-button\"\n to={ownDomainVerifyRoute}\n label={t(\n \"neetoEmailDelivery.sparkpost.emailDelivery.continueVerification\"\n )}\n />\n )}\n <Button\n data-testid=\"disconnect-button\"\n label={t(\"neetoEmailDelivery.integrationDetail.disconnect\")}\n loading={isDestroying}\n style=\"danger\"\n onClick={onDisconnect}\n />\n </div>\n );\n }\n\n if (isBlocked) return null;\n\n return (\n <Button\n data-testid=\"connect-button\"\n label={getConnectButtonLabel()}\n style=\"primary\"\n onClick={handleConnect}\n />\n );\n };\n\n if (isLoading) {\n return (\n <div className=\"flex grow items-center justify-center w-full\">\n <Spinner />\n </div>\n );\n }\n\n return (\n <>\n <CardLayout\n actionBlock={renderActionBlock()}\n icon={<Icon size={48} />}\n title={renderTitle()}\n description={\n isConnected ? (\n <Trans\n components={{ bold: <strong /> }}\n i18nKey=\"neetoEmailDelivery.integrationDetail.connectedEmail\"\n values={{ email: connectedEmail }}\n />\n ) : (\n description\n )\n }\n >\n {(isConnected ? connectedScopeText || scopeText : scopeText) && (\n <Typography style=\"body1\">\n {isConnected ? connectedScopeText || scopeText : scopeText}\n </Typography>\n )}\n {!isConnected && helpArticleUrl && (\n <Typography className=\"my-2\" style=\"body2\">\n <Trans\n i18nKey=\"neetoEmailDelivery.integrationDetail.helpArticleText\"\n values={{ provider: providerLabel }}\n components={{\n helpLink: (\n <Button\n data-testid=\"help-doc-link\"\n href={helpArticleUrl}\n style=\"link\"\n target=\"_blank\"\n />\n ),\n }}\n />\n </Typography>\n )}\n {!isConnected && !isPending && isBlocked && (\n <Callout\n style={connectedIntegration.isPending ? \"warning\" : \"danger\"}\n >\n <p>\n <Trans\n components={{\n disconnectLink: (\n <Button\n data-testid=\"disconnect-link\"\n href={activeProviderRoute}\n style=\"link\"\n />\n ),\n }}\n i18nKey={\n connectedIntegration.isPending\n ? \"neetoEmailDelivery.integrationDetail.pendingIntegrationBlocked\"\n : \"neetoEmailDelivery.integrationDetail.onlyOneIntegration\"\n }\n values={{\n activeProvider: activeProviderLabel,\n targetProvider: providerLabel,\n }}\n />\n </p>\n </Callout>\n )}\n {errorMessage && <Callout style=\"danger\">{errorMessage}</Callout>}\n {isOutlookPending && (\n <Callout style=\"warning\">\n {t(\"neetoEmailDelivery.outlook.waitingForTestEmail\", {\n email: connectedEmail,\n })}\n </Callout>\n )}\n {isSparkpostPending && (\n <Callout style=\"warning\">\n {t(\n \"neetoEmailDelivery.sparkpost.emailDelivery.verificationPending\",\n { domain: data?.domain }\n )}\n </Callout>\n )}\n </CardLayout>\n {type === INTEGRATION_TYPES.SMTP && (\n <SmtpSetup\n {...{ ownerId }}\n isOpen={isSmtpPaneOpen}\n onCancel={() => setIsSmtpPaneOpen(false)}\n onDone={() => setIsSmtpPaneOpen(false)}\n />\n )}\n </>\n );\n};\n\nexport default IntegrationDetailPage;\n"],"names":["ENCRYPTION_OPTIONS","label","value","SMTP_ACCOUNT_INITIAL_VALUES","host","port","username","password","email","encryption","displayName","SMTP_ACCOUNT_VALIDATION_SCHEMA","yup","object","shape","string","trim","required","t","field","number","SmtpSetup","_ref","ownerId","onDone","onCancel","isOpen","_useTranslation","useTranslation","_useCreateSmtp","useCreateSmtp","isCreating","isPending","createSmtp","mutate","handleSubmit","values","smtp_account","onSuccess","_jsxs","Pane","size","onClose","children","_jsx","Header","Typography","style","weight","Form","className","formikProps","initialValues","validationSchema","onSubmit","Body","Callout","Input","name","type","Radio","map","option","Item","Footer","ActionBlock","cancelButtonProps","onClick","isSubmitting","submitButtonProps","ERROR_MESSAGES","gmail_permission_not_given","outlook_permission_not_given","outlook_invalid_client","outlook_nil_json_web_token","INTEGRATION_TYPES","GMAIL","OUTLOOK","SPARKPOST","SMTP","PROVIDER_LABELS","_defineProperty","PROVIDER_ICONS","GmailIcon","OutlookIcon","MailSend","IntegrationDetailPage","canManageIntegrations","appName","scopeText","connectedScopeText","helpArticleUrl","indexRoute","integrationRoutes","ownDomainSetupRoute","ownDomainVerifyRoute","history","useHistory","_useQueryParams","useQueryParams","error","errorDescription","_useState","useState","_useState2","_slicedToArray","isSmtpPaneOpen","setIsSmtpPaneOpen","isPresent","_errorMessage2","_integrationRoutes$ty","errorMessage","concat","Toastr","humanize","replace","providerLabel","Icon","description","gmailIntegration","useGmail","outlookIntegration","useOutlook","sparkpostIntegration","useSparkpostDomain","smtpIntegration","useSmtp","_useFetchConnectedInt","useFetchConnectedIntegration","connectedIntegration","integration","isIntegrationLoading","isLoading","integrationMap","currentIntegration","isConnected","isDestroying","onDisconnect","_currentIntegration$d","data","connectedEmail","isOutlookPending","isWaitingForTestEmail","isSparkpostPending","exists","isBlocked","activeProviderLabel","activeProviderRoute","handleConnect","window","location","href","buildUrl","GMAIL_OAUTH_CONNECT_URL","OUTLOOK_OAUTH_CONNECT_URL","push","getConnectButtonLabel","renderTitle","provider","Check","Warning","renderActionBlock","Button","loading","to","Spinner","_Fragment","CardLayout","actionBlock","icon","title","Trans","components","bold","i18nKey","helpLink","target","disconnectLink","activeProvider","targetProvider","domain"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGO,IAAMA,kBAAkB,GAAG,CAChC;AAAEC,EAAAA,KAAK,EAAE,MAAM;AAAEC,EAAAA,KAAK,EAAE;AAAO,CAAC,EAChC;AAAED,EAAAA,KAAK,EAAE,UAAU;AAAEC,EAAAA,KAAK,EAAE;AAAW,CAAC,EACxC;AAAED,EAAAA,KAAK,EAAE,KAAK;AAAEC,EAAAA,KAAK,EAAE;AAAM,CAAC,CAC/B;AAEM,IAAMC,2BAA2B,GAAG;AACzCC,EAAAA,IAAI,EAAE,EAAE;AACRC,EAAAA,IAAI,EAAE,GAAG;AACTC,EAAAA,QAAQ,EAAE,EAAE;AACZC,EAAAA,QAAQ,EAAE,EAAE;AACZC,EAAAA,KAAK,EAAE,EAAE;AACTC,EAAAA,UAAU,EAAE,UAAU;AACtBC,EAAAA,WAAW,EAAE;AACf,CAAC;AAEM,IAAMC,8BAA8B,GAAGC,GAAG,CAACC,MAAM,EAAE,CAACC,KAAK,CAAC;AAC/DV,EAAAA,IAAI,E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e;MACvBjF,QAAQ,EAAE,SAAVA,QAAQA,GAAA;QAAA,OAAQkF,iBAAiB,CAAC,KAAK,CAAC;MAAA,CAAC;MACzCnF,MAAM,EAAE,SAARA,MAAMA,GAAA;QAAA,OAAQmF,iBAAiB,CAAC,KAAK,CAAC;AAAA,MAAA;AAAC,KACxC,CACF;AAAA,GACD,CAAC;AAEP;;;;"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var neetoCist = require('@bigbinary/neeto-cist');
|
|
4
4
|
var ramda = require('ramda');
|
|
5
|
-
var useSparkpostApi = require('./useSparkpostApi-
|
|
5
|
+
var useSparkpostApi = require('./useSparkpostApi-DlgW14Wu.js');
|
|
6
6
|
|
|
7
7
|
var useFetchConnectedIntegration = function useFetchConnectedIntegration(ownerId) {
|
|
8
8
|
var _activeIntegration$ho, _activeIntegration$ho2;
|
|
@@ -54,4 +54,4 @@ var useFetchConnectedIntegration = function useFetchConnectedIntegration(ownerId
|
|
|
54
54
|
};
|
|
55
55
|
|
|
56
56
|
exports.useFetchConnectedIntegration = useFetchConnectedIntegration;
|
|
57
|
-
//# sourceMappingURL=useEmailDeliveryIntegrationApi-
|
|
57
|
+
//# sourceMappingURL=useEmailDeliveryIntegrationApi-BcQDhMIH.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEmailDeliveryIntegrationApi-
|
|
1
|
+
{"version":3,"file":"useEmailDeliveryIntegrationApi-BcQDhMIH.js","sources":["../app/javascript/src/hooks/reactQuery/integrations/useEmailDeliveryIntegrationApi.js"],"sourcesContent":["import { existsBy } from \"neetocist\";\nimport { pluck } from \"ramda\";\n\nimport { useFetchGmail } from \"./useGmailIntegrationApi\";\nimport { useFetchOutlook } from \"./useOutlookIntegrationApi\";\nimport { useFetchSmtp } from \"./useSmtpIntegrationApi\";\nimport { useFetchSparkpostDomain } from \"./useSparkpostApi\";\n\nexport const useFetchConnectedIntegration = ownerId => {\n const gmail = useFetchGmail(ownerId);\n const outlook = useFetchOutlook(ownerId);\n const sparkpost = useFetchSparkpostDomain(ownerId);\n const smtp = useFetchSmtp(ownerId);\n\n const integrations = [\n { type: \"gmail\", hook: gmail },\n { type: \"outlook\", hook: outlook },\n { type: \"sparkpost\", hook: sparkpost },\n { type: \"smtp\", hook: smtp },\n ];\n\n const hooks = pluck(\"hook\", integrations);\n\n const isLoading = existsBy({ isLoading: true }, hooks);\n const isError = existsBy({ isError: true }, hooks);\n\n const connectedIntegration = integrations.find(\n ({ hook }) => hook.isSuccess && hook?.data?.connected\n );\n\n const pendingIntegration = !connectedIntegration\n ? integrations.find(\n ({ hook }) =>\n hook.isSuccess && hook?.data?.exists && !hook?.data?.connected\n )\n : null;\n\n const activeIntegration = connectedIntegration || pendingIntegration;\n\n const integration = activeIntegration\n ? {\n type: activeIntegration.type,\n data: activeIntegration.hook?.data,\n isPending: !activeIntegration.hook?.data?.connected,\n }\n : null;\n\n return { integration, isLoading, isError };\n};\n"],"names":["useFetchConnectedIntegration","ownerId","_activeIntegration$ho","_activeIntegration$ho2","gmail","useFetchGmail","outlook","useFetchOutlook","sparkpost","useFetchSparkpostDomain","smtp","useFetchSmtp","integrations","type","hook","hooks","pluck","isLoading","existsBy","isError","connectedIntegration","find","_ref","_hook$data","isSuccess","data","connected","pendingIntegration","_ref2","_hook$data2","_hook$data3","exists","activeIntegration","integration","isPending"],"mappings":";;;;;;IAQaA,4BAA4B,GAAG,SAA/BA,4BAA4BA,CAAGC,OAAO,EAAI;EAAA,IAAAC,qBAAA,EAAAC,sBAAA;AACrD,EAAA,IAAMC,KAAK,GAAGC,6BAAa,CAACJ,OAAO,CAAC;AACpC,EAAA,IAAMK,OAAO,GAAGC,+BAAe,CAACN,OAAO,CAAC;AACxC,EAAA,IAAMO,SAAS,GAAGC,uCAAuB,CAACR,OAAO,CAAC;AAClD,EAAA,IAAMS,IAAI,GAAGC,4BAAY,CAACV,OAAO,CAAC;EAElC,IAAMW,YAAY,GAAG,CACnB;AAAEC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CAAAe,WAAA,GAAJf,IAAI,CAAEW,IAAI,MAAA,IAAA,IAAAI,WAAA,KAAA,MAAA,GAAA,MAAA,GAAVA,WAAA,CAAYE,MAAM,KAAI,EAACjB,IAAI,KAAA,IAAA,IAAJA,IAAI,gBAAAgB,WAAA,GAAJhB,IAAI,CAAEW,IAAI,MAAA,IAAA,IAAAK,WAAA,KAAA,MAAA,IAAVA,WAAA,CAAYJ,SAAS,CAAA;EAAA,CAClE,CAAC,GACD,IAAI;AAER,EAAA,IAAMM,iBAAiB,GAAGZ,oBAAoB,IAAIO,kBAAkB;EAEpE,IAAMM,WAAW,GAAGD,iBAAiB,GACjC;IACEnB,IAAI,EAAEmB,iBAAiB,CAACnB,IAAI;IAC5BY,IAAI,EAAA,CAAAvB,qBAAA,GAAE8B,iBAAiB,CAAClB,IAAI,MAAA,IAAA,IAAAZ,qBAAA,KAAA,MAAA,GAAA,MAAA,GAAtBA,qBAAA,CAAwBuB,IAAI;IAClCS,SAAS,EAAE,GAAA/B,sBAAA,GAAC6B,iBAAiB,CAAClB,IAAI,cAAAX,sBAAA,KAAA,MAAA,IAAA,CAAAA,sBAAA,GAAtBA,sBAAA,CAAwBsB,IAAI,MAAA,IAAA,IAAAtB,sBAAA,KAAA,MAAA,IAA5BA,sBAAA,CAA8BuB,SAAS;AACrD,GAAC,GACD,IAAI;EAER,OAAO;AAAEO,IAAAA,WAAW,EAAXA,WAAW;AAAEhB,IAAAA,SAAS,EAATA,SAAS;AAAEE,IAAAA,OAAO,EAAPA;GAAS;AAC5C;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { existsBy } from '@bigbinary/neeto-cist';
|
|
2
2
|
import { pluck } from 'ramda';
|
|
3
|
-
import { u as useFetchGmail, a as useFetchOutlook, b as useFetchSparkpostDomain, c as useFetchSmtp } from './useSparkpostApi-
|
|
3
|
+
import { u as useFetchGmail, a as useFetchOutlook, b as useFetchSparkpostDomain, c as useFetchSmtp } from './useSparkpostApi-B-D8RNRF.js';
|
|
4
4
|
|
|
5
5
|
var useFetchConnectedIntegration = function useFetchConnectedIntegration(ownerId) {
|
|
6
6
|
var _activeIntegration$ho, _activeIntegration$ho2;
|
|
@@ -52,4 +52,4 @@ var useFetchConnectedIntegration = function useFetchConnectedIntegration(ownerId
|
|
|
52
52
|
};
|
|
53
53
|
|
|
54
54
|
export { useFetchConnectedIntegration as u };
|
|
55
|
-
//# sourceMappingURL=useEmailDeliveryIntegrationApi-
|
|
55
|
+
//# sourceMappingURL=useEmailDeliveryIntegrationApi-Dk9WPotT.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEmailDeliveryIntegrationApi-
|
|
1
|
+
{"version":3,"file":"useEmailDeliveryIntegrationApi-Dk9WPotT.js","sources":["../app/javascript/src/hooks/reactQuery/integrations/useEmailDeliveryIntegrationApi.js"],"sourcesContent":["import { existsBy } from \"neetocist\";\nimport { pluck } from \"ramda\";\n\nimport { useFetchGmail } from \"./useGmailIntegrationApi\";\nimport { useFetchOutlook } from \"./useOutlookIntegrationApi\";\nimport { useFetchSmtp } from \"./useSmtpIntegrationApi\";\nimport { useFetchSparkpostDomain } from \"./useSparkpostApi\";\n\nexport const useFetchConnectedIntegration = ownerId => {\n const gmail = useFetchGmail(ownerId);\n const outlook = useFetchOutlook(ownerId);\n const sparkpost = useFetchSparkpostDomain(ownerId);\n const smtp = useFetchSmtp(ownerId);\n\n const integrations = [\n { type: \"gmail\", hook: gmail },\n { type: \"outlook\", hook: outlook },\n { type: \"sparkpost\", hook: sparkpost },\n { type: \"smtp\", hook: smtp },\n ];\n\n const hooks = pluck(\"hook\", integrations);\n\n const isLoading = existsBy({ isLoading: true }, hooks);\n const isError = existsBy({ isError: true }, hooks);\n\n const connectedIntegration = integrations.find(\n ({ hook }) => hook.isSuccess && hook?.data?.connected\n );\n\n const pendingIntegration = !connectedIntegration\n ? integrations.find(\n ({ hook }) =>\n hook.isSuccess && hook?.data?.exists && !hook?.data?.connected\n )\n : null;\n\n const activeIntegration = connectedIntegration || pendingIntegration;\n\n const integration = activeIntegration\n ? {\n type: activeIntegration.type,\n data: activeIntegration.hook?.data,\n isPending: !activeIntegration.hook?.data?.connected,\n }\n : null;\n\n return { integration, isLoading, isError };\n};\n"],"names":["useFetchConnectedIntegration","ownerId","_activeIntegration$ho","_activeIntegration$ho2","gmail","useFetchGmail","outlook","useFetchOutlook","sparkpost","useFetchSparkpostDomain","smtp","useFetchSmtp","integrations","type","hook","hooks","pluck","isLoading","existsBy","isError","connectedIntegration","find","_ref","_hook$data","isSuccess","data","connected","pendingIntegration","_ref2","_hook$data2","_hook$data3","exists","activeIntegration","integration","isPending"],"mappings":";;;;IAQaA,4BAA4B,GAAG,SAA/BA,4BAA4BA,CAAGC,OAAO,EAAI;EAAA,IAAAC,qBAAA,EAAAC,sBAAA;AACrD,EAAA,IAAMC,KAAK,GAAGC,aAAa,CAACJ,OAAO,CAAC;AACpC,EAAA,IAAMK,OAAO,GAAGC,eAAe,CAACN,OAAO,CAAC;AACxC,EAAA,IAAMO,SAAS,GAAGC,uBAAuB,CAACR,OAAO,CAAC;AAClD,EAAA,IAAMS,IAAI,GAAGC,YAAY,CAACV,OAAO,CAAC;EAElC,IAAMW,YAAY,GAAG,CACnB;AAAEC,IAAAA,IAAI,EAAE,OAAO;AAAEC,IAAAA,IAAI,EAAEV;AAAM,GAAC,EAC9B;AAAES,IAAAA,IAAI,EAAE,SAAS;AAAEC,IAAAA,IAAI,EAAER;AAAQ,GAAC,EAClC;AAAEO,IAAAA,IAAI,EAAE,WAAW;AAAEC,IAAAA,IAAI,EAAEN;AAAU,GAAC,EACtC;AAAEK,IAAAA,IAAI,EAAE,MAAM;AAAEC,IAAAA,IAAI,EAAEJ;AAAK,GAAC,CAC7B;AAED,EAAA,IAAMK,KAAK,GAAGC,KAAK,CAAC,MAAM,EAAEJ,YAAY,CAAC;EAEzC,IAAMK,SAAS,GAAGC,QAAQ,CAAC;AAAED,IAAAA,SAAS,EAAE;GA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C5BY,IAAI,EAAA,CAAAvB,qBAAA,GAAE8B,iBAAiB,CAAClB,IAAI,MAAA,IAAA,IAAAZ,qBAAA,KAAA,MAAA,GAAA,MAAA,GAAtBA,qBAAA,CAAwBuB,IAAI;IAClCS,SAAS,EAAE,GAAA/B,sBAAA,GAAC6B,iBAAiB,CAAClB,IAAI,cAAAX,sBAAA,KAAA,MAAA,IAAA,CAAAA,sBAAA,GAAtBA,sBAAA,CAAwBsB,IAAI,MAAA,IAAA,IAAAtB,sBAAA,KAAA,MAAA,IAA5BA,sBAAA,CAA8BuB,SAAS;AACrD,GAAC,GACD,IAAI;EAER,OAAO;AAAEO,IAAAA,WAAW,EAAXA,WAAW;AAAEhB,IAAAA,SAAS,EAATA,SAAS;AAAEE,IAAAA,OAAO,EAAPA;GAAS;AAC5C;;;;"}
|
|
@@ -46,7 +46,7 @@ var QUERY_KEYS = {
|
|
|
46
46
|
};
|
|
47
47
|
|
|
48
48
|
function ownKeys$3(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; }
|
|
49
|
-
function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t),
|
|
49
|
+
function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
50
50
|
var useFetchGmail = function useFetchGmail(ownerId, options) {
|
|
51
51
|
return useQuery(_objectSpread$3({
|
|
52
52
|
queryKey: [QUERY_KEYS.INTEGRATION_GMAIL, ownerId],
|
|
@@ -96,7 +96,7 @@ var outlookApi = {
|
|
|
96
96
|
};
|
|
97
97
|
|
|
98
98
|
function ownKeys$2(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; }
|
|
99
|
-
function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t),
|
|
99
|
+
function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
100
100
|
var useFetchOutlook = function useFetchOutlook(ownerId, options) {
|
|
101
101
|
return useQuery(_objectSpread$2({
|
|
102
102
|
queryKey: [QUERY_KEYS.INTEGRATION_OUTLOOK, ownerId],
|
|
@@ -139,7 +139,7 @@ var smtpApi = {
|
|
|
139
139
|
};
|
|
140
140
|
|
|
141
141
|
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; }
|
|
142
|
-
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),
|
|
142
|
+
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; }
|
|
143
143
|
var useFetchSmtp = function useFetchSmtp(ownerId, options) {
|
|
144
144
|
return useQuery(_objectSpread$1({
|
|
145
145
|
queryKey: [QUERY_KEYS.INTEGRATION_SMTP, ownerId],
|
|
@@ -199,7 +199,7 @@ var sparkpostDomainsApi = {
|
|
|
199
199
|
};
|
|
200
200
|
|
|
201
201
|
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; }
|
|
202
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t),
|
|
202
|
+
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; }
|
|
203
203
|
var useFetchSparkpostDomain = function useFetchSparkpostDomain(ownerId, options) {
|
|
204
204
|
return useQuery(_objectSpread({
|
|
205
205
|
queryKey: [QUERY_KEYS.INTEGRATION_SPARKPOST, ownerId],
|
|
@@ -235,4 +235,4 @@ var useDestroySparkpostDomain = function useDestroySparkpostDomain(_ref3) {
|
|
|
235
235
|
};
|
|
236
236
|
|
|
237
237
|
export { GMAIL_OAUTH_CONNECT_URL as G, OUTLOOK_OAUTH_CONNECT_URL as O, useFetchOutlook as a, useFetchSparkpostDomain as b, useFetchSmtp as c, useCreateSparkpostDomain as d, useVerifySparkpostDomain as e, useDestroySparkpostDomain as f, useCreateSmtp as g, useDestroyGmail as h, invalidateAllIntegrationQueries as i, useDestroyOutlook as j, useDestroySmtp as k, useFetchGmail as u };
|
|
238
|
-
//# sourceMappingURL=useSparkpostApi-
|
|
238
|
+
//# sourceMappingURL=useSparkpostApi-B-D8RNRF.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSparkpostApi-C7cHCa3T.js","sources":["../app/javascript/src/apis/integrations/constants.js","../app/javascript/src/apis/integrations/gmail.js","../app/javascript/src/constants/query.js","../app/javascript/src/hooks/reactQuery/integrations/useGmailIntegrationApi.js","../app/javascript/src/utils.js","../app/javascript/src/apis/integrations/outlook.js","../app/javascript/src/hooks/reactQuery/integrations/useOutlookIntegrationApi.js","../app/javascript/src/apis/integrations/smtp.js","../app/javascript/src/hooks/reactQuery/integrations/useSmtpIntegrationApi.js","../app/javascript/src/apis/integrations/sparkpost_domains.js","../app/javascript/src/hooks/reactQuery/integrations/useSparkpostApi.js"],"sourcesContent":["/* eslint-disable @bigbinary/neeto/api-connector-should-use-default-export */\n\nconst NEETO_EMAIL_DELIVERY_ENGINE_BASE_URL = \"/neeto_email_delivery/api/v1\";\n\nexport const GMAIL_URL = `${NEETO_EMAIL_DELIVERY_ENGINE_BASE_URL}/gmail`;\nexport const GMAIL_OAUTH_URL = `${NEETO_EMAIL_DELIVERY_ENGINE_BASE_URL}/integrations/gmail/oauth/:ownerId`;\nexport const GMAIL_OAUTH_CONNECT_URL = `${NEETO_EMAIL_DELIVERY_ENGINE_BASE_URL}/integrations/gmail/oauth/connect`;\n\nexport const OUTLOOK_URL = `${NEETO_EMAIL_DELIVERY_ENGINE_BASE_URL}/outlook`;\nexport const OUTLOOK_OAUTH_URL = `${NEETO_EMAIL_DELIVERY_ENGINE_BASE_URL}/integrations/outlook/oauth/:ownerId`;\nexport const OUTLOOK_OAUTH_CONNECT_URL = `${NEETO_EMAIL_DELIVERY_ENGINE_BASE_URL}/integrations/outlook/oauth/connect`;\n\nexport const SPARKPOST_DOMAINS_URL = `${NEETO_EMAIL_DELIVERY_ENGINE_BASE_URL}/sparkpost_domains`;\nexport const SPARKPOST_DOMAINS_INTEGRATIONS_URL = `${NEETO_EMAIL_DELIVERY_ENGINE_BASE_URL}/integrations/sparkpost_domains`;\nexport const SPARKPOST_DOMAINS_VERIFY_URL = `${SPARKPOST_DOMAINS_INTEGRATIONS_URL}/verify`;\n\nexport const SMTP_URL = `${NEETO_EMAIL_DELIVERY_ENGINE_BASE_URL}/smtp`;\n","import axios from \"axios\";\nimport { buildUrl } from \"neetocommons/utils\";\n\nimport { GMAIL_URL, GMAIL_OAUTH_URL } from \"./constants\";\n\nconst get = ownerId =>\n axios.get(buildUrl(GMAIL_URL, { ownerId }), { showToastr: false });\n\nconst destroy = ownerId => {\n axios.delete(buildUrl(GMAIL_OAUTH_URL, { ownerId }), { showToastr: false });\n};\n\nconst gmailApi = { get, destroy };\n\nexport default gmailApi;\n","export const QUERY_KEYS = {\n INTEGRATION_GMAIL: \"integration-gmail\",\n INTEGRATION_OUTLOOK: \"integration-outlook\",\n INTEGRATION_SPARKPOST: \"integration-sparkpost\",\n INTEGRATION_SMTP: \"integration-smtp\",\n};\n","import { useQuery } from \"@tanstack/react-query\";\nimport { useMutationWithInvalidation } from \"neetocommons/react-utils\";\n\nimport gmailApi from \"apis/integrations/gmail\";\nimport { QUERY_KEYS } from \"src/constants/query\";\n\nexport const useFetchGmail = (ownerId, options) =>\n useQuery({\n queryKey: [QUERY_KEYS.INTEGRATION_GMAIL, ownerId],\n queryFn: () => gmailApi.get(ownerId),\n retry: 1,\n ...options,\n });\n\nexport const useDestroyGmail = ({ ownerId }) =>\n useMutationWithInvalidation(() => gmailApi.destroy(ownerId), {\n keysToInvalidate: [[QUERY_KEYS.INTEGRATION_GMAIL, ownerId]],\n });\n","import { QUERY_KEYS } from \"src/constants/query\";\n\nexport const invalidateAllIntegrationQueries = (queryClient, ownerId) => {\n queryClient.invalidateQueries({\n predicate: query => {\n const [key, id] = query.queryKey;\n\n return (\n id === ownerId &&\n [\n QUERY_KEYS.INTEGRATION_GMAIL,\n QUERY_KEYS.INTEGRATION_OUTLOOK,\n QUERY_KEYS.INTEGRATION_SPARKPOST,\n QUERY_KEYS.INTEGRATION_SMTP,\n ].includes(key)\n );\n },\n });\n};\n","import axios from \"axios\";\nimport { buildUrl } from \"neetocommons/utils\";\n\nimport { OUTLOOK_URL, OUTLOOK_OAUTH_URL } from \"./constants\";\n\nconst get = ownerId =>\n axios.get(buildUrl(OUTLOOK_URL, { ownerId }), { showToastr: false });\n\nconst destroy = ownerId => {\n axios.delete(buildUrl(OUTLOOK_OAUTH_URL, { ownerId }), { showToastr: false });\n};\n\nconst outlookApi = { get, destroy };\n\nexport default outlookApi;\n","import { useQuery } from \"@tanstack/react-query\";\nimport { useMutationWithInvalidation } from \"neetocommons/react-utils\";\n\nimport outlookApi from \"apis/integrations/outlook\";\nimport { QUERY_KEYS } from \"src/constants/query\";\n\nexport const useFetchOutlook = (ownerId, options) =>\n useQuery({\n queryKey: [QUERY_KEYS.INTEGRATION_OUTLOOK, ownerId],\n queryFn: () => outlookApi.get(ownerId),\n retry: 1,\n ...options,\n });\n\nexport const useDestroyOutlook = ({ ownerId }) =>\n useMutationWithInvalidation(() => outlookApi.destroy(ownerId), {\n keysToInvalidate: [[QUERY_KEYS.INTEGRATION_OUTLOOK, ownerId]],\n });\n","import axios from \"axios\";\nimport { buildUrl } from \"neetocommons/utils\";\n\nimport { SMTP_URL } from \"./constants\";\n\nconst get = ownerId =>\n axios.get(buildUrl(SMTP_URL, { ownerId }), { showToastr: false });\n\nconst create = (ownerId, payload) =>\n axios.post(buildUrl(SMTP_URL, { ownerId }), payload);\n\nconst destroy = ownerId => axios.delete(buildUrl(SMTP_URL, { ownerId }));\n\nconst smtpApi = { get, create, destroy };\n\nexport default smtpApi;\n","import { useQuery, useQueryClient } from \"@tanstack/react-query\";\nimport { useMutationWithInvalidation } from \"neetocommons/react-utils\";\n\nimport smtpApi from \"apis/integrations/smtp\";\nimport { QUERY_KEYS } from \"src/constants/query\";\nimport { invalidateAllIntegrationQueries } from \"utils\";\n\nexport const useFetchSmtp = (ownerId, options) =>\n useQuery({\n queryKey: [QUERY_KEYS.INTEGRATION_SMTP, ownerId],\n queryFn: () => smtpApi.get(ownerId),\n retry: 1,\n ...options,\n });\n\nexport const useCreateSmtp = ({ ownerId }) =>\n useMutationWithInvalidation(payload => smtpApi.create(ownerId, payload), {\n keysToInvalidate: [[QUERY_KEYS.INTEGRATION_SMTP, ownerId]],\n });\n\nexport const useDestroySmtp = ({ ownerId }) => {\n const queryClient = useQueryClient();\n\n return useMutationWithInvalidation(() => smtpApi.destroy(ownerId), {\n keysToInvalidate: [\n [QUERY_KEYS.INTEGRATION_SMTP, ownerId],\n () => invalidateAllIntegrationQueries(queryClient, ownerId),\n ],\n });\n};\n","import axios from \"axios\";\nimport { buildUrl } from \"neetocommons/utils\";\n\nimport {\n SPARKPOST_DOMAINS_URL,\n SPARKPOST_DOMAINS_VERIFY_URL,\n SPARKPOST_DOMAINS_INTEGRATIONS_URL,\n} from \"./constants\";\n\nconst get = ownerId =>\n axios.get(buildUrl(SPARKPOST_DOMAINS_URL, { ownerId }), {\n showToastr: false,\n });\n\nconst create = (ownerId, payload) =>\n axios.post(\n buildUrl(SPARKPOST_DOMAINS_INTEGRATIONS_URL, { ownerId }),\n payload\n );\n\nconst verify = ownerId =>\n axios.post(buildUrl(SPARKPOST_DOMAINS_VERIFY_URL, { ownerId }));\n\nconst destroy = ownerId =>\n axios.delete(buildUrl(SPARKPOST_DOMAINS_INTEGRATIONS_URL, { ownerId }));\n\nconst sparkpostDomainsApi = { get, create, verify, destroy };\n\nexport default sparkpostDomainsApi;\n","import { useQuery } from \"@tanstack/react-query\";\nimport { useMutationWithInvalidation } from \"neetocommons/react-utils\";\n\nimport sparkpostDomainsApi from \"apis/integrations/sparkpost_domains\";\nimport { QUERY_KEYS } from \"src/constants/query\";\n\nexport const useFetchSparkpostDomain = (ownerId, options) =>\n useQuery({\n queryKey: [QUERY_KEYS.INTEGRATION_SPARKPOST, ownerId],\n queryFn: () => sparkpostDomainsApi.get(ownerId),\n retry: 1,\n ...options,\n });\n\nexport const useCreateSparkpostDomain = ({ ownerId }) =>\n useMutationWithInvalidation(\n payload => sparkpostDomainsApi.create(ownerId, payload),\n { keysToInvalidate: [[QUERY_KEYS.INTEGRATION_SPARKPOST, ownerId]] }\n );\n\nexport const useVerifySparkpostDomain = ({ ownerId }) =>\n useMutationWithInvalidation(() => sparkpostDomainsApi.verify(ownerId), {\n keysToInvalidate: [[QUERY_KEYS.INTEGRATION_SPARKPOST, ownerId]],\n });\n\nexport const useDestroySparkpostDomain = ({ ownerId }) =>\n useMutationWithInvalidation(() => sparkpostDomainsApi.destroy(ownerId), {\n keysToInvalidate: [[QUERY_KEYS.INTEGRATION_SPARKPOST, ownerId]],\n });\n"],"names":["NEETO_EMAIL_DELIVERY_ENGINE_BASE_URL","GMAIL_URL","concat","GMAIL_OAUTH_URL","GMAIL_OAUTH_CONNECT_URL","OUTLOOK_URL","OUTLOOK_OAUTH_URL","OUTLOOK_OAUTH_CONNECT_URL","SPARKPOST_DOMAINS_URL","SPARKPOST_DOMAINS_INTEGRATIONS_URL","SPARKPOST_DOMAINS_VERIFY_URL","SMTP_URL","get","ownerId","axios","buildUrl","showToastr","destroy","gmailApi","QUERY_KEYS","INTEGRATION_GMAIL","INTEGRATION_OUTLOOK","INTEGRATION_SPARKPOST","INTEGRATION_SMTP","useFetchGmail","options","useQuery","_objectSpread","queryKey","queryFn","retry","useDestroyGmail","_ref","useMutationWithInvalidation","keysToInvalidate","invalidateAllIntegrationQueries","queryClient","invalidateQueries","predicate","query","_query$queryKey","_slicedToArray","key","id","includes","outlookApi","useFetchOutlook","useDestroyOutlook","create","payload","post","smtpApi","useFetchSmtp","useCreateSmtp","useDestroySmtp","_ref2","useQueryClient","verify","sparkpost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;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"useSparkpostApi-B-D8RNRF.js","sources":["../app/javascript/src/apis/integrations/constants.js","../app/javascript/src/apis/integrations/gmail.js","../app/javascript/src/constants/query.js","../app/javascript/src/hooks/reactQuery/integrations/useGmailIntegrationApi.js","../app/javascript/src/utils.js","../app/javascript/src/apis/integrations/outlook.js","../app/javascript/src/hooks/reactQuery/integrations/useOutlookIntegrationApi.js","../app/javascript/src/apis/integrations/smtp.js","../app/javascript/src/hooks/reactQuery/integrations/useSmtpIntegrationApi.js","../app/javascript/src/apis/integrations/sparkpost_domains.js","../app/javascript/src/hooks/reactQuery/integrations/useSparkpostApi.js"],"sourcesContent":["/* eslint-disable @bigbinary/neeto/api-connector-should-use-default-export */\n\nconst NEETO_EMAIL_DELIVERY_ENGINE_BASE_URL = \"/neeto_email_delivery/api/v1\";\n\nexport const GMAIL_URL = `${NEETO_EMAIL_DELIVERY_ENGINE_BASE_URL}/gmail`;\nexport const GMAIL_OAUTH_URL = `${NEETO_EMAIL_DELIVERY_ENGINE_BASE_URL}/integrations/gmail/oauth/:ownerId`;\nexport const GMAIL_OAUTH_CONNECT_URL = `${NEETO_EMAIL_DELIVERY_ENGINE_BASE_URL}/integrations/gmail/oauth/connect`;\n\nexport const OUTLOOK_URL = `${NEETO_EMAIL_DELIVERY_ENGINE_BASE_URL}/outlook`;\nexport const OUTLOOK_OAUTH_URL = `${NEETO_EMAIL_DELIVERY_ENGINE_BASE_URL}/integrations/outlook/oauth/:ownerId`;\nexport const OUTLOOK_OAUTH_CONNECT_URL = `${NEETO_EMAIL_DELIVERY_ENGINE_BASE_URL}/integrations/outlook/oauth/connect`;\n\nexport const SPARKPOST_DOMAINS_URL = `${NEETO_EMAIL_DELIVERY_ENGINE_BASE_URL}/sparkpost_domains`;\nexport const SPARKPOST_DOMAINS_INTEGRATIONS_URL = `${NEETO_EMAIL_DELIVERY_ENGINE_BASE_URL}/integrations/sparkpost_domains`;\nexport const SPARKPOST_DOMAINS_VERIFY_URL = `${SPARKPOST_DOMAINS_INTEGRATIONS_URL}/verify`;\n\nexport const SMTP_URL = `${NEETO_EMAIL_DELIVERY_ENGINE_BASE_URL}/smtp`;\n","import axios from \"axios\";\nimport { buildUrl } from \"neetocommons/utils\";\n\nimport { GMAIL_URL, GMAIL_OAUTH_URL } from \"./constants\";\n\nconst get = ownerId =>\n axios.get(buildUrl(GMAIL_URL, { ownerId }), { showToastr: false });\n\nconst destroy = ownerId => {\n axios.delete(buildUrl(GMAIL_OAUTH_URL, { ownerId }), { showToastr: false });\n};\n\nconst gmailApi = { get, destroy };\n\nexport default gmailApi;\n","export const QUERY_KEYS = {\n INTEGRATION_GMAIL: \"integration-gmail\",\n INTEGRATION_OUTLOOK: \"integration-outlook\",\n INTEGRATION_SPARKPOST: \"integration-sparkpost\",\n INTEGRATION_SMTP: \"integration-smtp\",\n};\n","import { useQuery } from \"@tanstack/react-query\";\nimport { useMutationWithInvalidation } from \"neetocommons/react-utils\";\n\nimport gmailApi from \"apis/integrations/gmail\";\nimport { QUERY_KEYS } from \"src/constants/query\";\n\nexport const useFetchGmail = (ownerId, options) =>\n useQuery({\n queryKey: [QUERY_KEYS.INTEGRATION_GMAIL, ownerId],\n queryFn: () => gmailApi.get(ownerId),\n retry: 1,\n ...options,\n });\n\nexport const useDestroyGmail = ({ ownerId }) =>\n useMutationWithInvalidation(() => gmailApi.destroy(ownerId), {\n keysToInvalidate: [[QUERY_KEYS.INTEGRATION_GMAIL, ownerId]],\n });\n","import { QUERY_KEYS } from \"src/constants/query\";\n\nexport const invalidateAllIntegrationQueries = (queryClient, ownerId) => {\n queryClient.invalidateQueries({\n predicate: query => {\n const [key, id] = query.queryKey;\n\n return (\n id === ownerId &&\n [\n QUERY_KEYS.INTEGRATION_GMAIL,\n QUERY_KEYS.INTEGRATION_OUTLOOK,\n QUERY_KEYS.INTEGRATION_SPARKPOST,\n QUERY_KEYS.INTEGRATION_SMTP,\n ].includes(key)\n );\n },\n });\n};\n","import axios from \"axios\";\nimport { buildUrl } from \"neetocommons/utils\";\n\nimport { OUTLOOK_URL, OUTLOOK_OAUTH_URL } from \"./constants\";\n\nconst get = ownerId =>\n axios.get(buildUrl(OUTLOOK_URL, { ownerId }), { showToastr: false });\n\nconst destroy = ownerId => {\n axios.delete(buildUrl(OUTLOOK_OAUTH_URL, { ownerId }), { showToastr: false });\n};\n\nconst outlookApi = { get, destroy };\n\nexport default outlookApi;\n","import { useQuery } from \"@tanstack/react-query\";\nimport { useMutationWithInvalidation } from \"neetocommons/react-utils\";\n\nimport outlookApi from \"apis/integrations/outlook\";\nimport { QUERY_KEYS } from \"src/constants/query\";\n\nexport const useFetchOutlook = (ownerId, options) =>\n useQuery({\n queryKey: [QUERY_KEYS.INTEGRATION_OUTLOOK, ownerId],\n queryFn: () => outlookApi.get(ownerId),\n retry: 1,\n ...options,\n });\n\nexport const useDestroyOutlook = ({ ownerId }) =>\n useMutationWithInvalidation(() => outlookApi.destroy(ownerId), {\n keysToInvalidate: [[QUERY_KEYS.INTEGRATION_OUTLOOK, ownerId]],\n });\n","import axios from \"axios\";\nimport { buildUrl } from \"neetocommons/utils\";\n\nimport { SMTP_URL } from \"./constants\";\n\nconst get = ownerId =>\n axios.get(buildUrl(SMTP_URL, { ownerId }), { showToastr: false });\n\nconst create = (ownerId, payload) =>\n axios.post(buildUrl(SMTP_URL, { ownerId }), payload);\n\nconst destroy = ownerId => axios.delete(buildUrl(SMTP_URL, { ownerId }));\n\nconst smtpApi = { get, create, destroy };\n\nexport default smtpApi;\n","import { useQuery, useQueryClient } from \"@tanstack/react-query\";\nimport { useMutationWithInvalidation } from \"neetocommons/react-utils\";\n\nimport smtpApi from \"apis/integrations/smtp\";\nimport { QUERY_KEYS } from \"src/constants/query\";\nimport { invalidateAllIntegrationQueries } from \"utils\";\n\nexport const useFetchSmtp = (ownerId, options) =>\n useQuery({\n queryKey: [QUERY_KEYS.INTEGRATION_SMTP, ownerId],\n queryFn: () => smtpApi.get(ownerId),\n retry: 1,\n ...options,\n });\n\nexport const useCreateSmtp = ({ ownerId }) =>\n useMutationWithInvalidation(payload => smtpApi.create(ownerId, payload), {\n keysToInvalidate: [[QUERY_KEYS.INTEGRATION_SMTP, ownerId]],\n });\n\nexport const useDestroySmtp = ({ ownerId }) => {\n const queryClient = useQueryClient();\n\n return useMutationWithInvalidation(() => smtpApi.destroy(ownerId), {\n keysToInvalidate: [\n [QUERY_KEYS.INTEGRATION_SMTP, ownerId],\n () => invalidateAllIntegrationQueries(queryClient, ownerId),\n ],\n });\n};\n","import axios from \"axios\";\nimport { buildUrl } from \"neetocommons/utils\";\n\nimport {\n SPARKPOST_DOMAINS_URL,\n SPARKPOST_DOMAINS_VERIFY_URL,\n SPARKPOST_DOMAINS_INTEGRATIONS_URL,\n} from \"./constants\";\n\nconst get = ownerId =>\n axios.get(buildUrl(SPARKPOST_DOMAINS_URL, { ownerId }), {\n showToastr: false,\n });\n\nconst create = (ownerId, payload) =>\n axios.post(\n buildUrl(SPARKPOST_DOMAINS_INTEGRATIONS_URL, { ownerId }),\n payload\n );\n\nconst verify = ownerId =>\n axios.post(buildUrl(SPARKPOST_DOMAINS_VERIFY_URL, { ownerId }));\n\nconst destroy = ownerId =>\n axios.delete(buildUrl(SPARKPOST_DOMAINS_INTEGRATIONS_URL, { ownerId }));\n\nconst sparkpostDomainsApi = { get, create, verify, destroy };\n\nexport default sparkpostDomainsApi;\n","import { useQuery } from \"@tanstack/react-query\";\nimport { useMutationWithInvalidation } from \"neetocommons/react-utils\";\n\nimport sparkpostDomainsApi from \"apis/integrations/sparkpost_domains\";\nimport { QUERY_KEYS } from \"src/constants/query\";\n\nexport const useFetchSparkpostDomain = (ownerId, options) =>\n useQuery({\n queryKey: [QUERY_KEYS.INTEGRATION_SPARKPOST, ownerId],\n queryFn: () => sparkpostDomainsApi.get(ownerId),\n retry: 1,\n ...options,\n });\n\nexport const useCreateSparkpostDomain = ({ ownerId }) =>\n useMutationWithInvalidation(\n payload => sparkpostDomainsApi.create(ownerId, payload),\n { keysToInvalidate: [[QUERY_KEYS.INTEGRATION_SPARKPOST, ownerId]] }\n );\n\nexport const useVerifySparkpostDomain = ({ ownerId }) =>\n useMutationWithInvalidation(() => sparkpostDomainsApi.verify(ownerId), {\n keysToInvalidate: [[QUERY_KEYS.INTEGRATION_SPARKPOST, ownerId]],\n });\n\nexport const useDestroySparkpostDomain = ({ ownerId }) =>\n useMutationWithInvalidation(() => sparkpostDomainsApi.destroy(ownerId), {\n keysToInvalidate: [[QUERY_KEYS.INTEGRATION_SPARKPOST, ownerId]],\n });\n"],"names":["NEETO_EMAIL_DELIVERY_ENGINE_BASE_URL","GMAIL_URL","concat","GMAIL_OAUTH_URL","GMAIL_OAUTH_CONNECT_URL","OUTLOOK_URL","OUTLOOK_OAUTH_URL","OUTLOOK_OAUTH_CONNECT_URL","SPARKPOST_DOMAINS_URL","SPARKPOST_DOMAINS_INTEGRATIONS_URL","SPARKPOST_DOMAINS_VERIFY_URL","SMTP_URL","get","ownerId","axios","buildUrl","showToastr","destroy","gmailApi","QUERY_KEYS","INTEGRATION_GMAIL","INTEGRATION_OUTLOOK","INTEGRATION_SPARKPOST","INTEGRATION_SMTP","useFetchGmail","options","useQuery","_objectSpread","queryKey","queryFn","retry","useDestroyGmail","_ref","useMutationWithInvalidation","keysToInvalidate","invalidateAllIntegrationQueries","queryClient","invalidateQueries","predicate","query","_query$queryKey","_slicedToArray","key","id","includes","outlookApi","useFetchOutlook","useDestroyOutlook","create","payload","post","smtpApi","useFetchSmtp","useCreateSmtp","useDestroySmtp","_ref2","useQueryClient","verify","sparkpostDomainsApi","useFetchSparkpostDomain","useCreateSparkpostDomain","useVerifySparkpostDomain","useDestroySparkpostDomain","_ref3"],"mappings":";;;;;;;AAAA;;AAEA,IAAMA,oCAAoC,GAAG,8BAA8B;AAEpE,IAAMC,SAAS,GAAA,EAAA,CAAAC,MAAA,CAAMF,oCAAoC,EAAA,QAAA,CAAQ;AACjE,IAAMG,eA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K,EAAE;GAAC,EACLL,OAAO,CACX,CAAC;AAAA;IAESmC,wBAAwB,GAAG,SAA3BA,wBAAwBA,CAAA5B,IAAA,EAAA;AAAA,EAAA,IAAMnB,OAAO,GAAAmB,IAAA,CAAPnB,OAAO;EAAA,OAChDoB,2BAA2B,CACzB,UAAAgB,OAAO,EAAA;AAAA,IAAA,OAAIS,mBAAmB,CAACV,MAAM,CAACnC,OAAO,EAAEoC,OAAO,CAAC;EAAA,CAAA,EACvD;IAAEf,gBAAgB,EAAE,CAAC,CAACf,UAAU,CAACG,qBAAqB,EAAET,OAAO,CAAC;AAAE,GACpE,CAAC;AAAA;IAEUgD,wBAAwB,GAAG,SAA3BA,wBAAwBA,CAAAN,KAAA,EAAA;AAAA,EAAA,IAAM1C,OAAO,GAAA0C,KAAA,CAAP1C,OAAO;AAAA,EAAA,OAChDoB,2BAA2B,CAAC,YAAA;AAAA,IAAA,OAAMyB,mBAAmB,CAACD,MAAM,CAAC5C,OAAO,CAAC;EAAA,CAAA,EAAE;IACrEqB,gBAAgB,EAAE,CAAC,CAACf,UAAU,CAACG,qBAAqB,EAAET,OAAO,CAAC;AAChE,GAAC,CAAC;AAAA;IAESiD,yBAAyB,GAAG,SAA5BA,yBAAyBA,CAAAC,KAAA,EAAA;AAAA,EAAA,IAAMlD,OAAO,GAAAkD,KAAA,CAAPlD,OAAO;AAAA,EAAA,OACjDoB,2BAA2B,CAAC,YAAA;AAAA,IAAA,OAAMyB,mBAAmB,CAACzC,OAAO,CAACJ,OAAO,CAAC;EAAA,CAAA,EAAE;IACtEqB,gBAAgB,EAAE,CAAC,CAACf,UAAU,CAACG,qBAAqB,EAAET,OAAO,CAAC;AAChE,GAAC,CAAC;AAAA;;;;"}
|
|
@@ -48,7 +48,7 @@ var QUERY_KEYS = {
|
|
|
48
48
|
};
|
|
49
49
|
|
|
50
50
|
function ownKeys$3(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; }
|
|
51
|
-
function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t),
|
|
51
|
+
function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
52
52
|
var useFetchGmail = function useFetchGmail(ownerId, options) {
|
|
53
53
|
return reactQuery.useQuery(_objectSpread$3({
|
|
54
54
|
queryKey: [QUERY_KEYS.INTEGRATION_GMAIL, ownerId],
|
|
@@ -98,7 +98,7 @@ var outlookApi = {
|
|
|
98
98
|
};
|
|
99
99
|
|
|
100
100
|
function ownKeys$2(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; }
|
|
101
|
-
function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t),
|
|
101
|
+
function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
102
102
|
var useFetchOutlook = function useFetchOutlook(ownerId, options) {
|
|
103
103
|
return reactQuery.useQuery(_objectSpread$2({
|
|
104
104
|
queryKey: [QUERY_KEYS.INTEGRATION_OUTLOOK, ownerId],
|
|
@@ -141,7 +141,7 @@ var smtpApi = {
|
|
|
141
141
|
};
|
|
142
142
|
|
|
143
143
|
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; }
|
|
144
|
-
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),
|
|
144
|
+
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; }
|
|
145
145
|
var useFetchSmtp = function useFetchSmtp(ownerId, options) {
|
|
146
146
|
return reactQuery.useQuery(_objectSpread$1({
|
|
147
147
|
queryKey: [QUERY_KEYS.INTEGRATION_SMTP, ownerId],
|
|
@@ -201,7 +201,7 @@ var sparkpostDomainsApi = {
|
|
|
201
201
|
};
|
|
202
202
|
|
|
203
203
|
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; }
|
|
204
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t),
|
|
204
|
+
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; }
|
|
205
205
|
var useFetchSparkpostDomain = function useFetchSparkpostDomain(ownerId, options) {
|
|
206
206
|
return reactQuery.useQuery(_objectSpread({
|
|
207
207
|
queryKey: [QUERY_KEYS.INTEGRATION_SPARKPOST, ownerId],
|
|
@@ -250,4 +250,4 @@ exports.useFetchOutlook = useFetchOutlook;
|
|
|
250
250
|
exports.useFetchSmtp = useFetchSmtp;
|
|
251
251
|
exports.useFetchSparkpostDomain = useFetchSparkpostDomain;
|
|
252
252
|
exports.useVerifySparkpostDomain = useVerifySparkpostDomain;
|
|
253
|
-
//# sourceMappingURL=useSparkpostApi-
|
|
253
|
+
//# sourceMappingURL=useSparkpostApi-DlgW14Wu.js.map
|