@dextinity/brevo-admin 2.0.0-canary-20260729062014

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 (218) hide show
  1. package/LICENSE +24 -0
  2. package/lib/blocks/NewsletterImageBlock.d.ts +8 -0
  3. package/lib/blocks/NewsletterImageBlock.d.ts.map +1 -0
  4. package/lib/blocks/NewsletterImageBlock.js +20 -0
  5. package/lib/blocks.generated.d.ts +206 -0
  6. package/lib/blocks.generated.d.ts.map +1 -0
  7. package/lib/blocks.generated.js +1 -0
  8. package/lib/brevoConfiguration/BrevoConfigForm.d.ts +8 -0
  9. package/lib/brevoConfiguration/BrevoConfigForm.d.ts.map +1 -0
  10. package/lib/brevoConfiguration/BrevoConfigForm.generated.d.ts +12 -0
  11. package/lib/brevoConfiguration/BrevoConfigForm.generated.d.ts.map +1 -0
  12. package/lib/brevoConfiguration/BrevoConfigForm.generated.js +1 -0
  13. package/lib/brevoConfiguration/BrevoConfigForm.gql.d.ts +6 -0
  14. package/lib/brevoConfiguration/BrevoConfigForm.gql.d.ts.map +1 -0
  15. package/lib/brevoConfiguration/BrevoConfigForm.gql.generated.d.ts +102 -0
  16. package/lib/brevoConfiguration/BrevoConfigForm.gql.generated.d.ts.map +1 -0
  17. package/lib/brevoConfiguration/BrevoConfigForm.gql.generated.js +14 -0
  18. package/lib/brevoConfiguration/BrevoConfigForm.gql.js +9 -0
  19. package/lib/brevoConfiguration/BrevoConfigForm.js +351 -0
  20. package/lib/brevoConfiguration/BrevoConfigPage.d.ts +3 -0
  21. package/lib/brevoConfiguration/BrevoConfigPage.d.ts.map +1 -0
  22. package/lib/brevoConfiguration/BrevoConfigPage.js +17 -0
  23. package/lib/brevoContacts/BrevoContactsGrid.d.ts +13 -0
  24. package/lib/brevoContacts/BrevoContactsGrid.d.ts.map +1 -0
  25. package/lib/brevoContacts/BrevoContactsGrid.generated.d.ts +65 -0
  26. package/lib/brevoContacts/BrevoContactsGrid.generated.d.ts.map +1 -0
  27. package/lib/brevoContacts/BrevoContactsGrid.generated.js +12 -0
  28. package/lib/brevoContacts/BrevoContactsGrid.js +238 -0
  29. package/lib/brevoContacts/BrevoContactsPage.d.ts +16 -0
  30. package/lib/brevoContacts/BrevoContactsPage.d.ts.map +1 -0
  31. package/lib/brevoContacts/BrevoContactsPage.js +77 -0
  32. package/lib/brevoContacts/form/BrevoContactForm.d.ts +19 -0
  33. package/lib/brevoContacts/form/BrevoContactForm.d.ts.map +1 -0
  34. package/lib/brevoContacts/form/BrevoContactForm.generated.d.ts +10 -0
  35. package/lib/brevoContacts/form/BrevoContactForm.generated.d.ts.map +1 -0
  36. package/lib/brevoContacts/form/BrevoContactForm.generated.js +5 -0
  37. package/lib/brevoContacts/form/BrevoContactForm.gql.d.ts +6 -0
  38. package/lib/brevoContacts/form/BrevoContactForm.gql.d.ts.map +1 -0
  39. package/lib/brevoContacts/form/BrevoContactForm.gql.generated.d.ts +58 -0
  40. package/lib/brevoContacts/form/BrevoContactForm.gql.generated.d.ts.map +1 -0
  41. package/lib/brevoContacts/form/BrevoContactForm.gql.generated.js +10 -0
  42. package/lib/brevoContacts/form/BrevoContactForm.gql.js +11 -0
  43. package/lib/brevoContacts/form/BrevoContactForm.js +346 -0
  44. package/lib/brevoTestContacts/BrevoTestContactsGrid.d.ts +13 -0
  45. package/lib/brevoTestContacts/BrevoTestContactsGrid.d.ts.map +1 -0
  46. package/lib/brevoTestContacts/BrevoTestContactsGrid.generated.d.ts +52 -0
  47. package/lib/brevoTestContacts/BrevoTestContactsGrid.generated.d.ts.map +1 -0
  48. package/lib/brevoTestContacts/BrevoTestContactsGrid.generated.js +11 -0
  49. package/lib/brevoTestContacts/BrevoTestContactsGrid.js +205 -0
  50. package/lib/brevoTestContacts/BrevoTestContactsPage.d.ts +18 -0
  51. package/lib/brevoTestContacts/BrevoTestContactsPage.d.ts.map +1 -0
  52. package/lib/brevoTestContacts/BrevoTestContactsPage.js +78 -0
  53. package/lib/brevoTestContacts/form/BrevoTestContactForm.d.ts +19 -0
  54. package/lib/brevoTestContacts/form/BrevoTestContactForm.d.ts.map +1 -0
  55. package/lib/brevoTestContacts/form/BrevoTestContactForm.generated.d.ts +13 -0
  56. package/lib/brevoTestContacts/form/BrevoTestContactForm.generated.d.ts.map +1 -0
  57. package/lib/brevoTestContacts/form/BrevoTestContactForm.generated.js +5 -0
  58. package/lib/brevoTestContacts/form/BrevoTestContactForm.gql.d.ts +6 -0
  59. package/lib/brevoTestContacts/form/BrevoTestContactForm.gql.d.ts.map +1 -0
  60. package/lib/brevoTestContacts/form/BrevoTestContactForm.gql.generated.d.ts +64 -0
  61. package/lib/brevoTestContacts/form/BrevoTestContactForm.gql.generated.d.ts.map +1 -0
  62. package/lib/brevoTestContacts/form/BrevoTestContactForm.gql.generated.js +10 -0
  63. package/lib/brevoTestContacts/form/BrevoTestContactForm.gql.js +11 -0
  64. package/lib/brevoTestContacts/form/BrevoTestContactForm.js +266 -0
  65. package/lib/common/BrevoConfigProvider.d.ts +21 -0
  66. package/lib/common/BrevoConfigProvider.d.ts.map +1 -0
  67. package/lib/common/BrevoConfigProvider.js +33 -0
  68. package/lib/common/contactImport/useContactImportFromCsv.d.ts +18 -0
  69. package/lib/common/contactImport/useContactImportFromCsv.d.ts.map +1 -0
  70. package/lib/common/contactImport/useContactImportFromCsv.gql.d.ts +2 -0
  71. package/lib/common/contactImport/useContactImportFromCsv.gql.d.ts.map +1 -0
  72. package/lib/common/contactImport/useContactImportFromCsv.gql.generated.d.ts +26 -0
  73. package/lib/common/contactImport/useContactImportFromCsv.gql.generated.d.ts.map +1 -0
  74. package/lib/common/contactImport/useContactImportFromCsv.gql.generated.js +5 -0
  75. package/lib/common/contactImport/useContactImportFromCsv.gql.js +4 -0
  76. package/lib/common/contactImport/useContactImportFromCsv.js +462 -0
  77. package/lib/configVerification/ConfigVerification.d.ts +8 -0
  78. package/lib/configVerification/ConfigVerification.d.ts.map +1 -0
  79. package/lib/configVerification/ConfigVerification.gql.d.ts +2 -0
  80. package/lib/configVerification/ConfigVerification.gql.d.ts.map +1 -0
  81. package/lib/configVerification/ConfigVerification.gql.generated.d.ts +17 -0
  82. package/lib/configVerification/ConfigVerification.gql.generated.d.ts.map +1 -0
  83. package/lib/configVerification/ConfigVerification.gql.generated.js +5 -0
  84. package/lib/configVerification/ConfigVerification.gql.js +4 -0
  85. package/lib/configVerification/ConfigVerification.js +41 -0
  86. package/lib/dataGrid/DataGrid.d.ts +3 -0
  87. package/lib/dataGrid/DataGrid.d.ts.map +1 -0
  88. package/lib/dataGrid/DataGrid.js +19 -0
  89. package/lib/emailCampaigns/EmailCampaignsGrid.d.ts +7 -0
  90. package/lib/emailCampaigns/EmailCampaignsGrid.d.ts.map +1 -0
  91. package/lib/emailCampaigns/EmailCampaignsGrid.generated.d.ts +81 -0
  92. package/lib/emailCampaigns/EmailCampaignsGrid.generated.d.ts.map +1 -0
  93. package/lib/emailCampaigns/EmailCampaignsGrid.generated.js +12 -0
  94. package/lib/emailCampaigns/EmailCampaignsGrid.js +281 -0
  95. package/lib/emailCampaigns/EmailCampaignsPage.d.ts +8 -0
  96. package/lib/emailCampaigns/EmailCampaignsPage.d.ts.map +1 -0
  97. package/lib/emailCampaigns/EmailCampaignsPage.js +85 -0
  98. package/lib/emailCampaigns/SendingStateColumn.d.ts +7 -0
  99. package/lib/emailCampaigns/SendingStateColumn.d.ts.map +1 -0
  100. package/lib/emailCampaigns/SendingStateColumn.js +104 -0
  101. package/lib/emailCampaigns/form/ConfigFields.d.ts +2 -0
  102. package/lib/emailCampaigns/form/ConfigFields.d.ts.map +1 -0
  103. package/lib/emailCampaigns/form/ConfigFields.js +26 -0
  104. package/lib/emailCampaigns/form/EmailCampaignForm.d.ts +9 -0
  105. package/lib/emailCampaigns/form/EmailCampaignForm.d.ts.map +1 -0
  106. package/lib/emailCampaigns/form/EmailCampaignForm.gql.d.ts +4 -0
  107. package/lib/emailCampaigns/form/EmailCampaignForm.gql.d.ts.map +1 -0
  108. package/lib/emailCampaigns/form/EmailCampaignForm.gql.generated.d.ts +93 -0
  109. package/lib/emailCampaigns/form/EmailCampaignForm.gql.generated.d.ts.map +1 -0
  110. package/lib/emailCampaigns/form/EmailCampaignForm.gql.generated.js +12 -0
  111. package/lib/emailCampaigns/form/EmailCampaignForm.gql.js +7 -0
  112. package/lib/emailCampaigns/form/EmailCampaignForm.js +418 -0
  113. package/lib/emailCampaigns/form/SendEmailCampaignNowDialog.d.ts +8 -0
  114. package/lib/emailCampaigns/form/SendEmailCampaignNowDialog.d.ts.map +1 -0
  115. package/lib/emailCampaigns/form/SendEmailCampaignNowDialog.js +35 -0
  116. package/lib/emailCampaigns/form/SendManagerFields.d.ts +10 -0
  117. package/lib/emailCampaigns/form/SendManagerFields.d.ts.map +1 -0
  118. package/lib/emailCampaigns/form/SendManagerFields.gql.d.ts +3 -0
  119. package/lib/emailCampaigns/form/SendManagerFields.gql.d.ts.map +1 -0
  120. package/lib/emailCampaigns/form/SendManagerFields.gql.generated.d.ts +39 -0
  121. package/lib/emailCampaigns/form/SendManagerFields.gql.generated.d.ts.map +1 -0
  122. package/lib/emailCampaigns/form/SendManagerFields.gql.generated.js +11 -0
  123. package/lib/emailCampaigns/form/SendManagerFields.gql.js +6 -0
  124. package/lib/emailCampaigns/form/SendManagerFields.js +171 -0
  125. package/lib/emailCampaigns/form/SendManagerWrapper.d.ts +8 -0
  126. package/lib/emailCampaigns/form/SendManagerWrapper.d.ts.map +1 -0
  127. package/lib/emailCampaigns/form/SendManagerWrapper.gql.d.ts +2 -0
  128. package/lib/emailCampaigns/form/SendManagerWrapper.gql.d.ts.map +1 -0
  129. package/lib/emailCampaigns/form/SendManagerWrapper.gql.generated.d.ts +14 -0
  130. package/lib/emailCampaigns/form/SendManagerWrapper.gql.generated.d.ts.map +1 -0
  131. package/lib/emailCampaigns/form/SendManagerWrapper.gql.generated.js +5 -0
  132. package/lib/emailCampaigns/form/SendManagerWrapper.gql.js +4 -0
  133. package/lib/emailCampaigns/form/SendManagerWrapper.js +39 -0
  134. package/lib/emailCampaigns/form/TestEmailCampaignForm.d.ts +10 -0
  135. package/lib/emailCampaigns/form/TestEmailCampaignForm.d.ts.map +1 -0
  136. package/lib/emailCampaigns/form/TestEmailCampaignForm.generated.d.ts +33 -0
  137. package/lib/emailCampaigns/form/TestEmailCampaignForm.generated.d.ts.map +1 -0
  138. package/lib/emailCampaigns/form/TestEmailCampaignForm.generated.js +8 -0
  139. package/lib/emailCampaigns/form/TestEmailCampaignForm.gql.d.ts +2 -0
  140. package/lib/emailCampaigns/form/TestEmailCampaignForm.gql.d.ts.map +1 -0
  141. package/lib/emailCampaigns/form/TestEmailCampaignForm.gql.generated.d.ts +15 -0
  142. package/lib/emailCampaigns/form/TestEmailCampaignForm.gql.generated.d.ts.map +1 -0
  143. package/lib/emailCampaigns/form/TestEmailCampaignForm.gql.generated.js +5 -0
  144. package/lib/emailCampaigns/form/TestEmailCampaignForm.gql.js +4 -0
  145. package/lib/emailCampaigns/form/TestEmailCampaignForm.js +146 -0
  146. package/lib/emailCampaigns/statistics/EmailCampaignStatistics.d.ts +7 -0
  147. package/lib/emailCampaigns/statistics/EmailCampaignStatistics.d.ts.map +1 -0
  148. package/lib/emailCampaigns/statistics/EmailCampaignStatistics.gql.d.ts +2 -0
  149. package/lib/emailCampaigns/statistics/EmailCampaignStatistics.gql.d.ts.map +1 -0
  150. package/lib/emailCampaigns/statistics/EmailCampaignStatistics.gql.generated.d.ts +23 -0
  151. package/lib/emailCampaigns/statistics/EmailCampaignStatistics.gql.generated.d.ts.map +1 -0
  152. package/lib/emailCampaigns/statistics/EmailCampaignStatistics.gql.generated.js +5 -0
  153. package/lib/emailCampaigns/statistics/EmailCampaignStatistics.gql.js +4 -0
  154. package/lib/emailCampaigns/statistics/EmailCampaignStatistics.js +133 -0
  155. package/lib/emailCampaigns/statistics/PercentageCard.d.ts +10 -0
  156. package/lib/emailCampaigns/statistics/PercentageCard.d.ts.map +1 -0
  157. package/lib/emailCampaigns/statistics/PercentageCard.js +145 -0
  158. package/lib/emailCampaigns/view/EmailCampaignView.d.ts +8 -0
  159. package/lib/emailCampaigns/view/EmailCampaignView.d.ts.map +1 -0
  160. package/lib/emailCampaigns/view/EmailCampaignView.gql.d.ts +2 -0
  161. package/lib/emailCampaigns/view/EmailCampaignView.gql.d.ts.map +1 -0
  162. package/lib/emailCampaigns/view/EmailCampaignView.gql.generated.d.ts +18 -0
  163. package/lib/emailCampaigns/view/EmailCampaignView.gql.generated.d.ts.map +1 -0
  164. package/lib/emailCampaigns/view/EmailCampaignView.gql.generated.js +5 -0
  165. package/lib/emailCampaigns/view/EmailCampaignView.gql.js +4 -0
  166. package/lib/emailCampaigns/view/EmailCampaignView.js +81 -0
  167. package/lib/graphql.generated.d.ts +596 -0
  168. package/lib/graphql.generated.d.ts.map +1 -0
  169. package/lib/graphql.generated.js +1 -0
  170. package/lib/index.d.ts +10 -0
  171. package/lib/index.d.ts.map +1 -0
  172. package/lib/index.js +7 -0
  173. package/lib/targetGroups/TargetGroupDialog.d.ts +8 -0
  174. package/lib/targetGroups/TargetGroupDialog.d.ts.map +1 -0
  175. package/lib/targetGroups/TargetGroupDialog.gql.d.ts +2 -0
  176. package/lib/targetGroups/TargetGroupDialog.gql.d.ts.map +1 -0
  177. package/lib/targetGroups/TargetGroupDialog.gql.generated.d.ts +18 -0
  178. package/lib/targetGroups/TargetGroupDialog.gql.generated.d.ts.map +1 -0
  179. package/lib/targetGroups/TargetGroupDialog.gql.generated.js +5 -0
  180. package/lib/targetGroups/TargetGroupDialog.gql.js +4 -0
  181. package/lib/targetGroups/TargetGroupDialog.js +72 -0
  182. package/lib/targetGroups/TargetGroupForm.d.ts +20 -0
  183. package/lib/targetGroups/TargetGroupForm.d.ts.map +1 -0
  184. package/lib/targetGroups/TargetGroupForm.gql.d.ts +4 -0
  185. package/lib/targetGroups/TargetGroupForm.gql.d.ts.map +1 -0
  186. package/lib/targetGroups/TargetGroupForm.gql.generated.d.ts +37 -0
  187. package/lib/targetGroups/TargetGroupForm.gql.generated.d.ts.map +1 -0
  188. package/lib/targetGroups/TargetGroupForm.gql.generated.js +8 -0
  189. package/lib/targetGroups/TargetGroupForm.gql.js +9 -0
  190. package/lib/targetGroups/TargetGroupForm.js +219 -0
  191. package/lib/targetGroups/TargetGroupsGrid.d.ts +18 -0
  192. package/lib/targetGroups/TargetGroupsGrid.d.ts.map +1 -0
  193. package/lib/targetGroups/TargetGroupsGrid.generated.d.ts +90 -0
  194. package/lib/targetGroups/TargetGroupsGrid.generated.d.ts.map +1 -0
  195. package/lib/targetGroups/TargetGroupsGrid.generated.js +14 -0
  196. package/lib/targetGroups/TargetGroupsGrid.js +280 -0
  197. package/lib/targetGroups/TargetGroupsPage.d.ts +26 -0
  198. package/lib/targetGroups/TargetGroupsPage.d.ts.map +1 -0
  199. package/lib/targetGroups/TargetGroupsPage.js +63 -0
  200. package/lib/targetGroups/addContacts/AddContactsGridSelect.d.ts +10 -0
  201. package/lib/targetGroups/addContacts/AddContactsGridSelect.d.ts.map +1 -0
  202. package/lib/targetGroups/addContacts/AddContactsGridSelect.gql.d.ts +5 -0
  203. package/lib/targetGroups/addContacts/AddContactsGridSelect.gql.d.ts.map +1 -0
  204. package/lib/targetGroups/addContacts/AddContactsGridSelect.gql.generated.d.ts +84 -0
  205. package/lib/targetGroups/addContacts/AddContactsGridSelect.gql.generated.d.ts.map +1 -0
  206. package/lib/targetGroups/addContacts/AddContactsGridSelect.gql.generated.js +13 -0
  207. package/lib/targetGroups/addContacts/AddContactsGridSelect.gql.js +8 -0
  208. package/lib/targetGroups/addContacts/AddContactsGridSelect.js +346 -0
  209. package/lib/targetGroups/allAssignedContacts/AllAssignedContactsGrid.d.ts +10 -0
  210. package/lib/targetGroups/allAssignedContacts/AllAssignedContactsGrid.d.ts.map +1 -0
  211. package/lib/targetGroups/allAssignedContacts/AllAssignedContactsGrid.gql.d.ts +2 -0
  212. package/lib/targetGroups/allAssignedContacts/AllAssignedContactsGrid.gql.d.ts.map +1 -0
  213. package/lib/targetGroups/allAssignedContacts/AllAssignedContactsGrid.gql.generated.d.ts +42 -0
  214. package/lib/targetGroups/allAssignedContacts/AllAssignedContactsGrid.gql.generated.d.ts.map +1 -0
  215. package/lib/targetGroups/allAssignedContacts/AllAssignedContactsGrid.gql.generated.js +8 -0
  216. package/lib/targetGroups/allAssignedContacts/AllAssignedContactsGrid.gql.js +5 -0
  217. package/lib/targetGroups/allAssignedContacts/AllAssignedContactsGrid.js +112 -0
  218. package/package.json +109 -0
