@bigbinary/neeto-email-delivery-frontend 1.0.12 → 1.0.13

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 (36) hide show
  1. package/app/javascript/src/translations/en.json +24 -0
  2. package/dist/EmailDeliveryScreen.js +225 -45
  3. package/dist/EmailDeliveryScreen.js.map +1 -1
  4. package/dist/SparkpostDomainSetup.js +2 -2
  5. package/dist/SparkpostDomainVerify.js +2 -2
  6. package/dist/cjs/EmailDeliveryScreen.js +245 -46
  7. package/dist/cjs/EmailDeliveryScreen.js.map +1 -1
  8. package/dist/cjs/SparkpostDomainSetup.js +2 -2
  9. package/dist/cjs/SparkpostDomainVerify.js +2 -2
  10. package/dist/cjs/hooks.js +7 -2
  11. package/dist/cjs/hooks.js.map +1 -1
  12. package/dist/cjs/index.js +13 -11
  13. package/dist/cjs/index.js.map +1 -1
  14. package/dist/hooks.js +7 -2
  15. package/dist/hooks.js.map +1 -1
  16. package/dist/index.js +13 -11
  17. package/dist/index.js.map +1 -1
  18. package/dist/{useOutlookIntegrationApi-CtHj_BzG.js → useOutlookIntegrationApi-BC-RPHmJ.js} +59 -2
  19. package/dist/useOutlookIntegrationApi-BC-RPHmJ.js.map +1 -0
  20. package/dist/{useOutlookIntegrationApi-ZgRWrUQN.js → useOutlookIntegrationApi-b_mNVfRE.js} +58 -4
  21. package/dist/useOutlookIntegrationApi-b_mNVfRE.js.map +1 -0
  22. package/dist/{useSparkpostApi-pa64NIl6.js → useSparkpostApi-D9NOjTNA.js} +18 -2
  23. package/dist/useSparkpostApi-D9NOjTNA.js.map +1 -0
  24. package/dist/{useSparkpostApi-W7XibjIp.js → useSparkpostApi-qpRhsK7H.js} +17 -3
  25. package/dist/useSparkpostApi-qpRhsK7H.js.map +1 -0
  26. package/dist/{useSparkpostDomain-CK-k6Xrr.js → useSparkpostDomain-Brk7SmL4.js} +3 -15
  27. package/dist/useSparkpostDomain-Brk7SmL4.js.map +1 -0
  28. package/dist/{useSparkpostDomain-DDI4pHcZ.js → useSparkpostDomain-CuX-Gl5a.js} +3 -14
  29. package/dist/useSparkpostDomain-CuX-Gl5a.js.map +1 -0
  30. package/package.json +5 -5
  31. package/dist/useOutlookIntegrationApi-CtHj_BzG.js.map +0 -1
  32. package/dist/useOutlookIntegrationApi-ZgRWrUQN.js.map +0 -1
  33. package/dist/useSparkpostApi-W7XibjIp.js.map +0 -1
  34. package/dist/useSparkpostApi-pa64NIl6.js.map +0 -1
  35. package/dist/useSparkpostDomain-CK-k6Xrr.js.map +0 -1
  36. package/dist/useSparkpostDomain-DDI4pHcZ.js.map +0 -1
package/dist/cjs/hooks.js CHANGED
@@ -2,19 +2,21 @@
2
2
 
3
3
  var neetoCist = require('@bigbinary/neeto-cist');
4
4
  var ramda = require('ramda');
5
- var useOutlookIntegrationApi = require('../useOutlookIntegrationApi-CtHj_BzG.js');
6
- var useSparkpostApi = require('../useSparkpostApi-pa64NIl6.js');
5
+ var useOutlookIntegrationApi = require('../useOutlookIntegrationApi-BC-RPHmJ.js');
6
+ var useSparkpostApi = require('../useSparkpostApi-D9NOjTNA.js');
7
7
  require('@babel/runtime/helpers/defineProperty');
8
8
  require('@tanstack/react-query');
9
9
  require('@bigbinary/neeto-commons-frontend/react-utils');
10
10
  require('axios');
11
11
  require('@bigbinary/neeto-commons-frontend/utils');
12
+ require('@babel/runtime/helpers/slicedToArray');
12
13
 
