emailengine-app 2.75.0 → 2.77.0

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 (113) hide show
  1. package/.github/workflows/release.yaml +24 -19
  2. package/.github/workflows/test.yml +0 -10
  3. package/.ncurc.js +14 -2
  4. package/.release-please-manifest.json +3 -0
  5. package/CHANGELOG.md +38 -0
  6. package/README.md +1 -1
  7. package/config/e2e.toml +1 -1
  8. package/data/google-crawlers.json +1 -1
  9. package/encrypt.js +71 -4
  10. package/lib/address-strategies.js +18 -0
  11. package/lib/api-reference/code-samples.js +194 -0
  12. package/lib/api-reference/format.js +179 -0
  13. package/lib/api-reference/index.js +205 -0
  14. package/lib/api-reference/model.js +336 -0
  15. package/lib/api-reference/schema-tree.js +366 -0
  16. package/lib/api-routes/account-routes.js +117 -37
  17. package/lib/api-routes/behavior-notes.js +54 -0
  18. package/lib/api-routes/blocklist-routes.js +9 -9
  19. package/lib/api-routes/changes-routes.js +6 -4
  20. package/lib/api-routes/chat-routes.js +3 -3
  21. package/lib/api-routes/delivery-test-routes.js +24 -6
  22. package/lib/api-routes/export-routes.js +14 -12
  23. package/lib/api-routes/gateway-routes.js +11 -11
  24. package/lib/api-routes/license-routes.js +7 -7
  25. package/lib/api-routes/mailbox-routes.js +18 -9
  26. package/lib/api-routes/message-routes.js +55 -35
  27. package/lib/api-routes/oauth2-app-routes.js +22 -16
  28. package/lib/api-routes/outbox-routes.js +7 -7
  29. package/lib/api-routes/pubsub-routes.js +3 -3
  30. package/lib/api-routes/route-helpers.js +3 -0
  31. package/lib/api-routes/settings-routes.js +10 -9
  32. package/lib/api-routes/stats-routes.js +3 -3
  33. package/lib/api-routes/submit-routes.js +213 -56
  34. package/lib/api-routes/template-routes.js +13 -13
  35. package/lib/api-routes/token-routes.js +15 -10
  36. package/lib/api-routes/webhook-route-routes.js +5 -5
  37. package/lib/consts.js +7 -0
  38. package/lib/email-client/base-client.js +230 -31
  39. package/lib/email-client/gmail/send-request.js +16 -1
  40. package/lib/email-client/gmail-client.js +89 -5
  41. package/lib/email-client/imap-client.js +103 -1
  42. package/lib/email-client/message-builder.js +24 -7
  43. package/lib/email-client/outlook/send-request.js +18 -1
  44. package/lib/email-client/outlook-client.js +79 -4
  45. package/lib/enum-descriptions.js +130 -0
  46. package/lib/imapproxy/imap-server.js +30 -26
  47. package/lib/imapproxy/upstream-client.js +38 -0
  48. package/lib/oauth2-apps.js +9 -3
  49. package/lib/openapi/build-document.js +318 -0
  50. package/lib/openapi/index.js +95 -0
  51. package/lib/openapi/joi-schema.js +523 -0
  52. package/lib/routes-ui.js +5 -1
  53. package/lib/schemas.js +76 -17
  54. package/lib/swagger-options.js +173 -0
  55. package/lib/tokens.js +69 -5
  56. package/lib/ui-routes/admin-entities-routes.js +3 -0
  57. package/lib/ui-routes/dashboard-routes.js +2 -26
  58. package/lib/ui-routes/reference-routes.js +195 -0
  59. package/lib/ui-routes/route-helpers.js +11 -0
  60. package/package.json +19 -26
  61. package/playwright.config.js +1 -1
  62. package/prepare-bundle-deps.sh +28 -0
  63. package/release-please-config.json +11 -0
  64. package/sbom.json +0 -1
  65. package/server.js +22 -2
  66. package/static/css/flyonui.css +1 -1
  67. package/static/css/src/app.tailwind.css +90 -0
  68. package/static/js/ee-client.js +238 -8
  69. package/static/js/reference.js +736 -0
  70. package/static/js/ui.js +61 -33
  71. package/static/licenses.html +16 -16
  72. package/translations/messages.pot +13 -13
  73. package/views/config/ai.hbs +1 -1
  74. package/views/config/document-store/chat.hbs +5 -5
  75. package/views/config/document-store/index.hbs +2 -2
  76. package/views/config/document-store/pre-processing/index.hbs +1 -1
  77. package/views/config/email-processing.hbs +1 -1
  78. package/views/config/imap-proxy.hbs +1 -1
  79. package/views/config/license.hbs +1 -1
  80. package/views/config/oauth/index.hbs +3 -3
  81. package/views/config/security.hbs +1 -1
  82. package/views/config/smtp.hbs +2 -2
  83. package/views/dashboard.hbs +1 -1
  84. package/views/layout/app.hbs +18 -7
  85. package/views/partials/oauth_form.hbs +4 -4
  86. package/views/partials/reference/anchor-link.hbs +20 -0
  87. package/views/partials/reference/disclosure.hbs +37 -0
  88. package/views/partials/reference/nav.hbs +93 -0
  89. package/views/partials/reference/operation.hbs +127 -0
  90. package/views/partials/reference/params.hbs +20 -0
  91. package/views/partials/reference/schema-node.hbs +99 -0
  92. package/views/partials/reference/schema.hbs +19 -0
  93. package/views/partials/reference/section-heading.hbs +16 -0
  94. package/views/partials/reference/token-alert.hbs +24 -0
  95. package/views/partials/reference/try-field.hbs +31 -0
  96. package/views/partials/reference/try-it.hbs +78 -0
  97. package/views/partials/side_menu.hbs +1 -1
  98. package/views/partials/ui/badge.hbs +4 -2
  99. package/views/partials/ui/page-header.hbs +1 -1
  100. package/views/partials/ui/search-input.hbs +31 -0
  101. package/views/partials/ui/setting-ref.hbs +1 -1
  102. package/views/partials/ui/stat-card.hbs +4 -2
  103. package/views/partials/ui/tab.hbs +6 -1
  104. package/views/partials/ui/tabs.hbs +2 -2
  105. package/views/reference/index.hbs +76 -0
  106. package/views/reference/redirect.hbs +49 -0
  107. package/views/reference/tag.hbs +28 -0
  108. package/views/reference/token.hbs +49 -0
  109. package/views/tokens/index.hbs +9 -1
  110. package/views/webhooks/index.hbs +3 -3
  111. package/workers/api.js +37 -215
  112. package/Gruntfile.js +0 -58
  113. package/views/swagger/index.hbs +0 -82
