emailengine-app 2.78.0 → 2.79.1

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 (155) hide show
  1. package/.ncurc.js +23 -13
  2. package/.release-please-manifest.json +1 -1
  3. package/CHANGELOG.md +68 -0
  4. package/config/e2e.toml +2 -1
  5. package/config/test.toml +2 -1
  6. package/data/google-crawlers.json +1 -1
  7. package/lib/account.js +112 -36
  8. package/lib/api-reference/format.js +91 -4
  9. package/lib/api-reference/model.js +144 -19
  10. package/lib/api-reference/schema-tree.js +282 -28
  11. package/lib/api-routes/account-routes.js +80 -34
  12. package/lib/api-routes/blocklist-routes.js +21 -47
  13. package/lib/api-routes/chat-routes.js +10 -12
  14. package/lib/api-routes/delivery-test-routes.js +6 -26
  15. package/lib/api-routes/export-routes.js +2 -0
  16. package/lib/api-routes/gateway-routes.js +52 -11
  17. package/lib/api-routes/license-routes.js +2 -0
  18. package/lib/api-routes/mailbox-routes.js +29 -26
  19. package/lib/api-routes/message-routes.js +27 -21
  20. package/lib/api-routes/oauth2-app-routes.js +11 -29
  21. package/lib/api-routes/operation-impact.js +80 -0
  22. package/lib/api-routes/outbox-routes.js +15 -5
  23. package/lib/api-routes/permission-map.js +401 -0
  24. package/lib/api-routes/route-helpers.js +294 -9
  25. package/lib/api-routes/route-metadata.js +28 -0
  26. package/lib/api-routes/settings-routes.js +66 -38
  27. package/lib/api-routes/stats-routes.js +2 -2
  28. package/lib/api-routes/submit-routes.js +53 -31
  29. package/lib/api-routes/template-routes.js +3 -0
  30. package/lib/api-routes/token-routes.js +526 -72
  31. package/lib/api-routes/webhook-route-routes.js +14 -4
  32. package/lib/arf-detect.js +17 -4
  33. package/lib/auth-token.js +80 -8
  34. package/lib/bounce-detect.js +28 -17
  35. package/lib/consts.js +16 -0
  36. package/lib/db.js +26 -2
  37. package/lib/delivery-error.js +30 -1
  38. package/lib/email-client/base-client.js +27 -41
  39. package/lib/email-client/gmail-client.js +23 -17
  40. package/lib/email-client/imap/mailbox.js +58 -59
  41. package/lib/email-client/imap/subconnection.js +10 -7
  42. package/lib/email-client/imap/sync-operations.js +46 -46
  43. package/lib/email-client/imap-client.js +85 -28
  44. package/lib/email-client/message-builder.js +3 -3
  45. package/lib/email-client/notification-handler.js +1 -1
  46. package/lib/email-client/outlook/graph-api.js +10 -4
  47. package/lib/email-client/outlook-client.js +56 -64
  48. package/lib/email-client/smtp-pool-manager.js +1 -1
  49. package/lib/enum-descriptions.js +92 -2
  50. package/lib/export.js +1 -1
  51. package/lib/field-usage.js +133 -0
  52. package/lib/gateway.js +1 -1
  53. package/lib/imapproxy/imap-core/lib/commands/authenticate-plain.js +3 -3
  54. package/lib/imapproxy/imap-core/lib/commands/id.js +2 -13
  55. package/lib/imapproxy/imap-core/lib/commands/starttls.js +1 -1
  56. package/lib/imapproxy/imap-core/lib/imap-command.js +21 -5
  57. package/lib/imapproxy/imap-core/lib/imap-connection.js +15 -5
  58. package/lib/imapproxy/imap-server.js +27 -7
  59. package/lib/license-beacon.js +4 -9
  60. package/lib/lists.js +49 -1
  61. package/lib/llm-pre-process.js +5 -5
  62. package/lib/logger.js +5 -1
  63. package/lib/lua/h-set-new-mark.lua +36 -0
  64. package/lib/message-port-stream.js +84 -1
  65. package/lib/metrics-collector.js +2 -2
  66. package/lib/oauth/gmail.js +9 -12
  67. package/lib/oauth/mail-ru.js +5 -7
  68. package/lib/oauth/outlook.js +9 -9
  69. package/lib/oauth/pubsub/google.js +25 -10
  70. package/lib/oauth/scope-checker.js +1 -1
  71. package/lib/oauth2-apps.js +290 -292
  72. package/lib/openapi/build-document.js +20 -8
  73. package/lib/openapi/joi-schema.js +20 -0
  74. package/lib/outbox.js +85 -17
  75. package/lib/pre-process.js +8 -8
  76. package/lib/queue-stats.js +49 -0
  77. package/lib/read-env-value.js +1 -1
  78. package/lib/reconnection-manager.js +2 -2
  79. package/lib/rewrite-text-nodes.js +4 -3
  80. package/lib/routes-ui.js +4 -0
  81. package/lib/schemas.js +218 -162
  82. package/lib/settings.js +98 -5
  83. package/lib/sub-script.js +2 -1
  84. package/lib/swagger-options.js +2 -1
  85. package/lib/templates.js +4 -4
  86. package/lib/threads.js +2 -2
  87. package/lib/token-audit-log.js +231 -0
  88. package/lib/token-permission-view.js +219 -0
  89. package/lib/token-permissions.js +172 -0
  90. package/lib/tokens.js +247 -66
  91. package/lib/tools.js +142 -37
  92. package/lib/ui-routes/account-routes.js +42 -15
  93. package/lib/ui-routes/admin-config-routes.js +18 -10
  94. package/lib/ui-routes/admin-entities-routes.js +117 -38
  95. package/lib/ui-routes/auth-routes.js +30 -24
  96. package/lib/ui-routes/export-routes.js +10 -4
  97. package/lib/ui-routes/oauth-config-routes.js +12 -12
  98. package/lib/ui-routes/reference-routes.js +3 -3
  99. package/lib/ui-routes/route-helpers.js +78 -2
  100. package/lib/ui-routes/settings-page.js +1 -1
  101. package/lib/ui-routes/smtp-test-routes.js +1 -1
  102. package/lib/ui-routes/suppression-list-routes.js +299 -0
  103. package/lib/ui-routes/unsubscribe-routes.js +19 -29
  104. package/lib/utils/decode-headers.js +42 -0
  105. package/lib/utils/header-map.js +48 -0
  106. package/lib/utils/network.js +2 -2
  107. package/lib/utils/unsafe-key.js +59 -0
  108. package/lib/web-safe-html.js +1 -1
  109. package/lib/webhook-routing.js +84 -0
  110. package/lib/webhooks.js +48 -14
  111. package/package.json +11 -10
  112. package/sbom.json +1 -1
  113. package/server.js +116 -55
  114. package/static/css/flyonui.css +1 -1
  115. package/static/css/src/app.tailwind.css +136 -9
  116. package/static/js/reference.js +456 -10
  117. package/static/js/ui.js +43 -0
  118. package/static/licenses.html +51 -41
  119. package/translations/messages.pot +59 -59
  120. package/views/accounts/account.hbs +75 -13
  121. package/views/accounts/browse.hbs +19 -36
  122. package/views/accounts/edit.hbs +2 -2
  123. package/views/config/logging.hbs +6 -0
  124. package/views/config/oauth/app.hbs +0 -2
  125. package/views/config/security.hbs +13 -0
  126. package/views/gateways/edit.hbs +1 -1
  127. package/views/gateways/gateway.hbs +2 -2
  128. package/views/gateways/index.hbs +7 -7
  129. package/views/partials/accounts_table.hbs +7 -7
  130. package/views/partials/oauth_form.hbs +0 -15
  131. package/views/partials/reference/disclosure.hbs +8 -2
  132. package/views/partials/reference/operation.hbs +47 -13
  133. package/views/partials/reference/params.hbs +17 -1
  134. package/views/partials/reference/schema-node.hbs +110 -52
  135. package/views/partials/reference/schema-tools.hbs +25 -0
  136. package/views/partials/reference/try-it.hbs +84 -11
  137. package/views/partials/side_menu.hbs +1 -0
  138. package/views/partials/ui/checkbox.hbs +2 -2
  139. package/views/partials/ui/tabs.hbs +7 -1
  140. package/views/reference/token.hbs +4 -0
  141. package/views/suppression-lists/index.hbs +85 -0
  142. package/views/suppression-lists/list.hbs +87 -0
  143. package/views/templates/index.hbs +10 -4
  144. package/views/templates/template.hbs +1 -1
  145. package/views/tokens/index.hbs +53 -6
  146. package/views/tokens/new.hbs +334 -5
  147. package/workers/api.js +185 -102
  148. package/workers/documents.js +46 -26
  149. package/workers/export.js +20 -8
  150. package/workers/imap-proxy.js +2 -2
  151. package/workers/imap.js +77 -78
  152. package/workers/smtp.js +13 -7
  153. package/workers/submit.js +40 -30
  154. package/workers/webhooks.js +80 -26
  155. package/lib/feature-flags.js +0 -48