13
14
  var useFetchConnectedIntegration = function useFetchConnectedIntegration(ownerId) {
14
15
  var _connectedIntegration;
15
16
  var gmail = useOutlookIntegrationApi.useFetchGmail(ownerId);
16
17
  var outlook = useOutlookIntegrationApi.useFetchOutlook(ownerId);
17
18
  var sparkpost = useSparkpostApi.useFetchSparkpostDomain(ownerId);
19
+ var smtp = useOutlookIntegrationApi.useFetchSmtp(ownerId);
18
20
  var integrations = [{
19
21
  type: "gmail",
20
22
  hook: gmail
@@ -24,6 +26,9 @@ var useFetchConnectedIntegration = function useFetchConnectedIntegration(ownerId
24
26
  }, {
25
27
  type: "sparkpost",
26
28
  hook: sparkpost
29
+ }, {
30
+ type: "smtp",
31
+ hook: smtp
27
32
  }];
28
33
  var hooks = ramda.pluck("hook", integrations);
29
34
  var isLoading = neetoCist.existsBy({
@@ -1 +1 @@
1
- {"version":3,"file":"hooks.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 { useFetchSparkpostDomain } from \"./useSparkpostApi\";\n\nexport const useFetchConnectedIntegration = ownerId => {\n const gmail = useFetchGmail(ownerId);\n const outlook = useFetchOutlook(ownerId);\n const sparkpost = useFetchSparkpostDomain(ownerId);\n\n const integrations = [\n { type: \"gmail\", hook: gmail },\n { type: \"outlook\", hook: outlook },\n { type: \"sparkpost\", hook: sparkpost },\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 integration = connectedIntegration\n ? {\n type: connectedIntegration.type,\n data: connectedIntegration.hook?.data,\n }\n : null;\n\n return { integration, isLoading, isError };\n};\n"],"names":["useFetchConnectedIntegration","ownerId","_connectedIntegration","gmail","useFetchGmail","outlook","useFetchOutlook","sparkpost","useFetchSparkpostDomain","integrations","type","hook","hooks","pluck","isLoading","existsBy","isError","connectedIntegration","find","_ref","_hook$data","isSuccess","data","connected","integration"],"mappings":";;;;;;;;;;;;IAOaA,4BAA4B,GAAG,SAA/BA,4BAA4BA,CAAGC,OAAO,EAAI;AAAA,EAAA,IAAAC,qBAAA;AACrD,EAAA,IAAMC,KAAK,GAAGC,sCAAa,CAACH,OAAO,CAAC;AACpC,EAAA,IAAMI,OAAO,GAAGC,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KAAAA,CAAAA,GAAAA,qBAAA,CAA2BoB;AACnC,GAAC,GACD,IAAI;EAER,OAAO;AAAEE,IAAAA,WAAW,EAAXA,WAAW;AAAEV,IAAAA,SAAS,EAATA,SAAS;AAAEE,IAAAA,OAAO,EAAPA;GAAS;AAC5C;;;;"}
1
+ {"version":3,"file":"hooks.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 integration = connectedIntegration\n ? {\n type: connectedIntegration.type,\n data: connectedIntegration.hook?.data,\n }\n : null;\n\n return { integration, isLoading, isError };\n};\n"],"names":["useFetchConnectedIntegration","ownerId","_connectedIntegration","gmail","useFetchGmail","outlook","useFetchOutlook","sparkpost","useFetchSparkpostDomain","smtp","useFetchSmtp","integrations","type","hook","hooks","pluck","isLoading","existsBy","isError","connectedIntegration","find","_ref","_hook$data","isSuccess","data","connected","integration"],"mappings":";;;;;;;;;;;;;IAQaA,4BAA4B,GAAG,SAA/BA,4BAA4BA,CAAGC,OAAO,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CAAAA,GAAAA,UAAA,CAAYG,SAAS,CAAA;AAAA,GACvD,CAAC;EAED,IAAMC,WAAW,GAAGP,oBAAoB,GACpC;IACEP,IAAI,EAAEO,oBAAoB,CAACP,IAAI;IAC/BY,IAAI,EAAA,CAAAtB,qBAAA,GAAEiB,oBAAoB,CAACN,IAAI,MAAAX,IAAAA,IAAAA,qBAAA,KAAzBA,KAAAA,CAAAA,GAAAA,KAAAA,CAAAA,GAAAA,qBAAA,CAA2BsB;AACnC,GAAC,GACD,IAAI;EAER,OAAO;AAAEE,IAAAA,WAAW,EAAXA,WAAW;AAAEV,IAAAA,SAAS,EAATA,SAAS;AAAEE,IAAAA,OAAO,EAAPA;GAAS;AAC5C;;;;"}
package/dist/cjs/index.js CHANGED
@@ -3,6 +3,8 @@
3
3
  var EmailDeliveryScreen = require('./EmailDeliveryScreen.js');
4
4
  var SparkpostDomainSetup = require('./SparkpostDomainSetup.js');
5
5
  var SparkpostDomainVerify = require('./SparkpostDomainVerify.js');
6
+ require('@babel/runtime/helpers/slicedToArray');
7
+ require('react');
6
8
  require('@bigbinary/neeto-cist');
7
9
  require('@bigbinary/neeto-commons-frontend/react-utils');
8
10
  require('@bigbinary/neeto-commons-frontend/utils');
@@ -15,29 +17,29 @@ require('@bigbinary/neetoui/Toastr');
15
17
  require('ramda');
16
18
  require('react-i18next');
17
19
  require('react-router-dom');
18
- require('../useSparkpostApi-pa64NIl6.js');
20
+ require('../useSparkpostApi-D9NOjTNA.js');
19
21
  require('@babel/runtime/helpers/defineProperty');
20
22
  require('@tanstack/react-query');
21
23
  require('axios');
22
- require('@babel/runtime/helpers/slicedToArray');
23
- require('react');
24
- require('../useOutlookIntegrationApi-CtHj_BzG.js');
25
- require('../useSparkpostDomain-CK-k6Xrr.js');
24
+ require('@bigbinary/neetoui/Pane');
25
+ require('@bigbinary/neetoui/Typography');
26
+ require('@bigbinary/neetoui/formik/Form');
27
+ require('@bigbinary/neetoui/formik/Input');
28
+ require('@bigbinary/neetoui/formik/Radio');
29
+ require('@bigbinary/neetoui/formik/ActionBlock');
30
+ require('../useOutlookIntegrationApi-BC-RPHmJ.js');
26
31
  require('i18next');
32
+ require('yup');
33
+ require('react/jsx-runtime');
34
+ require('../useSparkpostDomain-Brk7SmL4.js');
27
35
  require('@bigbinary/neetoui/Button');
28
36
  require('@bigbinary/neetoui/Tag');
29
- require('@bigbinary/neetoui/Typography');
30
- require('react/jsx-runtime');
31
37
  require('@bigbinary/neeto-molecules/CardLayout');
32
- require('@bigbinary/neetoui/formik/Input');
33
- require('@bigbinary/neetoui/formik/ActionBlock');
34
- require('@bigbinary/neetoui/formik/Form');
35
38
  require('../constants-D3nzz3Te.js');
36
39
  require('@babel/runtime/helpers/objectWithoutProperties');
37
40
  require('classnames');
38
41
  require('@bigbinary/neeto-molecules/Container');
39
42
  require('@bigbinary/neeto-molecules/Header');
40
- require('yup');
41
43
  require('@babel/runtime/helpers/toConsumableArray');
42
44
  require('@bigbinary/neeto-molecules/CopyToClipboardButton');
43
45
 
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/dist/hooks.js CHANGED
@@ -1,18 +1,20 @@
1
1
  import { existsBy } from '@bigbinary/neeto-cist';
2
2
  import { pluck } from 'ramda';
3
- import { u as useFetchGmail, a as useFetchOutlook } from './useOutlookIntegrationApi-ZgRWrUQN.js';
4
- import { u as useFetchSparkpostDomain } from './useSparkpostApi-W7XibjIp.js';
3
+ import { u as useFetchGmail, a as useFetchOutlook, b as useFetchSmtp } from './useOutlookIntegrationApi-b_mNVfRE.js';
4
+ import { u as useFetchSparkpostDomain } from './useSparkpostApi-qpRhsK7H.js';
5
5
  import '@babel/runtime/helpers/defineProperty';
6
6
  import '@tanstack/react-query';
7
7
  import '@bigbinary/neeto-commons-frontend/react-utils';
8
8
  import 'axios';
9
9
  import '@bigbinary/neeto-commons-frontend/utils';
10
+ import '@babel/runtime/helpers/slicedToArray';
10
11
 
11
12
  var useFetchConnectedIntegration = function useFetchConnectedIntegration(ownerId) {
12
13
  var _connectedIntegration;
13
14
  var gmail = useFetchGmail(ownerId);
14
15
  var outlook = useFetchOutlook(ownerId);
15
16
  var sparkpost = useFetchSparkpostDomain(ownerId);
17
+ var smtp = useFetchSmtp(ownerId);
16
18
  var integrations = [{
17
19
  type: "gmail",
18
20
  hook: gmail
@@ -22,6 +24,9 @@ var useFetchConnectedIntegration = function useFetchConnectedIntegration(ownerId
22
24
  }, {
23
25
  type: "sparkpost",
24
26
  hook: sparkpost
27
+ }, {
28
+ type: "smtp",
29
+ hook: smtp
25
30
  }];
26
31
  var hooks = pluck("hook", integrations);
27
32
  var isLoading = existsBy({
package/dist/hooks.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"hooks.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 { useFetchSparkpostDomain } from \"./useSparkpostApi\";\n\nexport const useFetchConnectedIntegration = ownerId => {\n const gmail = useFetchGmail(ownerId);\n const outlook = useFetchOutlook(ownerId);\n const sparkpost = useFetchSparkpostDomain(ownerId);\n\n const integrations = [\n { type: \"gmail\", hook: gmail },\n { type: \"outlook\", hook: outlook },\n { type: \"sparkpost\", hook: sparkpost },\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 integration = connectedIntegration\n ? {\n type: connectedIntegration.type,\n data: connectedIntegration.hook?.data,\n }\n : null;\n\n return { integration, isLoading, isError };\n};\n"],"names":["useFetchConnectedIntegration","ownerId","_connectedIntegration","gmail","useFetchGmail","outlook","useFetchOutlook","sparkpost","useFetchSparkpostDomain","integrations","type","hook","hooks","pluck","isLoading","existsBy","isError","connectedIntegration","find","_ref","_hook$data","isSuccess","data","connected","integration"],"mappings":";;;;;;;;;;IAOaA,4BAA4B,GAAG,SAA/BA,4BAA4BA,CAAGC,OAAO,EAAI;AAAA,EAAA,IAAAC,qBAAA;AACrD,EAAA,IAAMC,KAAK,GAAGC,aAAa,CAACH,OAAO,CAAC;AACpC,EAAA,IAAMI,OAAO,GAAGC,eAAe,CAACL,OAAO,CAAC;AACxC,EAAA,IAAMM,SAAS,GAAGC,uBAAuB,CAACP,OAAO,CAAC;EAElD,IAAMQ,YAAY,GAAG,CACnB;AAAEC,IAAAA,IAAI,EAAE,OAAO;AAAEC,IAAAA,IAAI,EAAER;AAAM,GAAC,EAC9B;AAAEO,IAAAA,IAAI,EAAE,SAAS;AAAEC,IAAAA,IAAI,EAAEN;AAAQ,GAAC,EAClC;AAAEK,IAAAA,IAAI,EAAE,WAAW;AAAEC,IAAAA,IAAI,EAAEJ;AAAU,GAAC,CACvC;AAED,EAAA,IAAMK,KAAK,GAAGC,KAAK,CAAC,MAAM,EAAEJ,YAAY,CAAC;EAEzC,IAAMK,SAAS,GAAGC,QAAQ,CAAC;AAAED,IAAAA,SAAS,EAAE;GAAM,EAAEF,KAAK,CAAC;EACtD,IAAMI,OAAO,GAAGD,QAAQ,CAAC;AAAEC,IAAAA,OAAO,EAAE;GAAM,EAAEJ,KAAK,CAAC;AAElD,EAAA,IAAMK,oBAAoB,GAAGR,YAAY,CAACS,IAAI,CAC5C,UAAAC,IAAA,EAAA;AAAA,IAAA,IAAAC,UAAA;AAAA,IAAA,IAAGT,IAAI,GAAAQ,IAAA,CAAJR,IAAI;AAAA,IAAA,OAAOA,IAAI,CAACU,SAAS,KAAIV,IAAI,KAAA,IAAA,IAAJA,IAAI,KAAAS,KAAAA,CAAAA,IAAAA,CAAAA,UAAA,GAAJT,IAAI,CAAEW,IAAI,MAAA,IAAA,IAAAF,UAAA,KAAVA,KAAAA,CAAAA,GAAAA,KAAAA,CAAAA,GAAAA,UAAA,CAAYG,SAAS,CAAA;AAAA,GACvD,CAAC;EAED,IAAMC,WAAW,GAAGP,oBAAoB,GACpC;IACEP,IAAI,EAAEO,oBAAoB,CAACP,IAAI;IAC/BY,IAAI,EAAA,CAAApB,qBAAA,GAAEe,oBAAoB,CAACN,IAAI,MAAAT,IAAAA,IAAAA,qBAAA,KAAzBA,KAAAA,CAAAA,GAAAA,KAAAA,CAAAA,GAAAA,qBAAA,CAA2BoB;AACnC,GAAC,GACD,IAAI;EAER,OAAO;AAAEE,IAAAA,WAAW,EAAXA,WAAW;AAAEV,IAAAA,SAAS,EAATA,SAAS;AAAEE,IAAAA,OAAO,EAAPA;GAAS;AAC5C;;;;"}
1
+ {"version":3,"file":"hooks.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 integration = connectedIntegration\n ? {\n type: connectedIntegration.type,\n data: connectedIntegration.hook?.data,\n }\n : null;\n\n return { integration, isLoading, isError };\n};\n"],"names":["useFetchConnectedIntegration","ownerId","_connectedIntegration","gmail","useFetchGmail","outlook","useFetchOutlook","sparkpost","useFetchSparkpostDomain","smtp","useFetchSmtp","integrations","type","hook","hooks","pluck","isLoading","existsBy","isError","connectedIntegration","find","_ref","_hook$data","isSuccess","data","connected","integration"],"mappings":";;;;;;;;;;;IAQaA,4BAA4B,GAAG,SAA/BA,4BAA4BA,CAAGC,OAAO,EAAI;AAAA,EAAA,IAAAC,qBAAA;AACrD,EAAA,IAAMC,KAAK,GAAGC,aAAa,CAACH,OAAO,CAAC;AACpC,EAAA,IAAMI,OAAO,GAAGC,eAAe,CAACL,OAAO,CAAC;AACxC,EAAA,IAAMM,SAAS,GAAGC,uBAAuB,CAACP,OAAO,CAAC;AAClD,EAAA,IAAMQ,IAAI,GAAGC,YAAY,CAACT,OAAO,CAAC;EAElC,IAAMU,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;GAAM,EAAEF,KAAK,CAAC;EACtD,IAAMI,OAAO,GAAGD,QAAQ,CAAC;AAAEC,IAAAA,OAAO,EAAE;GAAM,EAAEJ,KAAK,CAAC;AAElD,EAAA,IAAMK,oBAAoB,GAAGR,YAAY,CAACS,IAAI,CAC5C,UAAAC,IAAA,EAAA;AAAA,IAAA,IAAAC,UAAA;AAAA,IAAA,IAAGT,IAAI,GAAAQ,IAAA,CAAJR,IAAI;AAAA,IAAA,OAAOA,IAAI,CAACU,SAAS,KAAIV,IAAI,KAAA,IAAA,IAAJA,IAAI,KAAAS,KAAAA,CAAAA,IAAAA,CAAAA,UAAA,GAAJT,IAAI,CAAEW,IAAI,MAAA,IAAA,IAAAF,UAAA,KAAVA,KAAAA,CAAAA,GAAAA,KAAAA,CAAAA,GAAAA,UAAA,CAAYG,SAAS,CAAA;AAAA,GACvD,CAAC;EAED,IAAMC,WAAW,GAAGP,oBAAoB,GACpC;IACEP,IAAI,EAAEO,oBAAoB,CAACP,IAAI;IAC/BY,IAAI,EAAA,CAAAtB,qBAAA,GAAEiB,oBAAoB,CAACN,IAAI,MAAAX,IAAAA,IAAAA,qBAAA,KAAzBA,KAAAA,CAAAA,GAAAA,KAAAA,CAAAA,GAAAA,qBAAA,CAA2BsB;AACnC,GAAC,GACD,IAAI;EAER,OAAO;AAAEE,IAAAA,WAAW,EAAXA,WAAW;AAAEV,IAAAA,SAAS,EAATA,SAAS;AAAEE,IAAAA,OAAO,EAAPA;GAAS;AAC5C;;;;"}
package/dist/index.js CHANGED
@@ -1,6 +1,8 @@
1
1
  export { default as EmailDeliveryScreen } from './EmailDeliveryScreen.js';
2
2
  export { default as SparkpostDomainSetup } from './SparkpostDomainSetup.js';
3
3
  export { default as SparkpostDomainVerify } from './SparkpostDomainVerify.js';
4
+ import '@babel/runtime/helpers/slicedToArray';
5
+ import 'react';
4
6
  import '@bigbinary/neeto-cist';
5
7
  import '@bigbinary/neeto-commons-frontend/react-utils';
6
8
  import '@bigbinary/neeto-commons-frontend/utils';
@@ -13,29 +15,29 @@ import '@bigbinary/neetoui/Toastr';
13
15
  import 'ramda';
14
16
  import 'react-i18next';
15
17
  import 'react-router-dom';
16
- import './useSparkpostApi-W7XibjIp.js';
18
+ import './useSparkpostApi-qpRhsK7H.js';
17
19
  import '@babel/runtime/helpers/defineProperty';
18
20
  import '@tanstack/react-query';
19
21
  import 'axios';
20
- import '@babel/runtime/helpers/slicedToArray';
21
- import 'react';
22
- import './useOutlookIntegrationApi-ZgRWrUQN.js';
23
- import './useSparkpostDomain-DDI4pHcZ.js';
22
+ import '@bigbinary/neetoui/Pane';
23
+ import '@bigbinary/neetoui/Typography';
24
+ import '@bigbinary/neetoui/formik/Form';
25
+ import '@bigbinary/neetoui/formik/Input';
26
+ import '@bigbinary/neetoui/formik/Radio';
27
+ import '@bigbinary/neetoui/formik/ActionBlock';
28
+ import './useOutlookIntegrationApi-b_mNVfRE.js';
24
29
  import 'i18next';
30
+ import 'yup';
31
+ import 'react/jsx-runtime';
32
+ import './useSparkpostDomain-CuX-Gl5a.js';
25
33
  import '@bigbinary/neetoui/Button';
26
34
  import '@bigbinary/neetoui/Tag';
27
- import '@bigbinary/neetoui/Typography';
28
- import 'react/jsx-runtime';
29
35
  import '@bigbinary/neeto-molecules/CardLayout';
30
- import '@bigbinary/neetoui/formik/Input';
31
- import '@bigbinary/neetoui/formik/ActionBlock';
32
- import '@bigbinary/neetoui/formik/Form';
33
36
  import './constants-Cvxv8ly7.js';
34
37
  import '@babel/runtime/helpers/objectWithoutProperties';
35
38
  import 'classnames';
36
39
  import '@bigbinary/neeto-molecules/Container';
37
40
  import '@bigbinary/neeto-molecules/Header';
38
- import 'yup';
39
41
  import '@babel/runtime/helpers/toConsumableArray';
40
42
  import '@bigbinary/neeto-molecules/CopyToClipboardButton';
41
43
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -5,7 +5,61 @@ var reactQuery = require('@tanstack/react-query');
5
5
  var reactUtils = require('@bigbinary/neeto-commons-frontend/react-utils');
6
6
  var axios = require('axios');
7
7
  var utils = require('@bigbinary/neeto-commons-frontend/utils');
8
- var useSparkpostApi = require('./useSparkpostApi-pa64NIl6.js');
8
+ var useSparkpostApi = require('./useSparkpostApi-D9NOjTNA.js');
9
+
10
+ var get$2 = function get(ownerId) {
11
+ return axios.get(utils.buildUrl(useSparkpostApi.SMTP_URL, {
12
+ ownerId: ownerId
13
+ }), {
14
+ showToastr: false
15
+ });
16
+ };
17
+ var create = function create(ownerId, payload) {
18
+ return axios.post(utils.buildUrl(useSparkpostApi.SMTP_URL, {
19
+ ownerId: ownerId
20
+ }), payload);
21
+ };
22
+ var destroy$2 = function destroy(ownerId) {
23
+ return axios["delete"](utils.buildUrl(useSparkpostApi.SMTP_URL, {
24
+ ownerId: ownerId
25
+ }));
26
+ };
27
+ var smtpApi = {
28
+ get: get$2,
29
+ create: create,
30
+ destroy: destroy$2
31
+ };
32
+
33
+ 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; }
34
+ 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), !0).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; }
35
+ var useFetchSmtp = function useFetchSmtp(ownerId, options) {
36
+ return reactQuery.useQuery(_objectSpread$2({
37
+ queryKey: [useSparkpostApi.QUERY_KEYS.INTEGRATION_SMTP, ownerId],
38
+ queryFn: function queryFn() {
39
+ return smtpApi.get(ownerId);
40
+ },
41
+ retry: 1
42
+ }, options));
43
+ };
44
+ var useCreateSmtp = function useCreateSmtp(_ref) {
45
+ var ownerId = _ref.ownerId;
46
+ return reactUtils.useMutationWithInvalidation(function (payload) {
47
+ return smtpApi.create(ownerId, payload);
48
+ }, {
49
+ keysToInvalidate: [[useSparkpostApi.QUERY_KEYS.INTEGRATION_SMTP, ownerId]]
50
+ });
51
+ };
52
+ var useDestroySmtp = function useDestroySmtp(_ref2) {
53
+ var ownerId = _ref2.ownerId;
54
+ var queryClient = reactQuery.useQueryClient();
55
+ return reactUtils.useMutationWithInvalidation(function () {
56
+ return smtpApi.destroy(ownerId);
57
+ }, {
58
+ keysToInvalidate: [[useSparkpostApi.QUERY_KEYS.INTEGRATION_SMTP, ownerId], function () {
59
+ return useSparkpostApi.invalidateAllIntegrationQueries(queryClient, ownerId);
60
+ }]
61
+ });
62
+ };
9
63
 