@@ -0,0 +1,346 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ var _excluded = ["email", "redirectionUrl", "sendDoubleOptIn"];
3
+ var _templateObject;
4
+ function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
5
+ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
6
+ function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
7
+ function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, _regeneratorDefine2(e, r, n, t); }
8
+ function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
9
+ function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
10
+ 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; }
11
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).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; }
12
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
13
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
14
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
15
+ function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
16
+ import { gql, useApolloClient, useQuery } from "@apollo/client";
17
+ import { Alert, CheckboxField, FinalForm, FinalFormSaveButton, FormSection, Loading, MainContent, TextField, Toolbar, ToolbarActions, ToolbarFillSpace, ToolbarItem, ToolbarTitleItem, useErrorDialog, useFormApiRef, useStackApi } from "@dextinity/admin";
18
+ import { ArrowLeft } from "@dextinity/admin-icons";
19
+ import { ContentScopeIndicator, resolveHasSaveConflict, useFormSaveConflict } from "@dextinity/cms-admin";
20
+ import { Card, IconButton } from "@mui/material";
21
+ import { Box } from "@mui/system";
22
+ import { useMemo } from "react";
23
+ import { FormattedMessage } from "react-intl";
24
+ import { useBrevoConfig } from "../../common/BrevoConfigProvider";
25
+ import { brevoContactFormCheckForChangesQuery, brevoContactFormQuery, createBrevoContactMutation, updateBrevoContactMutation } from "./BrevoContactForm.gql";
26
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
27
+ export function BrevoContactForm(_ref) {
28
+ var _additionalAttributes;
29
+ var id = _ref.id,
30
+ scope = _ref.scope,
31
+ input2State = _ref.input2State,
32
+ additionalFormFields = _ref.additionalFormFields,
33
+ additionalAttributesFragment = _ref.additionalAttributesFragment;
34
+ var stackApi = useStackApi();
35
+ var client = useApolloClient();
36
+ var mode = id ? "edit" : "add";
37
+ var formApiRef = useFormApiRef();
38
+ var _useBrevoConfig = useBrevoConfig(),
39
+ allowAddingContactsWithoutDoi = _useBrevoConfig.allowAddingContactsWithoutDoi;
40
+ var errorDialog = useErrorDialog();
41
+ var brevoContactFormFragment = gql(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n fragment BrevoContactForm on BrevoContact {\n email\n ", "\n }\n ", "\n"])), additionalAttributesFragment ? "...".concat(additionalAttributesFragment === null || additionalAttributesFragment === void 0 ? void 0 : additionalAttributesFragment.name) : "", (_additionalAttributes = additionalAttributesFragment === null || additionalAttributesFragment === void 0 ? void 0 : additionalAttributesFragment.fragment) !== null && _additionalAttributes !== void 0 ? _additionalAttributes : "");
42
+ var _useQuery = useQuery(brevoContactFormQuery(brevoContactFormFragment), id ? {
43
+ variables: {
44
+ id: id,
45
+ scope: scope
46
+ }
47
+ } : {
48
+ skip: true
49
+ }),
50
+ data = _useQuery.data,
51
+ loading = _useQuery.loading,
52
+ refetch = _useQuery.refetch;
53
+ var initialValues = useMemo(function () {
54
+ var _data$brevoContact;
55
+ var baseInitialValues = {
56
+ email: "",
57
+ redirectionUrl: "",
58
+ sendDoubleOptIn: true
59
+ };
60
+ if (input2State) {
61
+ baseInitialValues = _objectSpread(_objectSpread({}, baseInitialValues), input2State(data === null || data === void 0 ? void 0 : data.brevoContact));
62
+ }
63
+ return data !== null && data !== void 0 && (_data$brevoContact = data.brevoContact) !== null && _data$brevoContact !== void 0 && _data$brevoContact.email ? _objectSpread(_objectSpread({}, baseInitialValues), {}, {
64
+ email: data.brevoContact.email
65
+ }) : baseInitialValues;
66
+ }, [data === null || data === void 0 ? void 0 : data.brevoContact, input2State]);
67
+ var saveConflict = useFormSaveConflict({
68
+ checkConflict: function () {
69
+ var _checkConflict = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
70
+ var _data$brevoContact2;
71
+ var _yield$client$query, updatedData;
72
+ return _regenerator().w(function (_context) {
73
+ while (1) switch (_context.n) {
74
+ case 0:
75
+ if (id) {
76
+ _context.n = 1;
77
+ break;
78
+ }
79
+ return _context.a(2, false);
80
+ case 1:
81
+ _context.n = 2;
82
+ return client.query({
83
+ query: brevoContactFormCheckForChangesQuery,
84
+ variables: {
85
+ id: id,
86
+ scope: scope
87
+ },
88
+ fetchPolicy: "no-cache"
89
+ });
90
+ case 2:
91
+ _yield$client$query = _context.v;
92
+ updatedData = _yield$client$query.data;
93
+ return _context.a(2, resolveHasSaveConflict(data === null || data === void 0 || (_data$brevoContact2 = data.brevoContact) === null || _data$brevoContact2 === void 0 ? void 0 : _data$brevoContact2.modifiedAt, updatedData.brevoContact.modifiedAt));
94
+ }
95
+ }, _callee);
96
+ }));
97
+ function checkConflict() {
98
+ return _checkConflict.apply(this, arguments);
99
+ }
100
+ return checkConflict;
101
+ }(),
102
+ formApiRef: formApiRef,
103
+ loadLatestVersion: function () {
104
+ var _loadLatestVersion = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {
105
+ return _regenerator().w(function (_context2) {
106
+ while (1) switch (_context2.n) {
107
+ case 0:
108
+ _context2.n = 1;
109
+ return refetch();
110
+ case 1:
111
+ return _context2.a(2);
112
+ }
113
+ }, _callee2);
114
+ }));
115
+ function loadLatestVersion() {
116
+ return _loadLatestVersion.apply(this, arguments);
117
+ }
118
+ return loadLatestVersion;
119
+ }()
120
+ });
121
+ var handleSubmit = /*#__PURE__*/function () {
122
+ var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(state, form, event) {
123
+ var output, email, redirectionUrl, sendDoubleOptIn, rest, _yield$client$mutate, mutationResponse, response, _t;
124
+ return _regenerator().w(function (_context3) {
125
+ while (1) switch (_context3.p = _context3.n) {
126
+ case 0:
127
+ _context3.p = 0;
128
+ _context3.n = 1;
129
+ return saveConflict.checkForConflicts();
130
+ case 1:
131
+ if (!_context3.v) {
132
+ _context3.n = 2;
133
+ break;
134
+ }
135
+ throw new Error("Conflicts detected");
136
+ case 2:
137
+ output = _objectSpread(_objectSpread({}, state), {}, {
138
+ blocked: false
139
+ });
140
+ if (!(mode === "edit")) {
141
+ _context3.n = 5;
142
+ break;
143
+ }
144
+ if (id) {
145
+ _context3.n = 3;
146
+ break;
147
+ }
148
+ throw new Error("Missing id in edit mode");
149
+ case 3:
150
+ email = output.email, redirectionUrl = output.redirectionUrl, sendDoubleOptIn = output.sendDoubleOptIn, rest = _objectWithoutProperties(output, _excluded);
151
+ _context3.n = 4;
152
+ return client.mutate({
153
+ mutation: updateBrevoContactMutation(brevoContactFormFragment),
154
+ variables: {
155
+ id: id,
156
+ input: rest,
157
+ scope: scope
158
+ }
159
+ });
160
+ case 4:
161
+ _context3.n = 11;
162
+ break;
163
+ case 5:
164
+ _context3.n = 6;
165
+ return client.mutate({
166
+ mutation: createBrevoContactMutation,
167
+ variables: {
168
+ scope: scope,
169
+ input: output
170
+ }
171
+ });
172
+ case 6:
173
+ _yield$client$mutate = _context3.v;
174
+ mutationResponse = _yield$client$mutate.data;
175
+ if (event.navigatingBack) {
176
+ _context3.n = 11;
177
+ break;
178
+ }
179
+ response = mutationResponse === null || mutationResponse === void 0 ? void 0 : mutationResponse.createBrevoContact;
180
+ if (!(response === "SUCCESSFUL")) {
181
+ _context3.n = 7;
182
+ break;
183
+ }
184
+ setTimeout(function () {
185
+ stackApi === null || stackApi === void 0 || stackApi.goBack();
186
+ });
187
+ _context3.n = 11;
188
+ break;
189
+ case 7:
190
+ if (!(response === "ERROR_CONTAINED_IN_ECG_RTR_LIST")) {
191
+ _context3.n = 8;
192
+ break;
193
+ }
194
+ throw new Error("Contact contained in ECG RTR list, cannot create contact");
195
+ case 8:
196
+ if (!(response === "ERROR_CONTACT_IS_BLACKLISTED")) {
197
+ _context3.n = 9;
198
+ break;
199
+ }
200
+ throw new Error("Contact could not be created as it is blacklisted.");
201
+ case 9:
202
+ if (!(response === "ERROR_CONTACT_ALREADY_EXISTS")) {
203
+ _context3.n = 10;
204
+ break;
205
+ }
206
+ throw new Error("A contact with this email already exists.");
207
+ case 10:
208
+ throw new Error("Error creating contact");
209
+ case 11:
210
+ _context3.n = 13;
211
+ break;
212
+ case 12:
213
+ _context3.p = 12;
214
+ _t = _context3.v;
215
+ errorDialog === null || errorDialog === void 0 || errorDialog.showError({
216
+ title: "Error",
217
+ userMessage: /*#__PURE__*/_jsx(Alert, {
218
+ severity: "error",
219
+ children: _t.message
220
+ }),
221
+ error: String(_t)
222
+ });
223
+ case 13:
224
+ return _context3.a(2);
225
+ }
226
+ }, _callee3, null, [[0, 12]]);
227
+ }));
228
+ return function handleSubmit(_x, _x2, _x3) {
229
+ return _ref2.apply(this, arguments);
230
+ };
231
+ }();
232
+ if (loading) {
233
+ return /*#__PURE__*/_jsx(Loading, {
234
+ behavior: "fillPageHeight"
235
+ });
236
+ }
237
+ return /*#__PURE__*/_jsx(FinalForm, {
238
+ apiRef: formApiRef,
239
+ onSubmit: handleSubmit,
240
+ mode: mode,
241
+ initialValues: initialValues,
242
+ children: function children(_ref3) {
243
+ var values = _ref3.values;
244
+ return /*#__PURE__*/_jsxs(_Fragment, {
245
+ children: [saveConflict.dialogs, /*#__PURE__*/_jsxs(Toolbar, {
246
+ scopeIndicator: /*#__PURE__*/_jsx(ContentScopeIndicator, {
247
+ scope: scope
248
+ }),
249
+ children: [/*#__PURE__*/_jsx(ToolbarItem, {
250
+ children: /*#__PURE__*/_jsx(IconButton, {
251
+ onClick: stackApi === null || stackApi === void 0 ? void 0 : stackApi.goBack,
252
+ children: /*#__PURE__*/_jsx(ArrowLeft, {})
253
+ })
254
+ }), /*#__PURE__*/_jsx(ToolbarTitleItem, {
255
+ children: /*#__PURE__*/_jsx(FormattedMessage, {
256
+ id: "cometBrevoModule.brevoContacts.brevoContact",
257
+ defaultMessage: "Contact"
258
+ })
259
+ }), /*#__PURE__*/_jsx(ToolbarFillSpace, {}), /*#__PURE__*/_jsx(ToolbarActions, {
260
+ children: /*#__PURE__*/_jsx(FinalFormSaveButton, {
261
+ hasConflict: saveConflict.hasConflict
262
+ })
263
+ })]
264
+ }), /*#__PURE__*/_jsxs(MainContent, {
265
+ children: [mode === "edit" && /*#__PURE__*/_jsx(Box, {
266
+ sx: {
267
+ marginBottom: 4
268
+ },
269
+ children: /*#__PURE__*/_jsx(Alert, {
270
+ severity: "warning",
271
+ children: /*#__PURE__*/_jsx(FormattedMessage, {
272
+ id: "cometBrevoModule.brevoContact.contactEditAlert",
273
+ defaultMessage: "Editing a contact will affect all scopes and the target groups within those scopes."
274
+ })
275
+ })
276
+ }), /*#__PURE__*/_jsx(TextField, {
277
+ required: true,
278
+ fullWidth: true,
279
+ name: "email",
280
+ label: /*#__PURE__*/_jsx(FormattedMessage, {
281
+ id: "cometBrevoModule.brevoContact.email",
282
+ defaultMessage: "Email"
283
+ }),
284
+ disabled: mode === "edit"
285
+ }), mode === "add" && /*#__PURE__*/_jsx(Card, {
286
+ sx: {
287
+ padding: 4,
288
+ marginBottom: 5
289
+ },
290
+ children: /*#__PURE__*/_jsxs(FormSection, {
291
+ title: /*#__PURE__*/_jsx(FormattedMessage, {
292
+ id: "cometBrevoModule.brevoContact.doubleOptIn",
293
+ defaultMessage: "Double Opt-in"
294
+ }),
295
+ children: [allowAddingContactsWithoutDoi && /*#__PURE__*/_jsx(CheckboxField, {
296
+ name: "sendDoubleOptIn",
297
+ label: /*#__PURE__*/_jsx(FormattedMessage, {
298
+ id: "cometBrevoModule.brevoContact.sendDoubleOptInMail",
299
+ defaultMessage: "Send double opt-in email"
300
+ }),
301
+ fullWidth: true
302
+ }), values.sendDoubleOptIn ? /*#__PURE__*/_jsx(Alert, {
303
+ severity: "warning",
304
+ sx: {
305
+ marginBottom: 5
306
+ },
307
+ children: /*#__PURE__*/_jsx(FormattedMessage, {
308
+ id: "cometBrevoModule.brevoContact.contactAddAlert",
309
+ defaultMessage: "The contact will get a double opt-in email to confirm the subscription. After the contact's confirmation, the contact will be added to the corresponding target groups in this scope depending on the contact's attributes. Before the confirmation the contact will not be shown on the contacts page."
310
+ })
311
+ }) : /*#__PURE__*/_jsx(Alert, {
312
+ severity: "error",
313
+ sx: {
314
+ marginBottom: 5
315
+ },
316
+ children: /*#__PURE__*/_jsx(FormattedMessage, {
317
+ id: "cometBrevoModule.brevoContact.contactNoOptInAlert",
318
+ defaultMessage: "No Double Opt-In email will be sent. You are responsible for ensuring that recipients have provided their consent before proceeding. If consent has not been given, sending a Double Opt-In email is legally required. Additionally, the creation of the user will be tracked, and you may need to provide clarification if users report any issues."
319
+ })
320
+ }), /*#__PURE__*/_jsx(TextField, {
321
+ disabled: values.sendDoubleOptIn ? false : true,
322
+ fullWidth: true,
323
+ name: "redirectionUrl",
324
+ label: /*#__PURE__*/_jsx(FormattedMessage, {
325
+ id: "cometBrevoModule.brevoContact.redirectionUrl",
326
+ defaultMessage: "Redirection Url (Contact will be redirected to this page after the confirmation in the double opt-in email)"
327
+ })
328
+ })]
329
+ })
330
+ }), additionalFormFields && /*#__PURE__*/_jsx(Card, {
331
+ sx: {
332
+ padding: 4
333
+ },
334
+ children: /*#__PURE__*/_jsx(FormSection, {
335
+ title: /*#__PURE__*/_jsx(FormattedMessage, {
336
+ id: "cometBrevoModule.brevoContact.attributes",
337
+ defaultMessage: "Attributes"
338
+ }),
339
+ children: additionalFormFields
340
+ })
341
+ })]
342
+ })]
343
+ });
344
+ }
345
+ });
346
+ }
@@ -0,0 +1,13 @@
1
+ import { type DocumentNode } from "@apollo/client";
2
+ import { type GridColDef } from "@dextinity/admin";
3
+ import type { ContentScope } from "@dextinity/cms-admin";
4
+ import type { ReactElement } from "react";
5
+ export declare function BrevoTestContactsGrid({ scope, additionalAttributesFragment, additionalGridFields, }: {
6
+ scope: ContentScope;
7
+ additionalAttributesFragment?: {
8
+ name: string;
9
+ fragment: DocumentNode;
10
+ };
11
+ additionalGridFields?: GridColDef[];
12
+ }): ReactElement;
13
+ //# sourceMappingURL=BrevoTestContactsGrid.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BrevoTestContactsGrid.d.ts","sourceRoot":"","sources":["../../src/brevoTestContacts/BrevoTestContactsGrid.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAkC,MAAM,gBAAgB,CAAC;AACnF,OAAO,EAIH,KAAK,UAAU,EAalB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAGzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AA+D1C,wBAAgB,qBAAqB,CAAC,EAClC,KAAK,EACL,4BAA4B,EAC5B,oBAAyB,GAC5B,EAAE;IACC,KAAK,EAAE,YAAY,CAAC;IACpB,4BAA4B,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,YAAY,CAAA;KAAE,CAAC;IACxE,oBAAoB,CAAC,EAAE,UAAU,EAAE,CAAC;CACvC,GAAG,YAAY,CA6Hf"}
@@ -0,0 +1,52 @@
1
+ import * as Types from '../graphql.generated';
2
+ export declare const namedOperations: {
3
+ Query: {
4
+ BrevoTestContactsGrid: string;
5
+ };
6
+ Mutation: {
7
+ DeleteBrevoTestContact: string;
8
+ };
9
+ Fragment: {
10
+ BrevoContactsList: string;
11
+ };
12
+ };
13
+ export type GQLBrevoContactsListFragment = {
14
+ __typename?: 'BrevoContact';
15
+ id: number;
16
+ createdAt: string;
17
+ modifiedAt: string;
18
+ email: string;
19
+ emailBlacklisted: boolean;
20
+ smsBlacklisted: boolean;
21
+ };
22
+ export type GQLDeleteBrevoTestContactMutationVariables = Types.Exact<{
23
+ id: Types.Scalars['Int']['input'];
24
+ scope: Types.GQLEmailCampaignContentScopeInput;
25
+ }>;
26
+ export type GQLDeleteBrevoTestContactMutation = {
27
+ __typename?: 'Mutation';
28
+ deleteBrevoTestContact: boolean;
29
+ };
30
+ export type GQLBrevoTestContactsGridQueryVariables = Types.Exact<{
31
+ offset?: Types.InputMaybe<Types.Scalars['Int']['input']>;
32
+ limit?: Types.InputMaybe<Types.Scalars['Int']['input']>;
33
+ email?: Types.InputMaybe<Types.Scalars['String']['input']>;
34
+ scope: Types.GQLEmailCampaignContentScopeInput;
35
+ }>;
36
+ export type GQLBrevoTestContactsGridQuery = {
37
+ __typename?: 'Query';
38
+ brevoTestContacts: {
39
+ __typename?: 'PaginatedBrevoContacts';
40
+ totalCount: number;
41
+ nodes: Array<{
42
+ __typename?: 'BrevoContact';
43
+ id: number;
44
+ createdAt: string;
45
+ modifiedAt: string;
46
+ email: string;
47
+ emailBlacklisted: boolean;
48
+ smsBlacklisted: boolean;
49
+ }>;
50
+ };
51
+ };
52
+ //# sourceMappingURL=BrevoTestContactsGrid.generated.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BrevoTestContactsGrid.generated.d.ts","sourceRoot":"","sources":["../../src/brevoTestContacts/BrevoTestContactsGrid.generated.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,sBAAsB,CAAC;AAE9C,eAAO,MAAM,eAAe;;;;;;;;;;CAU3B,CAAA;AACD,MAAM,MAAM,4BAA4B,GAAG;IAAE,UAAU,CAAC,EAAE,cAAc,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,gBAAgB,EAAE,OAAO,CAAC;IAAC,cAAc,EAAE,OAAO,CAAA;CAAE,CAAC;AAEjM,MAAM,MAAM,0CAA0C,GAAG,KAAK,CAAC,KAAK,CAAC;IACnE,EAAE,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC;IAClC,KAAK,EAAE,KAAK,CAAC,iCAAiC,CAAC;CAChD,CAAC,CAAC;AAGH,MAAM,MAAM,iCAAiC,GAAG;IAAE,UAAU,CAAC,EAAE,UAAU,CAAC;IAAC,sBAAsB,EAAE,OAAO,CAAA;CAAE,CAAC;AAE7G,MAAM,MAAM,sCAAsC,GAAG,KAAK,CAAC,KAAK,CAAC;IAC/D,MAAM,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IACzD,KAAK,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IACxD,KAAK,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IAC3D,KAAK,EAAE,KAAK,CAAC,iCAAiC,CAAC;CAChD,CAAC,CAAC;AAGH,MAAM,MAAM,6BAA6B,GAAG;IAAE,UAAU,CAAC,EAAE,OAAO,CAAC;IAAC,iBAAiB,EAAE;QAAE,UAAU,CAAC,EAAE,wBAAwB,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,KAAK,CAAC;YAAE,UAAU,CAAC,EAAE,cAAc,CAAC;YAAC,EAAE,EAAE,MAAM,CAAC;YAAC,SAAS,EAAE,MAAM,CAAC;YAAC,UAAU,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAC;YAAC,gBAAgB,EAAE,OAAO,CAAC;YAAC,cAAc,EAAE,OAAO,CAAA;SAAE,CAAC,CAAA;KAAE,CAAA;CAAE,CAAC"}
@@ -0,0 +1,11 @@
1
+ export var namedOperations = {
2
+ Query: {
3
+ BrevoTestContactsGrid: 'BrevoTestContactsGrid'
4
+ },
5
+ Mutation: {
6
+ DeleteBrevoTestContact: 'DeleteBrevoTestContact'
7
+ },
8
+ Fragment: {
9
+ BrevoContactsList: 'BrevoContactsList'
10
+ }
11
+ };
@@ -0,0 +1,205 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ var _templateObject, _templateObject2, _templateObject3;
3
+ function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
4
+ function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, _regeneratorDefine2(e, r, n, t); }
5
+ function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
6
+ function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
7
+ function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
8
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
9
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
10
+ function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
11
+ function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
12
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
13
+ 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; }
14
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).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; }
15
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
16
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
17
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
18
+ function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
19
+ import { gql, useApolloClient, useQuery } from "@apollo/client";
20
+ import { Alert, Button, DataGridToolbar, GridToolbarQuickFilter, MainContent, messages, RowActionsItem, RowActionsMenu, StackLink, ToolbarFillSpace, ToolbarTitleItem, Tooltip, useBufferedRowCount, useDataGridRemote, usePersistentColumnState } from "@dextinity/admin";
21
+ import { Add, Delete, Edit } from "@dextinity/admin-icons";
22
+ import { Box, IconButton } from "@mui/material";
23
+ import { FormattedMessage, useIntl } from "react-intl";
24
+ import { DataGrid } from "../dataGrid/DataGrid";
25
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
26
+ var brevoContactsFragment = gql(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n fragment BrevoContactsList on BrevoContact {\n id\n createdAt\n modifiedAt\n email\n emailBlacklisted\n smsBlacklisted\n }\n"])));
27
+ var deleteBrevoTestContactMutation = gql(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n mutation DeleteBrevoTestContact($id: Int!, $scope: EmailCampaignContentScopeInput!) {\n deleteBrevoTestContact(id: $id, scope: $scope)\n }\n"])));
28
+ function BrevoTestContactsGridToolbar(_ref) {
29
+ var intl = _ref.intl,
30
+ totalCount = _ref.totalCount;
31
+ var disableButton = totalCount >= 100;
32
+ var tooltipMessage = intl.formatMessage({
33
+ id: "cometBrevoModule.brevoTestContact.contactLimitReached",
34
+ defaultMessage: "Contact limit of 100 reached. You cannot add more contacts."
35
+ });
36
+ return /*#__PURE__*/_jsxs(DataGridToolbar, {
37
+ children: [/*#__PURE__*/_jsx(ToolbarTitleItem, {
38
+ children: /*#__PURE__*/_jsx(FormattedMessage, {
39
+ id: "cometBrevoModule.brevoTestContact.title",
40
+ defaultMessage: "Test contacts"
41
+ })
42
+ }), /*#__PURE__*/_jsx(GridToolbarQuickFilter, {
43
+ placeholder: intl.formatMessage({
44
+ id: "cometBrevoModule.brevoTestContact.searchEmail",
45
+ defaultMessage: "Search email address"
46
+ })
47
+ }), /*#__PURE__*/_jsx(ToolbarFillSpace, {}), /*#__PURE__*/_jsx(Tooltip, {
48
+ title: disableButton ? tooltipMessage : "",
49
+ children: /*#__PURE__*/_jsx("span", {
50
+ children: /*#__PURE__*/_jsx(Button, {
51
+ startIcon: /*#__PURE__*/_jsx(Add, {}),
52
+ component: StackLink,
53
+ pageName: "add",
54
+ payload: "add",
55
+ variant: "primary",
56
+ disabled: disableButton,
57
+ children: /*#__PURE__*/_jsx(FormattedMessage, {
58
+ id: "cometBrevoModule.brevoTestContact.newContact",
59
+ defaultMessage: "New test contact"
60
+ })
61
+ })
62
+ })
63
+ })]
64
+ });
65
+ }
66
+ export function BrevoTestContactsGrid(_ref2) {
67
+ var _additionalAttributes, _dataGridProps$filter, _dataGridProps$filter2, _data$brevoTestContac;
68
+ var scope = _ref2.scope,
69
+ additionalAttributesFragment = _ref2.additionalAttributesFragment,
70
+ _ref2$additionalGridF = _ref2.additionalGridFields,
71
+ additionalGridFields = _ref2$additionalGridF === void 0 ? [] : _ref2$additionalGridF;
72
+ var brevoTestContactsQuery = gql(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n query BrevoTestContactsGrid($offset: Int, $limit: Int, $email: String, $scope: EmailCampaignContentScopeInput!) {\n brevoTestContacts(offset: $offset, limit: $limit, email: $email, scope: $scope) {\n nodes {\n ...BrevoContactsList\n ", "\n }\n totalCount\n }\n }\n ", "\n ", "\n "])), additionalAttributesFragment ? "...".concat(additionalAttributesFragment === null || additionalAttributesFragment === void 0 ? void 0 : additionalAttributesFragment.name) : "", brevoContactsFragment, (_additionalAttributes = additionalAttributesFragment === null || additionalAttributesFragment === void 0 ? void 0 : additionalAttributesFragment.fragment) !== null && _additionalAttributes !== void 0 ? _additionalAttributes : "");
73
+ var client = useApolloClient();
74
+ var intl = useIntl();
75
+ var dataGridProps = _objectSpread(_objectSpread({}, useDataGridRemote()), usePersistentColumnState("BrevoContactsGrid"));
76
+ var columns = [{
77
+ field: "createdAt",
78
+ headerName: intl.formatMessage({
79
+ id: "cometBrevoModule.brevoTestContact.subscribedAt",
80
+ defaultMessage: "Subscribed At"
81
+ }),
82
+ filterable: false,
83
+ sortable: false,
84
+ width: 150,
85
+ renderCell: function renderCell(_ref3) {
86
+ var row = _ref3.row;
87
+ return intl.formatDate(new Date(row.createdAt));
88
+ }
89
+ }, {
90
+ field: "modifiedAt",
91
+ headerName: intl.formatMessage({
92
+ id: "cometBrevoModule.brevoTestContact.modifiedAt",
93
+ defaultMessage: "Modified At"
94
+ }),
95
+ filterable: false,
96
+ sortable: false,
97
+ width: 150,
98
+ renderCell: function renderCell(_ref4) {
99
+ var row = _ref4.row;
100
+ return intl.formatDate(new Date(row.modifiedAt));
101
+ }
102
+ }, {
103
+ field: "email",
104
+ headerName: intl.formatMessage({
105
+ id: "cometBrevoModule.brevoTestContact.email",
106
+ defaultMessage: "Email"
107
+ }),
108
+ filterable: false,
109
+ sortable: false,
110
+ width: 150,
111
+ flex: 1
112
+ }].concat(_toConsumableArray(additionalGridFields), [{
113
+ field: "actions",
114
+ headerName: "",
115
+ sortable: false,
116
+ filterable: false,
117
+ type: "actions",
118
+ renderCell: function renderCell(params) {
119
+ return /*#__PURE__*/_jsxs(_Fragment, {
120
+ children: [/*#__PURE__*/_jsx(IconButton, {
121
+ component: StackLink,
122
+ pageName: "edit",
123
+ payload: params.row.id.toString(),
124
+ children: /*#__PURE__*/_jsx(Edit, {
125
+ color: "primary"
126
+ })
127
+ }), /*#__PURE__*/_jsx(RowActionsMenu, {
128
+ children: /*#__PURE__*/_jsx(RowActionsMenu, {
129
+ children: /*#__PURE__*/_jsx(RowActionsItem, {
130
+ onClick: /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
131
+ return _regenerator().w(function (_context) {
132
+ while (1) switch (_context.n) {
133
+ case 0:
134
+ _context.n = 1;
135
+ return client.mutate({
136
+ mutation: deleteBrevoTestContactMutation,
137
+ variables: {
138
+ id: params.row.id,
139
+ scope: scope
140
+ },
141
+ refetchQueries: [brevoTestContactsQuery]
142
+ });
143
+ case 1:
144
+ return _context.a(2);
145
+ }
146
+ }, _callee);
147
+ })),
148
+ icon: /*#__PURE__*/_jsx(Delete, {}),
149
+ children: /*#__PURE__*/_jsx(FormattedMessage, _objectSpread({}, messages["delete"]))
150
+ })
151
+ })
152
+ })]
153
+ });
154
+ }
155
+ }]);
156
+ var _useQuery = useQuery(brevoTestContactsQuery, {
157
+ variables: {
158
+ offset: dataGridProps.paginationModel.page * dataGridProps.paginationModel.pageSize,
159
+ limit: dataGridProps.paginationModel.pageSize,
160
+ email: (_dataGridProps$filter = dataGridProps.filterModel) !== null && _dataGridProps$filter !== void 0 && _dataGridProps$filter.quickFilterValues ? (_dataGridProps$filter2 = dataGridProps.filterModel) === null || _dataGridProps$filter2 === void 0 ? void 0 : _dataGridProps$filter2.quickFilterValues[0] : undefined,
161
+ scope: scope
162
+ }
163
+ }),
164
+ data = _useQuery.data,
165
+ loading = _useQuery.loading,
166
+ error = _useQuery.error;
167
+ var rowCount = useBufferedRowCount(data === null || data === void 0 ? void 0 : data.brevoTestContacts.totalCount);
168
+ if (error) {
169
+ throw error;
170
+ }
171
+ var rows = (_data$brevoTestContac = data === null || data === void 0 ? void 0 : data.brevoTestContacts.nodes) !== null && _data$brevoTestContac !== void 0 ? _data$brevoTestContac : [];
172
+ var totalCount = (data === null || data === void 0 ? void 0 : data.brevoTestContacts.totalCount) || 0;
173
+ return /*#__PURE__*/_jsxs(MainContent, {
174
+ fullHeight: true,
175
+ children: [/*#__PURE__*/_jsx(Box, {
176
+ sx: {
177
+ marginBottom: 4
178
+ },
179
+ children: /*#__PURE__*/_jsx(Alert, {
180
+ severity: "warning",
181
+ children: /*#__PURE__*/_jsx(FormattedMessage, {
182
+ id: "cometBrevoModule.brevoTestContact.testContactAlert",
183
+ defaultMessage: "Contacts in this list are only added for testing purposes. Users do not get a double-opt in to confirm their subscription."
184
+ })
185
+ })
186
+ }), /*#__PURE__*/_jsx(DataGrid, _objectSpread(_objectSpread({}, dataGridProps), {}, {
187
+ disableRowSelectionOnClick: true,
188
+ rows: rows,
189
+ rowCount: rowCount,
190
+ columns: columns,
191
+ loading: loading,
192
+ slots: {
193
+ toolbar: BrevoTestContactsGridToolbar
194
+ },
195
+ slotProps: {
196
+ toolbar: {
197
+ intl: intl,
198
+ scope: scope,
199
+ totalCount: totalCount
200
+ }
201
+ },
202
+ showToolbar: true
203
+ }))]
204
+ });
205
+ }