@@ -18,12 +18,12 @@
18
18
  {{!-- Primary: the two most common reasons to open an account --}}
19
19
  {{#if canReadMail}}
20
20
  {{#> ui/tooltip text="Browse messages in this account"}}
21
- {{> ui/btn variant="primary" size="sm" href=(concat "/admin/accounts/" account.account "/browse") icon="icon-[tabler--folder-open]" label="Browse messages"}}
21
+ {{> ui/btn variant="primary" size="sm" href=(concat "/admin/accounts/" (urlpart account.account) "/browse") icon="icon-[tabler--folder-open]" label="Browse messages"}}
22
22
  {{/ui/tooltip}}
23
23
  {{/if}}
24
24
 
25
25
  {{#> ui/tooltip text="Edit account configuration"}}
26
- {{> ui/btn variant="primary" style="outline" size="sm" href=(concat "/admin/accounts/" account.account "/edit") icon="icon-[tabler--user-edit]" label="Edit"}}
26
+ {{> ui/btn variant="primary" style="outline" size="sm" href=(concat "/admin/accounts/" (urlpart account.account) "/edit") icon="icon-[tabler--user-edit]" label="Edit"}}
27
27
  {{/ui/tooltip}}
28
28
 
29
29
  <div class="bg-base-content/10 mx-1 hidden h-6 w-px self-center sm:block" aria-hidden="true"></div>
@@ -105,7 +105,7 @@
105
105
  </button>
106
106
  <ul class="dropdown-menu dropdown-open:opacity-100 hidden min-w-56" role="menu"
107
107
  aria-orientation="vertical" aria-labelledby="logs-info">
108
- <li><a class="dropdown-item" href="/admin/accounts/{{account.account}}/logs.txt" download>Download stored logs</a></li>
108
+ <li><a class="dropdown-item" href="/admin/accounts/{{urlpart account.account}}/logs.txt" download>Download stored logs</a></li>
109
109
  <li>
110
110
  <div class="divider my-1"></div>
111
111
  </li>
@@ -125,9 +125,9 @@
125
125
  {{!-- Related resources scoped to this account (these navigate elsewhere) --}}
126
126
  <div class="mb-4 text-base-content/60 text-sm">
127
127
  <span class="font-semibold">Related:</span>
128
- <a class="link link-animated" href="/admin/templates/?account={{account.account}}">Email templates</a>
128
+ <a class="link link-animated" href="/admin/templates/?account={{urlpart account.account}}">Email templates</a>
129
129
  <span class="text-base-content/30 mx-1">&middot;</span>
130
- <a class="link link-animated" href="/admin/tokens/?account={{account.account}}">Access tokens</a>
130
+ <a class="link link-animated" href="/admin/tokens/?account={{urlpart account.account}}">Access tokens</a>
131
131
  </div>
132
132
 
133
133
  <dl class="ee-dl">
@@ -685,26 +685,88 @@
685
685
  <dd><code class="text-base-content/60">{{account.proxy}}</code></dd>
686
686
  {{/if}}
687
687
 
688
- {{#if account.webhooks}}
689
- <dt>Webhook URL</dt>
690
- <dd><code class="text-base-content/60">{{account.webhooks}}</code></dd>
688
+ </dl>
689
+
690
+ </div>
691
+ </div>
692
+ {{/if}}
693
+
694
+ {{!-- Effective webhook routing for this account. Mirrors the precedence the notify worker
695
+ applies (custom route target, account override, global setting) so a misdirected webhook
696
+ can be debugged from one place. --}}
697
+ <div class="card bg-base-100 shadow-md mb-6">
698
+ <div class="card-header"><h6 class="card-title text-primary">Webhook routing</h6>
699
+ </div>
700
+ <div class="card-body">
701
+
702
+ {{#unless webhookRouting.enabled}}
703
+ {{#> ui/alert-banner variant="warning" title="Webhook delivery is disabled"}}
704
+ Webhooks are turned off globally, so no events are delivered for any account. Enable them under <a href="/admin/config/webhooks" class="link">Webhook settings</a>.
705
+ {{/ui/alert-banner}}
706
+ {{/unless}}
707
+
708
+ <dl class="ee-dl">
709
+
710
+ <dt>Default webhook target</dt>
711
+ <dd>
712
+ {{#if webhookRouting.defaultRoute.url}}
713
+ <code class="text-base-content/60">{{webhookRouting.defaultRoute.url}}</code>
714
+ {{#equals webhookRouting.defaultRoute.source "account"}}
715
+ {{> ui/badge label="account override" variant="info" soft=true}}
716
+ {{else}}
717
+ {{> ui/badge label="global setting" variant="neutral" soft=true}}
718
+ {{/equals}}
719
+ {{else}}
720
+ <span class="text-base-content/60">Not configured - events are only delivered to matching webhook routes</span>
721
+ {{/if}}
722
+ </dd>
723
+
724
+ {{#if webhookRouting.defaultRoute.url}}
725
+ <dt>Event types</dt>
726
+ <dd>
727
+ {{#if webhookRouting.defaultRoute.allEvents}}
728
+ All event types
729
+ {{else if webhookRouting.defaultRoute.events.length}}
730
+ {{#each webhookRouting.defaultRoute.events}}<code class="text-base-content/60">{{this}}</code>{{#unless @last}}, {{/unless}}{{/each}}
731
+ {{else}}
732
+ <span class="text-base-content/60">None selected - the default target receives no events</span>
733
+ {{/if}}
734
+ {{#if webhookRouting.defaultRoute.inboxNewOnly}}
735
+ <div><small>New-message notifications are limited to INBOX (<em>inboxNewOnly</em>).</small></div>
736
+ {{/if}}
737
+ </dd>
738
+ {{/if}}
739
+
740
+ {{#if webhookRouting.defaultRoute.customHeadersLabel}}
741
+ <dt>Custom headers</dt>
742
+ <dd>{{webhookRouting.defaultRoute.customHeadersLabel}}</dd>
691
743
  {{/if}}
692
744
 
745
+ <dt>Webhook routes</dt>
746
+ <dd>
747
+ {{#if webhookRouting.customRoutes.length}}
748
+ <ul class="list-none p-0 m-0">
749
+ {{#each webhookRouting.customRoutes}}
750
+ <li><a href="/admin/webhooks/webhook/{{this.id}}" class="link link-primary">{{this.name}}</a> <code class="text-base-content/60">{{this.targetUrl}}</code>{{#if this.missingFilter}} {{> ui/badge label="no filter - never delivers" variant="warning" soft=true}}{{/if}}</li>
751
+ {{/each}}
752
+ </ul>
753
+ <small class="text-base-content/60">Enabled webhook routes deliver independently of the default target; each route applies its own filter function instead of the event type list. A route without a filter function never delivers anything.</small>
754
+ {{else}}
755
+ <span class="text-base-content/60">None enabled</span>
756
+ {{/if}}
757
+ </dd>
758
+
693
759
  </dl>
694
760
 
695
- {{#if account.webhooks}}
696
761
  {{#if account.webhookErrorFlag.message}}
697
762
  <hr />
698
763
 
699
764
  <div><small><strong>Note:</strong> The last webhook attempt failed with the following response.</small></div>
700
765
  <div><code>{{account.webhookErrorFlag.message}}</code></div>
701
-
702
- {{/if}}
703
766
  {{/if}}
704
767
 
705
768
  </div>
706
769
  </div>
707
- {{/if}}
708
770
 
709
771
  {{#> ui/modal id="renewGrantModal" title="Re-authenticate account"}}
710
772
  <div class="modal-body">
@@ -730,7 +792,7 @@
730
792
  </div>
731
793
  {{/ui/modal}}
732
794
 
733
- {{#> ui/confirm-modal id="deleteModal" title="Delete Account" action=(concat "/admin/accounts/" account.account "/delete")
795
+ {{#> ui/confirm-modal id="deleteModal" title="Delete Account" action=(concat "/admin/accounts/" (urlpart account.account) "/delete")
734
796
  submitLabel="Delete account"}}
735
797
  <p>Are you sure you want to delete the account for {{account.name}}? This action cannot be undone.</p>
736
798
  {{/ui/confirm-modal}}
@@ -1,6 +1,6 @@
1
1
  {{> accounts_header}}
2
2
 
3
- {{> ui/breadcrumb parentHref="/admin/accounts" parentLabel="Accounts" midHref=(concat "/admin/accounts/" account) midLabel=account current="Browse" class="mt-6 mb-6"}}
3
+ {{> ui/breadcrumb parentHref="/admin/accounts" parentLabel="Accounts" midHref=(concat "/admin/accounts/" (urlpart account)) midLabel=account current="Browse" class="mt-6 mb-6"}}
4
4
 
5
5
  <div id="email-client"></div>
6
6
 
@@ -9,8 +9,11 @@
9
9
  <p id="confirm-text"></p>
10
10
  </div>
11
11
  <div class="modal-footer">
12
+ {{!-- Both buttons dismiss through data-overlay. The OK button used to close the overlay
13
+ from its own handler, which races with HSOverlay's deferred open and close and can
14
+ strand the dialog on screen - see window.uiConfirmModal in static/js/ui.js. --}}
12
15
  <button type="button" id="confirm-cancel" class="btn btn-soft btn-neutral" data-overlay="#confirmModal">Close</button>
13
- <button type="button" id="confirm-ok" class="btn btn-primary">OK</button>
16
+ <button type="button" id="confirm-ok" class="btn btn-primary" data-overlay="#confirmModal">OK</button>
14
17
  </div>
15
18
  {{/ui/modal}}
16
19
 
@@ -19,24 +22,13 @@
19
22
  <p id="alert-text"></p>
20
23
  </div>
21
24
  <div class="modal-footer">
22
- <button type="button" id="alert-ok" class="btn btn-primary">OK</button>
25
+ <button type="button" id="alert-ok" class="btn btn-primary" data-overlay="#alertModal">OK</button>
23
26
  </div>
24
27
  {{/ui/modal}}
25
28
 
26
29
  <script type="module">
27
30
  import { EmailEngineClient } from '/static/js/ee-client.js';
28
31
 
29
- // the OK/Close buttons are wired once; each confirm() call resets
30
- // confirmResult and resolves through a {once:true} close.overlay listener
31
- let confirmResult = false;
32
- document.getElementById('confirm-ok').addEventListener('click', () => {
33
- confirmResult = true;
34
- uiModal.close('#confirmModal');
35
- });
36
- document.getElementById('alert-ok').addEventListener('click', () => {
37
- uiModal.close('#alertModal');
38
- });
39
-
40
32
  // Create client with UI container. The embed follows the admin theme -
41
33
  // its own dark mode toggle stays hidden and the mode tracks the topbar
42
34
  // theme switch (data-theme on the root element) and the system scheme.
@@ -47,34 +39,25 @@
47
39
  container: document.getElementById('email-client'),
48
40
  darkMode: uiEffectiveTheme() === 'dark',
49
41
  showDarkModeToggle: false,
42
+ // Text is this page's to fill; the answer comes from the shared dialog helper
50
43
  confirmMethod: (message, title = 'Confirm', cancelText = 'Cancel', okText = 'OK') => {
51
- return new Promise((resolve) => {
52
- confirmResult = false;
53
- document.getElementById('confirm-text').textContent = message;
54
- document.getElementById('confirmModalLabel').textContent = title;
55
- document.getElementById('confirm-cancel').textContent = cancelText;
56
- document.getElementById('confirm-ok').textContent = okText;
44
+ document.getElementById('confirm-text').textContent = message;
45
+ document.getElementById('confirmModalLabel').textContent = title;
46
+ document.getElementById('confirm-cancel').textContent = cancelText;
47
+ document.getElementById('confirm-ok').textContent = okText;
57
48
 
58
- document.getElementById('confirmModal').addEventListener('close.overlay', () => {
59
- resolve(confirmResult);
60
- }, { once: true });
61
-
62
- uiModal.open('#confirmModal');
63
- });
49
+ return uiConfirmModal('#confirmModal', '#confirm-ok');
64
50
  },
65
51
 
52
+ // An alert has nothing to answer, so callers just await it being dismissed. The
53
+ // resolved value is deliberately passed through rather than forced to true: forcing
54
+ // it would report a dialog that never opened as one the reader acknowledged.
66
55
  alertMethod: (message, title = 'Notice', cancelText = null, okText = 'OK') => {
67
- return new Promise((resolve) => {
68
- document.getElementById('alert-text').textContent = message;
69
- document.getElementById('alertModalLabel').textContent = title;
70
- document.getElementById('alert-ok').textContent = okText;
71
-
72
- document.getElementById('alertModal').addEventListener('close.overlay', () => {
73
- resolve(true);
74
- }, { once: true });
56
+ document.getElementById('alert-text').textContent = message;
57
+ document.getElementById('alertModalLabel').textContent = title;
58
+ document.getElementById('alert-ok').textContent = okText;
75
59
 
76
- uiModal.open('#alertModal');
77
- });
60
+ return uiConfirmModal('#alertModal', '#alert-ok');
78
61
  }
79
62
  });
80
63
 
@@ -1,8 +1,8 @@
1
1
  {{> accounts_header}}
2
2
 
3
- {{> ui/breadcrumb parentHref="/admin/accounts" parentLabel="Accounts" midHref=(concat "/admin/accounts/" account) midLabel=account current="Edit" class="mt-6 mb-6"}}
3
+ {{> ui/breadcrumb parentHref="/admin/accounts" parentLabel="Accounts" midHref=(concat "/admin/accounts/" (urlpart account)) midLabel=account current="Edit" class="mt-6 mb-6"}}
4
4
 
5
- <form method="post" action="/admin/accounts/{{account}}/edit">
5
+ <form method="post" action="/admin/accounts/{{urlpart account}}/edit">
6
6
  <input type="hidden" name="crumb" value="{{crumb}}">
7
7
 
8
8
  <div class="card bg-base-100 shadow-md mb-6">
@@ -41,6 +41,12 @@
41
41
  removed.</div>
42
42
  {{/if}}
43
43
 
44
+ {{#if sentryTrialManaged}}
45
+ <div class="alert alert-soft alert-info">Error reporting was enabled automatically when the trial license
46
+ was activated, so that problems with evaluation instances reach the EmailEngine developers. It turns
47
+ itself off when a full license is activated. Saving this page stores your own choice instead.</div>
48
+ {{/if}}
49
+
44
50
  <div>
45
51
  {{> ui/setting-ref name="sentryEnabled"}}
46
52
  {{> ui/checkbox id="settingsSentryEnabled" name="sentryEnabled"
@@ -92,10 +92,8 @@
92
92
  {{app.cloudData.description}}</em></dd>
93
93
  {{/if}}
94
94
 
95
- {{#unless app.legacy}}
96
95
  <dt>Accounts</dt>
97
96
  <dd class="font-mono"><small>{{app.accounts}}</small></dd>
98
- {{/unless}}
99
97
 
100
98
  {{#if app.clientId}}
101
99
  <dt>Client ID</dt>
@@ -42,6 +42,19 @@
42
42
  by default.</span>
43
43
  </div>
44
44
 
45
+ <div>
46
+ {{> ui/setting-ref name="tokenAuditLog"}}
47
+
48
+ {{#> ui/checkbox id="tokenAuditLog" name="tokenAuditLog" label="Access Token Audit Log"
49
+ checked=values.tokenAuditLog error=errors.tokenAuditLog}}
50
+ {{> ui/badge label=(when values.tokenAuditLog "enabled" "disabled") variant=(when values.tokenAuditLog "success" "neutral")}}
51
+ {{/ui/checkbox}}
52
+ <span class="helper-text">Record which requests each access token makes, readable at <a
53
+ href="/admin/reference/access-tokens#getV1TokensTokenLog" target="_blank"
54
+ rel="noopener noreferrer" class="link link-animated">the token log endpoint</a>. Adds a write to
55
+ every authenticated request, and entries only exist from the point this is switched on.</span>
56
+ </div>
57
+
45
58
  {{/ui/card}}
46
59
 
47
60
  {{#> ui/card title="Secrets and Encryption" id="secrets" bodyClass="space-y-4"}}
@@ -1,6 +1,6 @@
1
1
  {{> gateways_header}}
2
2
 
3
- {{> ui/breadcrumb parentHref="/admin/gateways" parentLabel="Gateways" midHref=(concat "/admin/gateways/gateway/" gatewayData.gateway) midLabel=gatewayData.gateway current="Edit" class="mt-6 mb-6"}}
3
+ {{> ui/breadcrumb parentHref="/admin/gateways" parentLabel="Gateways" midHref=(concat "/admin/gateways/gateway/" (urlpart gatewayData.gateway)) midLabel=gatewayData.gateway current="Edit" class="mt-6 mb-6"}}
4
4
 
5
5
  <form method="post" action="/admin/gateways/edit">
6
6
  <input type="hidden" name="crumb" value="{{crumb}}">
@@ -15,7 +15,7 @@
15
15
 
16
16
  {{#> ui/detail-toolbar label="Gateway actions"}}
17
17
  {{#> ui/tooltip text="Modify gateway settings"}}
18
- {{> ui/btn variant="primary" style="outline" size="sm" href=(concat "/admin/gateways/edit/" gateway.gateway) icon="icon-[tabler--edit]" label="Edit gateway"}}
18
+ {{> ui/btn variant="primary" style="outline" size="sm" href=(concat "/admin/gateways/edit/" (urlpart gateway.gateway)) icon="icon-[tabler--edit]" label="Edit gateway"}}
19
19
  {{/ui/tooltip}}
20
20
 
21
21
  {{> ui/overflow-menu label="More gateway actions" deleteLabel="Delete gateway"}}
@@ -67,7 +67,7 @@
67
67
 
68
68
  {{/ui/card}}
69
69
 
70
- {{#> ui/confirm-modal id="deleteModal" title="Delete Gateway" action=(concat "/admin/gateways/delete/" gateway.gateway)
70
+ {{#> ui/confirm-modal id="deleteModal" title="Delete Gateway" action=(concat "/admin/gateways/delete/" (urlpart gateway.gateway))
71
71
  submitLabel="Delete Gateway"}}
72
72
  <p>Delete gateway "{{gateway.name}}"? This action cannot be undone.</p>
73
73
  {{/ui/confirm-modal}}
@@ -24,16 +24,16 @@
24
24
  {{#each gateways}}
25
25
  <tr class="hover:bg-base-200/60">
26
26
  <td class="relative">
27
- {{> ui/row-link href=(concat "/admin/gateways/gateway/" gateway) label="Open gateway"}}
27
+ {{> ui/row-link href=(concat "/admin/gateways/gateway/" (urlpart gateway)) label="Open gateway"}}
28
28
  <div><strong>{{name}}</strong></div>
29
29
  {{> ui/entity-id id=gateway label="Gateway ID"}}
30
30
  </td>
31
31
  <td class="relative">
32
- {{> ui/row-link href=(concat "/admin/gateways/gateway/" gateway)}}{{deliveries}}
32
+ {{> ui/row-link href=(concat "/admin/gateways/gateway/" (urlpart gateway))}}{{deliveries}}
33
33
  </td>
34
34
 
35
35
  <td class="relative">
36
- {{> ui/row-link href=(concat "/admin/gateways/gateway/" gateway)}}
36
+ {{> ui/row-link href=(concat "/admin/gateways/gateway/" (urlpart gateway))}}
37
37
  {{#if timeStr}}
38
38
  <span class="relative-time" data-time="{{timeStr}}"></span>
39
39
  {{else}}
@@ -42,17 +42,17 @@
42
42
  </td>
43
43
 
44
44
  <td class="relative w-32">
45
- {{> ui/row-link href=(concat "/admin/gateways/gateway/" gateway)}}
45
+ {{> ui/row-link href=(concat "/admin/gateways/gateway/" (urlpart gateway))}}
46
46
  {{!-- live state badge with an error tooltip; wrapping link
47
47
  lifts the badge above the row overlay --}}
48
- <a href="/admin/gateways/gateway/{{gateway}}" class="relative z-[1] inline-flex">
48
+ <a href="/admin/gateways/gateway/{{urlpart gateway}}" class="relative z-[1] inline-flex">
49
49
  {{> ui/state-badge label=label account=gateway pointer=true}}
50
50
  </a>
51
51
  </td>
52
52
 
53
53
  <td class="relative text-end">
54
- {{> ui/row-actions openHref=(concat "/admin/gateways/gateway/" gateway) label="Gateway actions"
55
- deleteModal="#deleteGateway" deleteName=name deleteAction=(concat "/admin/gateways/delete/" gateway)}}
54
+ {{> ui/row-actions openHref=(concat "/admin/gateways/gateway/" (urlpart gateway)) label="Gateway actions"
55
+ deleteModal="#deleteGateway" deleteName=name deleteAction=(concat "/admin/gateways/delete/" (urlpart gateway))}}
56
56
  </td>
57
57
 
58
58
  </tr>
@@ -29,16 +29,16 @@
29
29
  {{#each accounts}}
30
30
  <tr class="hover:bg-base-200/60">
31
31
  <td class="relative">
32
- {{> ui/row-link href=(concat "/admin/accounts/" account) label="Open account"}}
32
+ {{> ui/row-link href=(concat "/admin/accounts/" (urlpart account)) label="Open account"}}
33
33
  <div><strong>{{name}}</strong></div>
34
34
  {{> ui/entity-id id=account label="Account ID"}}
35
35
  </td>
36
36
  <td class="relative">
37
- {{> ui/row-link href=(concat "/admin/accounts/" account)}}{{email}}
37
+ {{> ui/row-link href=(concat "/admin/accounts/" (urlpart account))}}{{email}}
38
38
  </td>
39
39
 
40
40
  <td class="relative">
41
- {{> ui/row-link href=(concat "/admin/accounts/" account)}}
41
+ {{> ui/row-link href=(concat "/admin/accounts/" (urlpart account))}}
42
42
  {{#if type.icon}}
43
43
  {{!-- relative z-[1] lifts the tooltip trigger above the row link --}}
44
44
  {{#> ui/tooltip text=type.label class="relative z-[1]"}}
@@ -53,13 +53,13 @@
53
53
  </td>
54
54
 
55
55
  <td class="relative w-32">
56
- {{> ui/row-link href=(concat "/admin/accounts/" account)}}
56
+ {{> ui/row-link href=(concat "/admin/accounts/" (urlpart account))}}
57
57
  {{!-- live state badge: app.js updates the badge-{type} class,
58
58
  text and error tooltip through the /admin/changes SSE
59
59
  feed. The wrapping link lifts the badge above the row
60
60
  overlay so the tooltip fires while clicks still
61
61
  navigate. --}}
62
- <a href="/admin/accounts/{{account}}" class="relative z-[1] inline-flex">
62
+ <a href="/admin/accounts/{{urlpart account}}" class="relative z-[1] inline-flex">
63
63
  {{> ui/state-badge label=stateLabel account=account pointer=true}}
64
64
  </a>
65
65
  </td>
@@ -68,8 +68,8 @@
68
68
  row, not the partial params, so the cell silently vanished (phantom column) --}}
69
69
  {{#if ../showActions}}
70
70
  <td class="relative text-end">
71
- {{> ui/row-actions openHref=(concat "/admin/accounts/" account) label="Account actions"
72
- deleteModal="#deleteAccount" deleteName=(when name name email) deleteAction=(concat "/admin/accounts/" account "/delete")}}
71
+ {{> ui/row-actions openHref=(concat "/admin/accounts/" (urlpart account)) label="Account actions"
72
+ deleteModal="#deleteAccount" deleteName=(when name name email) deleteAction=(concat "/admin/accounts/" (urlpart account) "/delete")}}
73
73
  </td>
74
74
  {{/if}}
75
75
  </tr>
@@ -53,26 +53,16 @@ Read about setting up {{providerData.comment}} from <a href="{{providerData.tuto
53
53
 
54
54
  <div>
55
55
  {{#> ui/form-field id="name" label="Application name" error=errors.name}}
56
- {{#if appData.legacy}}
57
- <input type="text" class="input{{#if errors.name}} is-invalid{{/if}}" id="name" value="{{appData.name}}"
58
- placeholder="Enter application name, eg. &quot;My App&quot;&mldr;" disabled />
59
- {{else}}
60
56
  <input type="text" class="input{{#if errors.name}} is-invalid{{/if}}" id="name" name="name"
61
57
  value="{{values.name}}" placeholder="Enter application name, eg. &quot;My App&quot;&mldr;" required />
62
- {{/if}}
63
58
  <span class="helper-text">Application name used when listing apps.</span>
64
59
  {{/ui/form-field}}
65
60
  </div>
66
61
 
67
62
  <div>
68
63
  {{#> ui/form-field id="description" label="Description" error=errors.description}}
69
- {{#if appData.legacy}}
70
- <input type="text" class="input{{#if errors.description}} is-invalid{{/if}}" id="description"
71
- value="{{appData.description}}" placeholder="" disabled />
72
- {{else}}
73
64
  <input type="text" class="input{{#if errors.description}} is-invalid{{/if}}" id="description"
74
65
  name="description" value="{{values.description}}" placeholder="" />
75
- {{/if}}
76
66
  <span class="helper-text">Optional application description or a comment.</span>
77
67
  {{/ui/form-field}}
78
68
  </div>
@@ -80,13 +70,8 @@ Read about setting up {{providerData.comment}} from <a href="{{providerData.tuto
80
70
  {{#unless activeGmailService}}{{#unless activeOutlookService}}
81
71
  <div>
82
72
  {{#> ui/form-field id="title" label="Display title" error=errors.title}}
83
- {{#if appData.legacy}}
84
- <input type="text" class="input{{#if errors.title}} is-invalid{{/if}}" id="title" value="{{appData.title}}"
85
- placeholder="" disabled />
86
- {{else}}
87
73
  <input type="text" class="input{{#if errors.title}} is-invalid{{/if}}" id="title" name="title"
88
74
  value="{{values.title}}" placeholder="" />
89
- {{/if}}
90
75
  <span class="helper-text">Optional display title next to the application button on the account type
91
76
  selection page.</span>
92
77
  {{/ui/form-field}}
@@ -6,6 +6,9 @@
6
6
 
7
7
  Params:
8
8
  label - summary text (required)
9
+ preview - muted continuation of the summary, e.g. the first child names of a
10
+ collapsed property group (optional). "6 properties" on its own gives a
11
+ reader nothing to decide on, and one tag page renders 135 closed groups
9
12
  elId - element id on the <details> (optional). Deliberately NOT named `id`:
10
13
  Handlebars merges a partial's hash params into the caller's context,
11
14
  so a partial that reads `id` also picks up an `id` that merely
@@ -30,8 +33,11 @@
30
33
  <summary
31
34
  class="flex cursor-pointer list-none items-center gap-1 [&::-webkit-details-marker]:hidden {{#if primary}}text-primary hover:text-primary/80 text-sm font-semibold{{else}}text-base-content/60 hover:text-base-content text-xs{{/if}}">
32
35
  <span class="ee-ref-chevron icon-[tabler--chevron-right] shrink-0 {{#if primary}}size-4{{else}}size-3.5{{/if}}"></span>
33
- {{label}}
36
+ {{!-- truncate, not just nowrap: the preview is a hint about what is inside the group,
37
+ so it gives up its tail rather than pushing the summary past the viewport --}}
38
+ <span class="min-w-0 truncate">{{label}}{{#if preview}}<span
39
+ class="text-base-content/45 ms-1.5 font-normal">{{preview}}</span>{{/if}}</span>
34
40
  </summary>
35
41
  {{!-- own hash params are neutralized so they cannot fall through into nested ui/* calls inside the block --}}
36
- {{> @partial-block label="" elId="" open="" primary="" class=""}}
42
+ {{> @partial-block label="" preview="" elId="" open="" primary="" class=""}}
37
43
  </details>
@@ -45,24 +45,55 @@
45
45
  </div>
46
46
  {{/if}}
47
47
 
48
- {{> reference/params title="Path parameters" params=pathParams}}
49
- {{> reference/params title="Query parameters" params=queryParams}}
50
- {{> reference/params title="Headers" params=headerParams}}
48
+ {{> reference/params title="Path parameters" params=pathParams flags=""}}
49
+ {{> reference/params title="Query parameters" params=queryParams flags=queryFlags}}
50
+ {{> reference/params title="Headers" params=headerParams flags=""}}
51
51
 
52
+ {{!-- Example first, and open. It used to sit collapsed below the property tree, so on
53
+ a 128-property response the one artifact that answers "what does this look like"
54
+ was 6,700 pixels down and behind a click. The shape is what orients a reader
55
+ before any individual field matters. --}}
52
56
  {{#if body}}
53
57
  <div class="mt-5">
54
58
  {{> reference/section-heading label="Request body" suffix=body.contentType class="mb-2"}}
55
59
  {{#if body.descriptionHtml}}
56
60
  <div class="text-base-content/70 mb-2 text-sm"><p>{{{body.descriptionHtml}}}</p></div>
57
61
  {{/if}}
58
- {{#if body.tree}}
59
- {{> reference/schema body.tree}}
60
- {{/if}}
62
+ {{!-- Two views where they differ, one where they do not. The typical payload is
63
+ the curated one and stays the default; the complete one fills in every key
64
+ the curated example leaves out, which on submit is 61 of 71 fields. Only 8
65
+ of the document's 34 bodies differ, and completeJson is non-empty only when
66
+ exampleJson is - both come from the same schema - so the tab strip is
67
+ conditional inside one disclosure rather than the disclosure being written
68
+ out twice. See buildBody() in lib/api-reference/model.js. --}}
61
69
  {{#if body.exampleJson}}
62
- {{#> reference/disclosure label="Example request body" class="mt-3"}}
63
- <pre class="ee-code-block mt-2"><code class="language-json">{{body.exampleJson}}</code></pre>
70
+ {{#> reference/disclosure label="Example request body" open=true class="mb-3"}}
71
+ <div>
72
+ {{#if body.completeJson}}
73
+ {{#> ui/tabs label="Request body examples" class="mt-2 mb-2"}}
74
+ {{> ui/tab target=body.exampleTabId label="Typical" active=true}}
75
+ {{> ui/tab target=body.completeTabId label="Every field" active=""}}
76
+ {{/ui/tabs}}
77
+ <div id="{{body.exampleTabId}}" role="tabpanel" aria-labelledby="{{body.exampleTabId}}-tab">
78
+ <pre class="ee-code-block ee-ref-example"><code class="language-json">{{body.exampleJson}}</code></pre>
79
+ </div>
80
+ <div id="{{body.completeTabId}}" role="tabpanel" aria-labelledby="{{body.completeTabId}}-tab" class="hidden">
81
+ <p class="text-base-content/50 mb-2 text-xs">Every documented field, with a sample value. Send only
82
+ the ones you need.</p>
83
+ <pre class="ee-code-block ee-ref-example"><code class="language-json">{{body.completeJson}}</code></pre>
84
+ </div>
85
+ {{else}}
86
+ <pre class="ee-code-block ee-ref-example mt-2"><code class="language-json">{{body.exampleJson}}</code></pre>
87
+ {{/if}}
88
+ </div>
64
89
  {{/reference/disclosure}}
65
90
  {{/if}}
91
+ {{#if body.tree.showTools}}
92
+ {{> reference/schema-tools scope=body.scopeId label="Filter request body fields"}}
93
+ {{/if}}
94
+ {{#if body.tree}}
95
+ <div id="{{body.scopeId}}" class="mt-2">{{> reference/schema body.tree}}</div>
96
+ {{/if}}
66
97
  </div>
67
98
  {{/if}}
68
99
 
@@ -83,14 +114,17 @@
83
114
  {{#if descriptionHtml}}
84
115
  <div class="text-base-content/70 mt-1 text-sm"><p>{{{descriptionHtml}}}</p></div>
85
116
  {{/if}}
86
- {{#if tree}}
87
- <div class="mt-2">{{> reference/schema tree}}</div>
88
- {{/if}}
89
117
  {{#if exampleJson}}
90
- {{#> reference/disclosure label="Example response" class="mt-3"}}
91
- <pre class="ee-code-block mt-2"><code class="language-json">{{exampleJson}}</code></pre>
118
+ {{#> reference/disclosure label="Example response" open=true class="mt-3 mb-3"}}
119
+ <pre class="ee-code-block ee-ref-example mt-2"><code class="language-json">{{exampleJson}}</code></pre>
92
120
  {{/reference/disclosure}}
93
121
  {{/if}}
122
+ {{#if tree.showTools}}
123
+ {{> reference/schema-tools scope=scopeId label="Filter response fields"}}
124
+ {{/if}}
125
+ {{#if tree}}
126
+ <div id="{{scopeId}}" class="mt-2">{{> reference/schema tree}}</div>
127
+ {{/if}}
94
128
  </div>
95
129
  {{/each}}
96
130
  </div>
@@ -3,18 +3,34 @@
3
3
  Renders nothing when the group is empty, so callers can include all three
4
4
  unconditionally.
5
5
  Params:
6
- title - group heading, e.g. "Path parameters" (required)
6
+ title - group heading, e.g. "Query parameters" (required)
7
7
  params - array of parameter view models from lib/api-reference/model.js (required)
8
+ flags - parameter names, when the model recognised the group as a flag list rather
9
+ than N documented parameters (optional; see flagNames() in model.js)
8
10
 
9
11
  Rows are reference/schema-node: buildParameter() emits the same field names as a
10
12
  schema tree node, so a parameter renders identically to a property without a
11
13
  second copy of the row markup.
14
+
15
+ A flag list is the exception. GET /v1/settings takes 87 same-typed, undocumented
16
+ booleans that together answer one question - which settings do you want back - and a
17
+ row each made roughly 260 lines of page carrying no more information than the chip
18
+ grid below. The model only sets `flags` when every member of the group is uniform, so
19
+ nothing with a description or a required member can land here.
12
20
  --}}
13
21
  {{#if params.length}}
14
22
  <div class="mt-4">
15
23
  {{> reference/section-heading label=title class="mb-2"}}
24
+ {{#if flags}}
25
+ <p class="text-base-content/70 mb-2 text-sm">Set any of these to <code class="ee-chip">true</code> to include it in the
26
+ response. All default to <code class="ee-chip">false</code>.</p>
27
+ <div class="flex flex-wrap gap-1">
28
+ {{#each flags}}<code class="ee-chip">{{this}}</code>{{/each}}
29
+ </div>
30
+ {{else}}
16
31
  <ul class="ee-ref-props">
17
32
  {{#each params}}{{> reference/schema-node}}{{/each}}
18
33
  </ul>
34
+ {{/if}}
19
35
  </div>
20
36
  {{/if}}