10
64
  var get$1 = function get(ownerId) {
11
65
  return axios.get(utils.buildUrl(useSparkpostApi.GMAIL_URL, {
@@ -85,8 +139,11 @@ var useDestroyOutlook = function useDestroyOutlook(_ref) {
85
139
  });
86
140
  };
87
141
 
142
+ exports.useCreateSmtp = useCreateSmtp;
88
143
  exports.useDestroyGmail = useDestroyGmail;
89
144
  exports.useDestroyOutlook = useDestroyOutlook;
145
+ exports.useDestroySmtp = useDestroySmtp;
90
146
  exports.useFetchGmail = useFetchGmail;
91
147
  exports.useFetchOutlook = useFetchOutlook;
92
- //# sourceMappingURL=useOutlookIntegrationApi-CtHj_BzG.js.map
148
+ exports.useFetchSmtp = useFetchSmtp;
149
+ //# sourceMappingURL=useOutlookIntegrationApi-BC-RPHmJ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useOutlookIntegrationApi-BC-RPHmJ.js","sources":["../app/javascript/src/apis/integrations/smtp.js","../app/javascript/src/hooks/reactQuery/integrations/useSmtpIntegrationApi.js","../app/javascript/src/apis/integrations/gmail.js","../app/javascript/src/hooks/reactQuery/integrations/useGmailIntegrationApi.js","../app/javascript/src/apis/integrations/outlook.js","../app/javascript/src/hooks/reactQuery/integrations/useOutlookIntegrationApi.js"],"sourcesContent":["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 { 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","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 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"],"names":["get","ownerId","axios","buildUrl","SMTP_URL","showToastr","create","payload","post","destroy","smtpApi","useFetchSmtp","options","useQuery","_objectSpread","queryKey","QUERY_KEYS","INTEGRATION_SMTP","queryFn","retry","useCreateSmtp","_ref","useMutationWithInvalidation","keysToInvalidate","useDestroySmtp","_ref2","queryClient","useQueryClient","invalidateAllIntegrationQueries","GMAIL_URL","GMAIL_OAUTH_URL","gmailApi","useFetchGmail","INTEGRATION_GMAIL","useDestroyGmail","OUTLOOK_URL","OUTLOOK_OAUTH_URL","outlookApi","useFetchOutlook","INTEGRATION_OUTLOOK","useDestroyOutlook"],"mappings":";;;;;;;;;AAKA,IAAMA,KAAG,GAAG,SAANA,GAAGA,CAAGC,OAAO,EAAA;AAAA,EAAA,OACjBC,KAAK,CAACF,GAAG,CAACG,cAAQ,CAACC,wBAAQ,EAAE;AAAEH,IAAAA,OAAO,EAAPA;AAAQ,GAAC,CAAC,EAAE;AAAEI,IAAAA,UAAU,EAAE;AAAM,GAAC,CAAC;AAAA,CAAA;AAEnE,IAAMC,MAAM,GAAG,SAATA,MAAMA,CAAIL,OAAO,EAAEM,OAAO,EAAA;AAAA,EAAA,OAC9BL,KAAK,CAACM,IAAI,CAACL,cAAQ,CAACC,wBAAQ,EAAE;AAAEH,IAAAA,OAAO,EAAPA;GAAS,CAAC,EAAEM,OAAO,CAAC;AAAA,CAAA;AAEtD,IAAME,SAAO,GAAG,SAAVA,OAAOA,CAAGR,OAAO,EAAA;AAAA,EAAA,OAAIC,KAAK,CAAO,QAAA,CAAA,CAACC,cAAQ,CAACC,wBAAQ,EAAE;AAAEH,IAAAA,OAAO,EAAPA;AAAQ,GAAC,CAAC,CAAC;AAAA,CAAA;AAExE,IAAMS,OAAO,GAAG;AAAEV,EAAAA,GAAG,EAAHA,KAAG;AAAEM,EAAAA,MAAM,EAANA,MAAM;AAAEG,EAAAA,OAAO,EAAPA;AAAQ,CAAC;;;;ACNjC,IAAME,YAAY,GAAG,SAAfA,YAAYA,CAAIV,OAAO,EAAEW,OAAO,E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1
1
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
2
- import { useQuery } from '@tanstack/react-query';
2
+ import { useQuery, useQueryClient } from '@tanstack/react-query';
3
3
  import { useMutationWithInvalidation } from '@bigbinary/neeto-commons-frontend/react-utils';
4
4
  import axios from 'axios';
5
5
  import { buildUrl } from '@bigbinary/neeto-commons-frontend/utils';
6
- import { G as GMAIL_URL, d as GMAIL_OAUTH_URL, Q as QUERY_KEYS, O as OUTLOOK_URL, e as OUTLOOK_OAUTH_URL } from './useSparkpostApi-W7XibjIp.js';
6
+ import { S as SMTP_URL, Q as QUERY_KEYS, i as invalidateAllIntegrationQueries, G as GMAIL_URL, d as GMAIL_OAUTH_URL, O as OUTLOOK_URL, e as OUTLOOK_OAUTH_URL } from './useSparkpostApi-qpRhsK7H.js';
7
+
8
+ var get$2 = function get(ownerId) {
9
+ return axios.get(buildUrl(SMTP_URL, {
10
+ ownerId: ownerId
11
+ }), {
12
+ showToastr: false
13
+ });
14
+ };
15
+ var create = function create(ownerId, payload) {
16
+ return axios.post(buildUrl(SMTP_URL, {
17
+ ownerId: ownerId
18
+ }), payload);
19
+ };
20
+ var destroy$2 = function destroy(ownerId) {
21
+ return axios["delete"](buildUrl(SMTP_URL, {
22
+ ownerId: ownerId
23
+ }));
24
+ };
25
+ var smtpApi = {
26
+ get: get$2,
27
+ create: create,
28
+ destroy: destroy$2
29
+ };
30
+
31
+ 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; }
32
+ 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), !0).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; }
33
+ var useFetchSmtp = function useFetchSmtp(ownerId, options) {
34
+ return useQuery(_objectSpread$2({
35
+ queryKey: [QUERY_KEYS.INTEGRATION_SMTP, ownerId],
36
+ queryFn: function queryFn() {
37
+ return smtpApi.get(ownerId);
38
+ },
39
+ retry: 1
40
+ }, options));
41
+ };
42
+ var useCreateSmtp = function useCreateSmtp(_ref) {
43
+ var ownerId = _ref.ownerId;
44
+ return useMutationWithInvalidation(function (payload) {
45
+ return smtpApi.create(ownerId, payload);
46
+ }, {
47
+ keysToInvalidate: [[QUERY_KEYS.INTEGRATION_SMTP, ownerId]]
48
+ });
49
+ };
50
+ var useDestroySmtp = function useDestroySmtp(_ref2) {
51
+ var ownerId = _ref2.ownerId;
52
+ var queryClient = useQueryClient();
53
+ return useMutationWithInvalidation(function () {
54
+ return smtpApi.destroy(ownerId);
55
+ }, {
56
+ keysToInvalidate: [[QUERY_KEYS.INTEGRATION_SMTP, ownerId], function () {
57
+ return invalidateAllIntegrationQueries(queryClient, ownerId);
58
+ }]
59
+ });
60
+ };
7
61
 