package/server.js CHANGED
@@ -250,6 +250,12 @@ const REQUIRE_API_AUTH = hasEnvValue('EENGINE_REQUIRE_API_AUTH') ? getBoolean(re
250
250
  // Opt-out for the license-validation feature beacon (telemetry rides on the existing license call)
251
251
  const BEACON_DISABLED = hasEnvValue('EENGINE_BEACON_DISABLED') ? getBoolean(readEnvValue('EENGINE_BEACON_DISABLED')) : false;
252
252
 
253
+ // Opt-out for the GitHub releases update check, the only background network
254
+ // call that is not tied to a subscription license. With this and a perpetual
255
+ // license an instance makes no background calls at all (strict-egress and
256
+ // air-gapped deployments).
257
+ const UPDATE_CHECK_DISABLED = hasEnvValue('EENGINE_UPDATE_CHECK_DISABLED') ? getBoolean(readEnvValue('EENGINE_UPDATE_CHECK_DISABLED')) : false;
258
+
253
259
  // OAuth2 token access configuration
254
260
  const ENABLE_OAUTH_TOKENS_API = hasEnvValue('EENGINE_ENABLE_OAUTH_TOKENS_API') ? getBoolean(readEnvValue('EENGINE_ENABLE_OAUTH_TOKENS_API')) : null;
255
261
 
@@ -2000,6 +2006,12 @@ function checkActiveLicense() {
2000
2006
  */
2001
2007
  let processCheckUpgrade = async () => {
2002
2008
  try {
2009
+ if (UPDATE_CHECK_DISABLED) {
2010
+ // Clear any marker stored before the check was disabled, otherwise
2011
+ // the dashboard banner would advertise a stale version forever
2012
+ await redis.hdel(`${REDIS_PREFIX}settings`, 'upgrade');
2013
+ return;
2014
+ }
2003
2015
  let updateInfo = await checkForUpgrade();
2004
2016
  if (updateInfo.canUpgrade) {
2005
2017
  logger.info({ msg: 'EmailEngine update available', updateInfo });
@@ -2765,8 +2777,16 @@ async function onCommand(worker, message) {
2765
2777
  return;
2766
2778
 
2767
2779
  case 'new':
2768
- // Handle new account
2769
- unassigned.add(message.account);
2780
+ // Handle new account.
2781
+ //
2782
+ // `unassigned` is `false` until assignAccounts() loads the account list from Redis on
2783
+ // its first run, which waits for an IMAP worker to report ready. An account created
2784
+ // before that used to throw here and fail the request with a 500. Skipping the add is
2785
+ // safe rather than merely quiet: the account is already in `ia:accounts` by the time
2786
+ // this message is sent, so the first load picks it up.
2787
+ if (unassigned) {
2788
+ unassigned.add(message.account);
2789
+ }
2770
2790
  assignAccounts()
2771
2791
  .then(() => sendWebhook(message.account, ACCOUNT_ADDED_NOTIFY, { account: message.account }))
2772
2792
  .catch(err => logger.error({ msg: 'Account assignment failed', n: 3, err }));