8
62
  var get$1 = function get(ownerId) {
9
63
  return axios.get(buildUrl(GMAIL_URL, {
@@ -83,5 +137,5 @@ var useDestroyOutlook = function useDestroyOutlook(_ref) {
83
137
  });
84
138
  };
85
139
 
86
- export { useFetchOutlook as a, useDestroyGmail as b, useDestroyOutlook as c, useFetchGmail as u };
87
- //# sourceMappingURL=useOutlookIntegrationApi-ZgRWrUQN.js.map
140
+ export { useFetchOutlook as a, useFetchSmtp as b, useCreateSmtp as c, useDestroyGmail as d, useDestroyOutlook as e, useDestroySmtp as f, useFetchGmail as u };
141
+ //# sourceMappingURL=useOutlookIntegrationApi-b_mNVfRE.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useOutlookIntegrationApi-b_mNVfRE.js","sources":["../app/javascript/src/apis/integrations/smtp.js","../app/javascript/src/hooks/reactQuery/integrations/useSmtpIntegrationApi.js","../app/javascript/src/apis/integrations/gmail.js","../app/javascript/src/hooks/reactQuery/integrations/useGmailIntegrationApi.js","../app/javascript/src/apis/integrations/outlook.js","../app/javascript/src/hooks/reactQuery/integrations/useOutlookIntegrationApi.js"],"sourcesContent":["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 { 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","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 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"],"names":["get","ownerId","axios","buildUrl","SMTP_URL","showToastr","create","payload","post","destroy","smtpApi","useFetchSmtp","options","useQuery","_objectSpread","queryKey","QUERY_KEYS","INTEGRATION_SMTP","queryFn","retry","useCreateSmtp","_ref","useMutationWithInvalidation","keysToInvalidate","useDestroySmtp","_ref2","queryClient","useQueryClient","invalidateAllIntegrationQueries","GMAIL_URL","GMAIL_OAUTH_URL","gmailApi","useFetchGmail","INTEGRATION_GMAIL","useDestroyGmail","OUTLOOK_URL","OUTLOOK_OAUTH_URL","outlookApi","useFetchOutlook","INTEGRATION_OUTLOOK","useDestroyOutlook"],"mappings":";;;;;;;AAKA,IAAMA,KAAG,GAAG,SAANA,GAAGA,CAAGC,OAAO,EAAA;AAAA,EAAA,OACjBC,KAAK,CAACF,GAAG,CAACG,QAAQ,CAACC,QAAQ,EAAE;AAAEH,IAAAA,OAAO,EAAPA;AAAQ,GAAC,CAAC,EAAE;AAAEI,IAAAA,UAAU,EAAE;AAAM,GAAC,CAAC;AAAA,CAAA;AAEnE,IAAMC,MAAM,GAAG,SAATA,MAAMA,CAAIL,OAAO,EAAEM,OAAO,EAAA;AAAA,EAAA,OAC9BL,KAAK,CAACM,IAAI,CAACL,QAAQ,CAACC,QAAQ,EAAE;AAAEH,IAAAA,OAAO,EAAPA;GAAS,CAAC,EAAEM,OAAO,CAAC;AAAA,CAAA;AAEtD,IAAME,SAAO,GAAG,SAAVA,OAAOA,CAAGR,OAAO,EAAA;AAAA,EAAA,OAAIC,KAAK,CAAO,QAAA,CAAA,CAACC,QAAQ,CAACC,QAAQ,EAAE;AAAEH,IAAAA,OAAO,EAAPA;AAAQ,GAAC,CAAC,CAAC;AAAA,CAAA;AAExE,IAAMS,OAAO,GAAG;AAAEV,EAAAA,GAAG,EAAHA,KAAG;AAAEM,EAAAA,MAAM,EAANA,MAAM;AAAEG,EAAAA,OAAO,EAAPA;AAAQ,CAAC;;;;ACNjC,IAAME,YAAY,GAAG,SAAfA,YAAYA,CAAIV,OAAO,EAAEW,OAAO,EAAA;EAAA,OAC3CC,QAAQ,CAAAC,eAAA,CAAA;A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defineProperty = require('@babel/runtime/helpers/defineProperty');
4
5
  var reactQuery = require('@tanstack/react-query');
5
6
  var reactUtils = require('@bigbinary/neeto-commons-frontend/react-utils');
@@ -18,11 +19,24 @@ var OUTLOOK_OAUTH_CONNECT_URL = "".concat(NEETO_EMAIL_DELIVERY_ENGINE_BASE_URL,
18
19
  var SPARKPOST_DOMAINS_URL = "".concat(NEETO_EMAIL_DELIVERY_ENGINE_BASE_URL, "/sparkpost_domains");
19
20
  var SPARKPOST_DOMAINS_INTEGRATIONS_URL = "".concat(NEETO_EMAIL_DELIVERY_ENGINE_BASE_URL, "/integrations/sparkpost_domains");
20
21
  var SPARKPOST_DOMAINS_VERIFY_URL = "".concat(SPARKPOST_DOMAINS_INTEGRATIONS_URL, "/verify");
22
+ var SMTP_URL = "".concat(NEETO_EMAIL_DELIVERY_ENGINE_BASE_URL, "/smtp");
21
23
 
22
24
  var QUERY_KEYS = {
23
25
  INTEGRATION_GMAIL: "integration-gmail",
24
26
  INTEGRATION_OUTLOOK: "integration-outlook",
25
- INTEGRATION_SPARKPOST: "integration-sparkpost"
27
+ INTEGRATION_SPARKPOST: "integration-sparkpost",
28
+ INTEGRATION_SMTP: "integration-smtp"
29
+ };
30
+
31
+ var invalidateAllIntegrationQueries = function invalidateAllIntegrationQueries(queryClient, ownerId) {
32
+ queryClient.invalidateQueries({
33
+ predicate: function predicate(query) {
34
+ var _query$queryKey = _slicedToArray(query.queryKey, 2),
35
+ key = _query$queryKey[0],
36
+ id = _query$queryKey[1];
37
+ return id === ownerId && [QUERY_KEYS.INTEGRATION_GMAIL, QUERY_KEYS.INTEGRATION_OUTLOOK, QUERY_KEYS.INTEGRATION_SPARKPOST, QUERY_KEYS.INTEGRATION_SMTP].includes(key);
38
+ }
39
+ });
26
40
  };
27
41
 
28
42
  var get = function get(ownerId) {
@@ -97,8 +111,10 @@ exports.OUTLOOK_OAUTH_CONNECT_URL = OUTLOOK_OAUTH_CONNECT_URL;
97
111
  exports.OUTLOOK_OAUTH_URL = OUTLOOK_OAUTH_URL;
98
112
  exports.OUTLOOK_URL = OUTLOOK_URL;
99
113
  exports.QUERY_KEYS = QUERY_KEYS;
114
+ exports.SMTP_URL = SMTP_URL;
115
+ exports.invalidateAllIntegrationQueries = invalidateAllIntegrationQueries;
100
116
  exports.useCreateSparkpostDomain = useCreateSparkpostDomain;
101
117
  exports.useDestroySparkpostDomain = useDestroySparkpostDomain;
102
118
  exports.useFetchSparkpostDomain = useFetchSparkpostDomain;
103
119
  exports.useVerifySparkpostDomain = useVerifySparkpostDomain;
104
- //# sourceMappingURL=useSparkpostApi-pa64NIl6.js.map
120
+ //# sourceMappingURL=useSparkpostApi-D9NOjTNA.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSparkpostApi-D9NOjTNA.js","sources":["../app/javascript/src/apis/integrations/constants.js","../app/javascript/src/constants/query.js","../app/javascript/src/utils.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","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 { 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 {\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","QUERY_KEYS","INTEGRATION_GMAIL","INTEGRATION_OUTLOOK","INTEGRATION_SPARKPOST","INTEGRATION_SMTP","invalidateAllIntegrationQueries","queryClient","ownerId","invalidateQueries","predicate","query","_query$queryKey","_slicedToArray","queryKey","key","id","includes","get","axios","buildUrl","showToastr","create","payload","post","verify","destroy","sparkpostDomainsApi","useFetchSparkpostDomain","options","useQuery","_objectSpread","queryFn","retry","useCreateSparkpostDomain","_ref","useMutationWithInvalidation","keysToInvalidate","useVerifySparkpostDomain","_ref2","useDestroySparkpostDomain","_ref3"],"mappings":";;;;;;;;;AAAA;;AAEA,IAAMA,oCAAoC,GAAG,8BAA8B;IAE9DC,SAAS,GAAA,EAAA,CAAAC,MAAA,CAAMF,oCAAoC,EAAQ,QAAA;IAC3DG,eAAe,GAAA,EAAA,CAAAD,MAAA,CAAMF,oCAAoC,EAAoC,oCAAA;IAC7FI,uBAAuB,GAAA,EAAA,CAAAF,MAAA,CAAMF,oCAAoC,EAAmC,mCAAA;IAEpGK,WAAW,GAAA,EAAA,CAAAH,MAAA,CAAMF,oCAAoC,EAAU,UAAA;IAC/DM,iBAAiB,GAAA,EAAA,CAAAJ,MAAA,CAAMF,oCAAoC,EAAsC,sCAAA;IACjGO,yBAAyB,GAAA,EAAA,CAAAL,MAAA,CAAMF,oCAAoC,EAAqC,qCAAA;AAE9G,IAAMQ,qBAAqB,GAAA,EAAA,CAAAN,MAAA,CAAMF,oCAAoC,EAAoB,oBAAA,CAAA;AACzF,IAAMS,kCAAkC,GAAA,EAAA,CAAAP,MAAA,CAAMF,oCAAoC,EAAiC,iCAAA,CAAA;AACnH,IAAMU,4BAA4B,GAAA,EAAA,CAAAR,MAAA,CAAMO,kCAAkC,EAAS,SAAA,CAAA;IAE7EE,QAAQ,GAAA,EAAA,CAAAT,MAAA,CAAMF,oCAAoC,EAAO,OAAA;;AChB/D,IAAMY,UAAU,GAAG;AACxBC,EAAAA,iBAAiB,EAAE,mBAAmB;AACtCC,EAAAA,mBAAmB,EAAE,qBAAqB;AAC1CC,EAAAA,qBAAqB,EAAE,uBAAuB;AAC9CC,EAAAA,gBAAgB,EAAE;AACpB;;ACHO,IAAMC,+BAA+B,GAAG,SAAlCA,+BAA+BA,CAAIC,WAAW,EAAEC,OAAO,E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AE,EAAA;IACrE6B,gBAAgB,EAAE,CAAC,CAACpC,UAAU,CAACG,qBAAqB,EAAEI,OAAO,CAAC;AAChE,GAAC,CAAC;AAAA;IAESgC,yBAAyB,GAAG,SAA5BA,yBAAyBA,CAAAC,KAAA,EAAA;AAAA,EAAA,IAAMjC,OAAO,GAAAiC,KAAA,CAAPjC,OAAO;AAAA,EAAA,OACjD4B,sCAA2B,CAAC,YAAA;AAAA,IAAA,OAAMT,mBAAmB,CAACD,OAAO,CAAClB,OAAO,CAAC;GAAE,EAAA;IACtE6B,gBAAgB,EAAE,CAAC,CAACpC,UAAU,CAACG,qBAAqB,EAAEI,OAAO,CAAC;AAChE,GAAC,CAAC;AAAA;;;;;;;;;;;;;;;;"}
@@ -1,3 +1,4 @@
1
+ import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
1
2
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
2
3
  import { useQuery } from '@tanstack/react-query';
3
4
  import { useMutationWithInvalidation } from '@bigbinary/neeto-commons-frontend/react-utils';
@@ -16,11 +17,24 @@ var OUTLOOK_OAUTH_CONNECT_URL = "".concat(NEETO_EMAIL_DELIVERY_ENGINE_BASE_URL,
16
17
  var SPARKPOST_DOMAINS_URL = "".concat(NEETO_EMAIL_DELIVERY_ENGINE_BASE_URL, "/sparkpost_domains");
17
18
  var SPARKPOST_DOMAINS_INTEGRATIONS_URL = "".concat(NEETO_EMAIL_DELIVERY_ENGINE_BASE_URL, "/integrations/sparkpost_domains");
18
19
  var SPARKPOST_DOMAINS_VERIFY_URL = "".concat(SPARKPOST_DOMAINS_INTEGRATIONS_URL, "/verify");
20
+ var SMTP_URL = "".concat(NEETO_EMAIL_DELIVERY_ENGINE_BASE_URL, "/smtp");
19
21
 
20
22
  var QUERY_KEYS = {
21
23
  INTEGRATION_GMAIL: "integration-gmail",
22
24
  INTEGRATION_OUTLOOK: "integration-outlook",
23
- INTEGRATION_SPARKPOST: "integration-sparkpost"
25
+ INTEGRATION_SPARKPOST: "integration-sparkpost",
26
+ INTEGRATION_SMTP: "integration-smtp"
27
+ };
28
+
29
+ var invalidateAllIntegrationQueries = function invalidateAllIntegrationQueries(queryClient, ownerId) {
30
+ queryClient.invalidateQueries({
31
+ predicate: function predicate(query) {
32
+ var _query$queryKey = _slicedToArray(query.queryKey, 2),
33
+ key = _query$queryKey[0],
34
+ id = _query$queryKey[1];
35
+ return id === ownerId && [QUERY_KEYS.INTEGRATION_GMAIL, QUERY_KEYS.INTEGRATION_OUTLOOK, QUERY_KEYS.INTEGRATION_SPARKPOST, QUERY_KEYS.INTEGRATION_SMTP].includes(key);
36
+ }
37
+ });
24
38
  };
25
39
 
26
40
  var get = function get(ownerId) {
@@ -88,5 +102,5 @@ var useDestroySparkpostDomain = function useDestroySparkpostDomain(_ref3) {
88
102
  });
89
103
  };
90
104
 
91
- export { GMAIL_URL as G, OUTLOOK_URL as O, QUERY_KEYS as Q, useCreateSparkpostDomain as a, useVerifySparkpostDomain as b, useDestroySparkpostDomain as c, GMAIL_OAUTH_URL as d, OUTLOOK_OAUTH_URL as e, GMAIL_OAUTH_CONNECT_URL as f, OUTLOOK_OAUTH_CONNECT_URL as g, useFetchSparkpostDomain as u };
92
- //# sourceMappingURL=useSparkpostApi-W7XibjIp.js.map
105
+ export { GMAIL_URL as G, OUTLOOK_URL as O, QUERY_KEYS as Q, SMTP_URL as S, useCreateSparkpostDomain as a, useVerifySparkpostDomain as b, useDestroySparkpostDomain as c, GMAIL_OAUTH_URL as d, OUTLOOK_OAUTH_URL as e, GMAIL_OAUTH_CONNECT_URL as f, OUTLOOK_OAUTH_CONNECT_URL as g, invalidateAllIntegrationQueries as i, useFetchSparkpostDomain as u };
106
+ //# sourceMappingURL=useSparkpostApi-qpRhsK7H.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSparkpostApi-qpRhsK7H.js","sources":["../app/javascript/src/apis/integrations/constants.js","../app/javascript/src/constants/query.js","../app/javascript/src/utils.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","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 { 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 {\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","QUERY_KEYS","INTEGRATION_GMAIL","INTEGRATION_OUTLOOK","INTEGRATION_SPARKPOST","INTEGRATION_SMTP","invalidateAllIntegrationQueries","queryClient","ownerId","invalidateQueries","predicate","query","_query$queryKey","_slicedToArray","queryKey","key","id","includes","get","axios","buildUrl","showToastr","create","payload","post","verify","destroy","sparkpostDomainsApi","useFetchSparkpostDomain","options","useQuery","_objectSpread","queryFn","retry","useCreateSparkpostDomain","_ref","useMutationWithInvalidation","keysToInvalidate","useVerifySparkpostDomain","_ref2","useDestroySparkpostDomain","_ref3"],"mappings":";;;;;;;AAAA;;AAEA,IAAMA,oCAAoC,GAAG,8BAA8B;IAE9DC,SAAS,GAAA,EAAA,CAAAC,MAAA,CAAMF,oCAAoC,EAAQ,QAAA;IAC3DG,eAAe,GAAA,EAAA,CAAAD,MAAA,CAAMF,oCAAoC,EAAoC,oCAAA;IAC7FI,uBAAuB,GAAA,EAAA,CAAAF,MAAA,CAAMF,oCAAoC,EAAmC,mCAAA;IAEpGK,WAAW,GAAA,EAAA,CAAAH,MAAA,CAAMF,oCAAoC,EAAU,UAAA;IAC/DM,iBAAiB,GAAA,EAAA,CAAAJ,MAAA,CAAMF,oCAAoC,E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V,OAAO,CAAC;AAAA,KAAA;AAC/CyB,IAAAA,KAAK,EAAE;GACJJ,EAAAA,OAAO,CACX,CAAC;AAAA;IAESK,wBAAwB,GAAG,SAA3BA,wBAAwBA,CAAAC,IAAA,EAAA;AAAA,EAAA,IAAM3B,OAAO,GAAA2B,IAAA,CAAP3B,OAAO;EAAA,OAChD4B,2BAA2B,CACzB,UAAAb,OAAO,EAAA;AAAA,IAAA,OAAII,mBAAmB,CAACL,MAAM,CAACd,OAAO,EAAEe,OAAO,CAAC;GACvD,EAAA;IAAEc,gBAAgB,EAAE,CAAC,CAACpC,UAAU,CAACG,qBAAqB,EAAEI,OAAO,CAAC;AAAE,GACpE,CAAC;AAAA;IAEU8B,wBAAwB,GAAG,SAA3BA,wBAAwBA,CAAAC,KAAA,EAAA;AAAA,EAAA,IAAM/B,OAAO,GAAA+B,KAAA,CAAP/B,OAAO;AAAA,EAAA,OAChD4B,2BAA2B,CAAC,YAAA;AAAA,IAAA,OAAMT,mBAAmB,CAACF,MAAM,CAACjB,OAAO,CAAC;GAAE,EAAA;IACrE6B,gBAAgB,EAAE,CAAC,CAACpC,UAAU,CAACG,qBAAqB,EAAEI,OAAO,CAAC;AAChE,GAAC,CAAC;AAAA;IAESgC,yBAAyB,GAAG,SAA5BA,yBAAyBA,CAAAC,KAAA,EAAA;AAAA,EAAA,IAAMjC,OAAO,GAAAiC,KAAA,CAAPjC,OAAO;AAAA,EAAA,OACjD4B,2BAA2B,CAAC,YAAA;AAAA,IAAA,OAAMT,mBAAmB,CAACD,OAAO,CAAClB,OAAO,CAAC;GAAE,EAAA;IACtE6B,gBAAgB,EAAE,CAAC,CAACpC,UAAU,CAACG,qBAAqB,EAAEI,OAAO,CAAC;AAChE,GAAC,CAAC;AAAA;;;;"}
@@ -5,18 +5,7 @@ var react = require('react');
5
5
  var reactQuery = require('@tanstack/react-query');
6
6
  var Toastr = require('@bigbinary/neetoui/Toastr');
7
7
  var reactI18next = require('react-i18next');
8
- var useSparkpostApi = require('./useSparkpostApi-pa64NIl6.js');
9
-
10
- var invalidateAllIntegrationQueries = function invalidateAllIntegrationQueries(queryClient, ownerId) {
11
- queryClient.invalidateQueries({
12
- predicate: function predicate(query) {
13
- var _query$queryKey = _slicedToArray(query.queryKey, 2),
14
- key = _query$queryKey[0],
15
- id = _query$queryKey[1];
16
- return id === ownerId && [useSparkpostApi.QUERY_KEYS.INTEGRATION_GMAIL, useSparkpostApi.QUERY_KEYS.INTEGRATION_OUTLOOK, useSparkpostApi.QUERY_KEYS.INTEGRATION_SPARKPOST].includes(key);
17
- }
18
- });
19
- };
8
+ var useSparkpostApi = require('./useSparkpostApi-D9NOjTNA.js');
20
9
 
21
10
  var useSparkpostDomain = function useSparkpostDomain(_ref) {
22
11
  var ownerId = _ref.ownerId,
@@ -86,7 +75,7 @@ var useSparkpostDomain = function useSparkpostDomain(_ref) {
86
75
  onSuccess: function onSuccess() {
87
76
  Toastr.success(t("neetoEmailDelivery.sparkpost.toasts.domainDisconnected"));
88
77
  setIsDisconnectAlertOpen(false);
89
- invalidateAllIntegrationQueries(queryClient, ownerId);
78
+ useSparkpostApi.invalidateAllIntegrationQueries(queryClient, ownerId);
90
79
  _onSuccess3 === null || _onSuccess3 === void 0 || _onSuccess3();
91
80
  }
92
81
  });
@@ -107,6 +96,5 @@ var useSparkpostDomain = function useSparkpostDomain(_ref) {
107
96
  };
108
97
  };
109
98
 
110
- exports.invalidateAllIntegrationQueries = invalidateAllIntegrationQueries;
111
99
  exports.useSparkpostDomain = useSparkpostDomain;
112
- //# sourceMappingURL=useSparkpostDomain-CK-k6Xrr.js.map
100
+ //# sourceMappingURL=useSparkpostDomain-Brk7SmL4.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSparkpostDomain-Brk7SmL4.js","sources":["../app/javascript/src/hooks/integrations/useSparkpostDomain.js"],"sourcesContent":["import { useState } from \"react\";\n\nimport { useQueryClient } from \"@tanstack/react-query\";\nimport { Toastr } from \"neetoui\";\nimport { useTranslation } from \"react-i18next\";\n\nimport {\n useFetchSparkpostDomain,\n useCreateSparkpostDomain,\n useVerifySparkpostDomain,\n useDestroySparkpostDomain,\n} from \"hooks/reactQuery/integrations/useSparkpostApi\";\nimport { invalidateAllIntegrationQueries } from \"src/utils\";\n\nconst useSparkpostDomain = ({ ownerId, canManageIntegrations }) => {\n const [isDisconnectAlertOpen, setIsDisconnectAlertOpen] = useState(false);\n const { t } = useTranslation();\n const queryClient = useQueryClient();\n\n const { isLoading, data = {} } = useFetchSparkpostDomain(ownerId, {\n enabled: canManageIntegrations,\n });\n\n const { isPending: isCreating, mutate: createDomain } =\n useCreateSparkpostDomain({ ownerId });\n\n const { isPending: isVerifying, mutate: verifyDomain } =\n useVerifySparkpostDomain({ ownerId });\n\n const { isPending: isDestroying, mutate: destroyDomain } =\n useDestroySparkpostDomain({ ownerId });\n\n const onCreateDomain = (email, onSuccess, onError) => {\n createDomain(\n { sparkpostDomain: { email } },\n {\n onSuccess: response => {\n if (response?.alreadyVerified) {\n Toastr.success(\n t(\"neetoEmailDelivery.sparkpost.toasts.domainVerifiedConnected\")\n );\n }\n onSuccess?.(response);\n },\n onError: error => {\n onError?.(error);\n },\n }\n );\n };\n\n const onVerifyDomain = (onSuccess, onError) => {\n verifyDomain(false, {\n onSuccess: response => {\n if (response?.verified) {\n Toastr.success(\n t(\"neetoEmailDelivery.sparkpost.toasts.domainVerified\")\n );\n } else {\n Toastr.warning(\n t(\"neetoEmailDelivery.sparkpost.toasts.verificationPending\")\n );\n }\n onSuccess?.(response);\n },\n onError: error => {\n onError?.(error);\n },\n });\n };\n\n const onDisconnect = onSuccess => {\n destroyDomain(false, {\n onSuccess: () => {\n Toastr.success(\n t(\"neetoEmailDelivery.sparkpost.toasts.domainDisconnected\")\n );\n setIsDisconnectAlertOpen(false);\n invalidateAllIntegrationQueries(queryClient, ownerId);\n onSuccess?.();\n },\n });\n };\n\n return {\n data,\n isLoading,\n isCreating,\n isVerifying,\n isDestroying,\n exists: data?.exists,\n isConnected: data?.connected || false,\n isDisconnectAlertOpen,\n setIsDisconnectAlertOpen,\n onCreateDomain,\n onVerifyDomain,\n onDisconnect,\n };\n};\n\nexport default useSparkpostDomain;\n"],"names":["useSparkpostDomain","_ref","ownerId","canManageIntegrations","_useState","useState","_useState2","_slicedToArray","isDisconnectAlertOpen","setIsDisconnectAlertOpen","_useTranslation","useTranslation","t","queryClient","useQueryClient","_useFetchSparkpostDom","useFetchSparkpostDomain","enabled","isLoading","_useFetchSparkpostDom2","data","_useCreateSparkpostDo","useCreateSparkpostDomain","isCreating","isPending","createDomain","mutate","_useVerifySparkpostDo","useVerifySparkpostDomain","isVerifying","verifyDomain","_useDestroySparkpostD","useDestroySparkpostDomain","isDestroying","destroyDomain","onCreateDomain","email","onSuccess","onError","sparkpostDomain","response","alreadyVerified","Toastr","success","error","onVerifyDomain","verified","warning","onDisconnect","invalidateAllIntegrationQueries","exists","isConnected","connected"],"mappings":";;;;;;;;;AAcA,IAAMA,kBAAkB,GAAG,SAArBA,kBAAkBA,CAAAC,IAAA,EAA2C;AAAA,EAAA,IAArCC,OAAO,GAAAD,IAAA,CAAPC,OAAO;IAAEC,qBAAqB,GAAAF,IAAA,CAArBE,qBAAqB;AAC1D,EAAA,IAAAC,SAAA,GAA0DC,cAAQ,CAAC,KAAK,CAAC;IAAAC,UAAA,GAAAC,cAAA,CAAAH,SAAA,EAAA,CAAA,CAAA;AAAlEI,IAAAA,qBAAqB,GAAAF,UAAA,CAAA,CAAA,CAAA;AAAEG,IAAAA,wBAAwB,GAAAH,UAAA,CAAA,CAAA,CAAA;AACtD,EAAA,IAAAI,eAAA,GAAcC,2BAAc,EAAE;IAAtBC,CAAC,GAAAF,eAAA,CAADE,CAAC;AACT,EAAA,IAAMC,WAAW,GAAGC,yBAAc,EAAE;AAEpC,EAAA,IAAAC,qBAAA,GAAiCC,uCAAuB,CAACd,OAAO,EAAE;AAChEe,MAAAA,OAAO,EAAEd;AACX,KAAC,CAAC;IAFMe,SAAS,GA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