emailengine-app 2.77.0 → 2.79.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 (189) hide show
  1. package/.github/workflows/test.yml +80 -0
  2. package/.ncurc.js +23 -13
  3. package/.release-please-manifest.json +1 -1
  4. package/CHANGELOG.md +60 -0
  5. package/bin/emailengine.js +1 -1
  6. package/config/e2e.toml +2 -1
  7. package/config/test.toml +2 -1
  8. package/data/google-crawlers.json +1 -1
  9. package/encrypt.js +1 -1
  10. package/lib/account/expected-identity.js +88 -0
  11. package/lib/account.js +145 -61
  12. package/lib/api-reference/format.js +105 -4
  13. package/lib/api-reference/index.js +24 -7
  14. package/lib/api-reference/model.js +148 -21
  15. package/lib/api-reference/schema-tree.js +282 -28
  16. package/lib/api-routes/account-routes.js +99 -36
  17. package/lib/api-routes/behavior-notes.js +3 -0
  18. package/lib/api-routes/blocklist-routes.js +21 -47
  19. package/lib/api-routes/chat-routes.js +10 -12
  20. package/lib/api-routes/delivery-test-routes.js +6 -26
  21. package/lib/api-routes/export-routes.js +2 -0
  22. package/lib/api-routes/gateway-routes.js +52 -11
  23. package/lib/api-routes/license-routes.js +2 -0
  24. package/lib/api-routes/mailbox-routes.js +29 -26
  25. package/lib/api-routes/message-routes.js +27 -21
  26. package/lib/api-routes/oauth2-app-routes.js +11 -29
  27. package/lib/api-routes/operation-impact.js +80 -0
  28. package/lib/api-routes/outbox-routes.js +15 -5
  29. package/lib/api-routes/permission-map.js +397 -0
  30. package/lib/api-routes/route-helpers.js +223 -9
  31. package/lib/api-routes/route-metadata.js +28 -0
  32. package/lib/api-routes/settings-routes.js +30 -25
  33. package/lib/api-routes/stats-routes.js +2 -2
  34. package/lib/api-routes/submit-routes.js +53 -31
  35. package/lib/api-routes/template-routes.js +3 -0
  36. package/lib/api-routes/token-routes.js +319 -33
  37. package/lib/api-routes/webhook-route-routes.js +14 -4
  38. package/lib/append-list.js +3 -14
  39. package/lib/arf-detect.js +23 -1
  40. package/lib/auth-token.js +80 -8
  41. package/lib/autodetect-imap-settings.js +40 -16
  42. package/lib/base32.js +30 -0
  43. package/lib/bounce-detect.js +182 -62
  44. package/lib/consts.js +10 -0
  45. package/lib/db.js +20 -2
  46. package/lib/delivery-error.js +30 -1
  47. package/lib/egress-filter.js +89 -8
  48. package/lib/email-client/base-client.js +35 -113
  49. package/lib/email-client/gmail-client.js +22 -13
  50. package/lib/email-client/imap/listing-diff.js +3 -3
  51. package/lib/email-client/imap/mailbox.js +28 -93
  52. package/lib/email-client/imap/subconnection.js +10 -7
  53. package/lib/email-client/imap/sync-operations.js +46 -46
  54. package/lib/email-client/imap-client.js +39 -28
  55. package/lib/email-client/message-builder.js +15 -15
  56. package/lib/email-client/notification-handler.js +1 -1
  57. package/lib/email-client/outlook/graph-api.js +10 -4
  58. package/lib/email-client/outlook-client.js +54 -55
  59. package/lib/email-client/smtp-pool-manager.js +1 -1
  60. package/lib/enum-descriptions.js +92 -2
  61. package/lib/export.js +2 -2
  62. package/lib/field-usage.js +133 -0
  63. package/lib/gateway.js +2 -2
  64. package/lib/get-raw-email.js +1 -1
  65. package/lib/imapproxy/imap-core/lib/commands/authenticate-plain.js +3 -3
  66. package/lib/imapproxy/imap-core/lib/commands/id.js +2 -13
  67. package/lib/imapproxy/imap-core/lib/commands/starttls.js +1 -1
  68. package/lib/imapproxy/imap-core/lib/imap-command.js +21 -5
  69. package/lib/imapproxy/imap-core/lib/imap-connection.js +17 -7
  70. package/lib/imapproxy/imap-core/lib/imap-server.js +2 -2
  71. package/lib/imapproxy/imap-server.js +40 -10
  72. package/lib/license-beacon.js +5 -10
  73. package/lib/lists.js +49 -1
  74. package/lib/llm-pre-process.js +6 -6
  75. package/lib/logger.js +5 -1
  76. package/lib/metrics-collector.js +2 -2
  77. package/lib/msgpack.js +62 -0
  78. package/lib/oauth/decode-jwt-payload.js +39 -0
  79. package/lib/oauth/gmail.js +9 -12
  80. package/lib/oauth/mail-ru.js +5 -7
  81. package/lib/oauth/outlook-identity.js +61 -0
  82. package/lib/oauth/outlook.js +9 -9
  83. package/lib/oauth/pubsub/google.js +25 -10
  84. package/lib/oauth/retry-setup.js +38 -0
  85. package/lib/oauth/scope-checker.js +1 -1
  86. package/lib/oauth2-apps.js +224 -295
  87. package/lib/openapi/build-document.js +15 -7
  88. package/lib/openapi/joi-schema.js +20 -0
  89. package/lib/outbox.js +145 -14
  90. package/lib/pre-process.js +9 -9
  91. package/lib/queue-stats.js +49 -0
  92. package/lib/read-env-value.js +37 -0
  93. package/lib/reconnection-manager.js +2 -2
  94. package/lib/rewrite-text-nodes.js +4 -3
  95. package/lib/routes-ui.js +4 -0
  96. package/lib/schemas.js +223 -155
  97. package/lib/settings.js +84 -5
  98. package/lib/sub-script.js +2 -1
  99. package/lib/swagger-options.js +2 -1
  100. package/lib/templates.js +5 -5
  101. package/lib/threads.js +2 -2
  102. package/lib/token-audit-log.js +208 -0
  103. package/lib/token-permission-view.js +219 -0
  104. package/lib/token-permissions.js +172 -0
  105. package/lib/tokens.js +100 -16
  106. package/lib/tools.js +259 -85
  107. package/lib/totp.js +67 -0
  108. package/lib/ui-routes/account-routes.js +122 -26
  109. package/lib/ui-routes/admin-config-routes.js +20 -17
  110. package/lib/ui-routes/admin-entities-routes.js +66 -22
  111. package/lib/ui-routes/auth-routes.js +36 -48
  112. package/lib/ui-routes/export-routes.js +10 -4
  113. package/lib/ui-routes/oauth-config-routes.js +5 -5
  114. package/lib/ui-routes/reference-routes.js +11 -8
  115. package/lib/ui-routes/route-helpers.js +79 -2
  116. package/lib/ui-routes/settings-page.js +1 -1
  117. package/lib/ui-routes/smtp-test-routes.js +1 -1
  118. package/lib/ui-routes/suppression-list-routes.js +294 -0
  119. package/lib/ui-routes/unsubscribe-routes.js +19 -29
  120. package/lib/utils/is-email.js +34 -0
  121. package/lib/utils/network.js +2 -2
  122. package/lib/utils/to-camel-case.js +17 -0
  123. package/lib/web-safe-html.js +1 -1
  124. package/lib/webhook-egress.js +37 -0
  125. package/lib/webhook-routing.js +80 -0
  126. package/lib/webhooks.js +21 -15
  127. package/package.json +26 -27
  128. package/sbom.json +1 -0
  129. package/server.js +81 -42
  130. package/static/css/flyonui.css +1 -1
  131. package/static/css/public.css +3 -0
  132. package/static/css/src/app.tailwind.css +159 -9
  133. package/static/js/app.js +69 -0
  134. package/static/js/reference.js +741 -10
  135. package/static/js/ui.js +43 -0
  136. package/static/licenses.html +698 -1590
  137. package/translations/README.md +64 -0
  138. package/translations/de.mo +0 -0
  139. package/translations/de.po +164 -120
  140. package/translations/en.po +200 -161
  141. package/translations/et.mo +0 -0
  142. package/translations/et.po +163 -120
  143. package/translations/fr.mo +0 -0
  144. package/translations/fr.po +163 -120
  145. package/translations/ja.mo +0 -0
  146. package/translations/ja.po +163 -120
  147. package/translations/messages.pot +94 -64
  148. package/translations/nl.mo +0 -0
  149. package/translations/nl.po +164 -120
  150. package/translations/pl.mo +0 -0
  151. package/translations/pl.po +163 -120
  152. package/views/account-identity-error.hbs +34 -0
  153. package/views/accounts/account.hbs +69 -7
  154. package/views/accounts/browse.hbs +18 -35
  155. package/views/accounts/edit.hbs +1 -0
  156. package/views/accounts/register/imap.hbs +12 -2
  157. package/views/config/logging.hbs +6 -0
  158. package/views/config/oauth/app.hbs +0 -2
  159. package/views/config/security.hbs +13 -0
  160. package/views/layout/app.hbs +29 -5
  161. package/views/oauth-scope-error.hbs +1 -1
  162. package/views/partials/oauth_form.hbs +0 -15
  163. package/views/partials/reference/disclosure.hbs +8 -2
  164. package/views/partials/reference/nav.hbs +36 -9
  165. package/views/partials/reference/operation.hbs +48 -14
  166. package/views/partials/reference/params.hbs +17 -1
  167. package/views/partials/reference/schema-node.hbs +112 -54
  168. package/views/partials/reference/schema-tools.hbs +25 -0
  169. package/views/partials/reference/token-alert.hbs +35 -10
  170. package/views/partials/reference/try-it.hbs +84 -11
  171. package/views/partials/side_menu.hbs +1 -0
  172. package/views/partials/ui/checkbox.hbs +2 -2
  173. package/views/partials/ui/tabs.hbs +7 -1
  174. package/views/reference/index.hbs +1 -1
  175. package/views/reference/token.hbs +4 -0
  176. package/views/suppression-lists/index.hbs +85 -0
  177. package/views/suppression-lists/list.hbs +87 -0
  178. package/views/templates/index.hbs +8 -2
  179. package/views/tokens/index.hbs +31 -4
  180. package/views/tokens/new.hbs +324 -2
  181. package/workers/api.js +299 -140
  182. package/workers/documents.js +46 -26
  183. package/workers/export.js +20 -8
  184. package/workers/imap-proxy.js +2 -2
  185. package/workers/imap.js +13 -7
  186. package/workers/smtp.js +13 -7
  187. package/workers/submit.js +41 -31
  188. package/workers/webhooks.js +60 -37
  189. package/lib/feature-flags.js +0 -48
@@ -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></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.</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">
@@ -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
 
@@ -15,6 +15,7 @@
15
15
 
16
16
  {{> ui/form-field id="name" label="Full name" value=values.name error=errors.name hint="Full name of the user"}}
17
17
  {{> ui/form-field id="email" type="email" label="Email" value=values.email error=errors.email hint="Email address of the user"}}
18
+ {{> ui/form-field id="expectedEmail" type="email" label="Expected identity" value=values.expectedEmail error=errors.expectedEmail hint="Optional. Setups through the hosted authentication form are rejected unless the identity they authenticate matches this address. Clear the field to remove the restriction."}}
18
19
 
19
20
  </div>
20
21
  </div>
@@ -19,14 +19,24 @@ step (/accounts/new/imap/server). --}}
19
19
  <span class="ee-hint">{{_ "Enter your full name" templateLocale }}</span>
20
20
  </div>
21
21
 
22
+ {{!-- When the setup link pins an expected address the field is fixed. This is a convenience
23
+ only: the server rejects a mismatch regardless of what is submitted. --}}
22
24
  <div class="ee-field">
23
25
  <label class="ee-label" for="email">{{_ "Email address" templateLocale }}</label>
26
+ {{!-- autofocus only when the field is editable: focusing a readonly input strands the caret --}}
24
27
  <input type="email" class="ee-input{{#if errors.email}} ee-invalid{{/if}}" id="email" name="email"
25
- value="{{values.email}}" {{#if values.name}}autofocus{{/if}} required />
28
+ value="{{values.email}}" {{#unless values.emailPinned}}{{#if values.name}}autofocus{{/if}}{{/unless}}
29
+ {{#if values.emailPinned}}readonly{{/if}} required />
26
30
  {{#if errors.email}}
27
31
  <span class="ee-field-error">{{errors.email}}</span>
28
32
  {{/if}}
29
- <span class="ee-hint">{{_ "Enter your email address" templateLocale }}</span>
33
+ <span class="ee-hint">
34
+ {{#if values.emailPinned}}
35
+ {{_ "This setup link is restricted to this email address" templateLocale }}
36
+ {{else}}
37
+ {{_ "Enter your email address" templateLocale }}
38
+ {{/if}}
39
+ </span>
30
40
  </div>
31
41
 
32
42
  <div class="ee-field">
@@ -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,5 +1,5 @@
1
1
  <!DOCTYPE html>
2
- <html lang="en">
2
+ <html lang="en" class="ee-app-chrome">
3
3
 
4
4
  <head>
5
5
 
@@ -208,11 +208,35 @@
208
208
  level of the same menu rather than a panel floating in the page. A page
209
209
  opts in by setting `secondaryNav` to a partial name in its view context;
210
210
  every other page renders exactly as before.
211
- On small screens it becomes a bounded scroll strip above the content,
212
- because the sidebar drawer has no room for a second column. -->
213
- <aside class="bg-base-100 border-base-content/20 max-h-48 shrink-0 overflow-y-auto border-b lg:sticky lg:top-topbar lg:h-[calc(100vh-var(--spacing-topbar))] lg:max-h-none lg:w-64 lg:self-start lg:border-e lg:border-b-0"
211
+
212
+ Below lg there is no room for a second column, so the whole thing collapses
213
+ to the row below, closed by default. It used to be a 192px scroll strip
214
+ pinned above the content, which showed about a fifth of the list, hid the
215
+ rest behind a nested scrollbar most people never notice, and still pushed
216
+ the page heading off the first screen. A disclosure costs one row instead.
217
+ Opened, it is capped at the screen and scrolls itself - the difference from
218
+ what it replaced is that the space is asked for, not permanently taken, and
219
+ that the filter's 82 hits cannot push the page a thousand pixels down.
220
+
221
+ aria-expanded on the button is the only state there is: below lg the panel
222
+ derives its visibility from it, above lg it is a column regardless of what
223
+ the button last said. -->
224
+ <aside class="bg-base-100 border-base-content/20 shrink-0 border-b lg:sticky lg:top-topbar lg:h-[calc(100vh-var(--spacing-topbar))] lg:w-64 lg:overflow-y-auto lg:border-e lg:border-b-0"
214
225
  aria-label="Section navigation">
215
- {{> (lookup . "secondaryNav")}}
226
+
227
+ <button type="button" id="secondary-nav-toggle" aria-expanded="false" aria-controls="secondary-nav-panel"
228
+ class="peer group hover:bg-base-200 flex w-full cursor-pointer items-center justify-between gap-2 px-4 py-3 text-sm font-semibold lg:hidden">
229
+ <span class="flex items-center gap-2">
230
+ <span class="icon-[tabler--list-search] size-4 shrink-0"></span>
231
+ {{#if secondaryNavLabel}}{{secondaryNavLabel}}{{else}}Sections{{/if}}
232
+ </span>
233
+ <span class="icon-[tabler--chevron-down] size-4 shrink-0 transition-transform duration-200 group-aria-expanded:rotate-180"></span>
234
+ </button>
235
+
236
+ <div id="secondary-nav-panel"
237
+ class="border-base-content/10 hidden border-t max-lg:max-h-[calc(100dvh-var(--spacing-topbar))] max-lg:overflow-y-auto max-lg:overscroll-contain max-lg:peer-aria-expanded:block lg:block lg:border-t-0">
238
+ {{> (lookup . "secondaryNav")}}
239
+ </div>
216
240
  </aside>
217
241
  {{/if}}
218
242
 
@@ -24,7 +24,7 @@ permissions; offers a link to restart the consent flow. --}}
24
24
  </p>
25
25
 
26
26
  <div class="ee-form-actions">
27
- <a href="{{reAuthUrl}}" class="ee-btn ee-btn-primary ee-btn-block">
27
+ <a href="{{retryUrl}}" class="ee-btn ee-btn-primary ee-btn-block">
28
28
  <span class="ee-icon ee-icon-refresh"></span>{{_ "Try Again" templateLocale}}
29
29
  </a>
30
30
  </div>
@@ -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>
@@ -18,7 +18,7 @@
18
18
  the endpoints that accept them, not only the ones with the word in their path.
19
19
 
20
20
  Params (from the reference view context):
21
- nav - tags with { name, slug, operationCount, active, operations[] }
21
+ nav - tags with { name, slug, url, operationCount, active, operations[] }
22
22
  searchIndex - flat operation list backing the filter
23
23
  --}}
24
24
  <div class="flex flex-col gap-3 p-3">
@@ -68,24 +68,51 @@
68
68
  <li id="ref-filter-empty" class="text-base-content/50 hidden px-2 py-2 text-xs">No matching endpoints</li>
69
69
  </ul>
70
70
 
71
+ {{!-- Every group carries its operations, so the list of a group you are not on can be
72
+ opened without loading its page. Below the layout's lg breakpoint the nav is a
73
+ disclosure, and there static/js/reference.js turns a tap on a group row into opening
74
+ that list instead of a page load - the chevron is the affordance for it. Which list
75
+ is open is aria-expanded on the group row and nothing else: the attribute is the
76
+ state, `max-lg:peer-aria-expanded:block` is the rendering.
77
+
78
+ As a column it is not a disclosure at all - the active group's list is shown by
79
+ lg:block and every other stays hidden, no matter what the reader last expanded on a
80
+ narrow window. Without that, widening after collapsing the active group would leave
81
+ the column with no list and no control to bring one back.
82
+
83
+ Not FlyonUI's collapse or accordion, though both are in the bundle: HSCollapse
84
+ animates an inline height that would fight lg:block (and strand a stale one when the
85
+ viewport crosses lg), HSAccordion needs a <button> where these rows have to stay
86
+ links above lg, and neither has any notion of a breakpoint - which is the whole
87
+ problem here. --}}
71
88
  <ul id="ref-tag-list" class="flex flex-col gap-0.5">
72
89
  {{#each nav}}
73
90
  <li>
74
- <a href="/admin/reference/{{slug}}"
75
- class="flex items-center justify-between gap-2 rounded-field px-2 py-1.5 text-sm{{#if active}} bg-primary/10 text-primary font-semibold{{else}} hover:bg-base-200{{/if}}">
91
+ <a href="{{url}}" aria-controls="ref-ops-{{slug}}" aria-expanded="{{#if active}}true{{else}}false{{/if}}"
92
+ class="peer group flex items-center justify-between gap-2 rounded-field px-2 py-1.5 text-sm{{#if active}} bg-primary/10 text-primary font-semibold{{else}} hover:bg-base-200{{/if}}">
76
93
  <span class="truncate">{{name}}</span>
77
- <span class="text-base-content/40 text-2xs">{{operationCount}}</span>
94
+ <span class="flex shrink-0 items-center gap-1">
95
+ <span class="text-base-content/40 text-2xs">{{operationCount}}</span>
96
+ <span
97
+ class="icon-[tabler--chevron-down] text-base-content/40 size-3.5 transition-transform duration-200 group-aria-expanded:rotate-180 lg:hidden"></span>
98
+ </span>
78
99
  </a>
79
- {{#if operations.length}}
80
- <ul class="border-base-content/10 my-1 ms-3 border-s ps-2">
100
+ {{!-- ee-ref-op-nav marks the ACTIVE group's list only: it is the hook static/js/
101
+ reference.js scroll-spies on, and only that list holds in-page anchors to mark.
102
+ The current-state styling is written as aria-[current] variants here rather than
103
+ a rule in app.tailwind.css because a components-layer rule loses to the
104
+ text-base-content/70 utility on this same element - utilities are emitted later,
105
+ so the colour would silently not apply. Same utilities as the active tag entry
106
+ above, so the two levels read as one marker. --}}
107
+ <ul id="ref-ops-{{slug}}"
108
+ class="{{#if active}}ee-ref-op-nav lg:block {{/if}}border-base-content/10 my-1 ms-3 hidden border-s ps-2 max-lg:peer-aria-expanded:block">
81
109
  {{#each operations}}
82
110
  <li>
83
- <a href="#{{id}}"
84
- class="text-base-content/70 hover:bg-base-200 hover:text-base-content block truncate rounded-field px-2 py-1 text-xs">{{summary}}</a>
111
+ <a href="{{url}}"
112
+ class="text-base-content/70 hover:bg-base-200 hover:text-base-content aria-[current=location]:bg-primary/10 aria-[current=location]:text-primary aria-[current=location]:font-semibold block truncate rounded-field px-2 py-1 text-xs">{{summary}}</a>
85
113
  </li>
86
114
  {{/each}}
87
115
  </ul>
88
- {{/if}}
89
116
  </li>
90
117
  {{/each}}
91
118
  </ul>
@@ -12,7 +12,7 @@
12
12
  neutralizes its own hash params inside the partial block, so the operation id is
13
13
  not reachable from there to compose them with.
14
14
  --}}
15
- <section id="{{id}}" class="ee-ref-op card bg-base-100 mb-6 scroll-mt-20 shadow-md">
15
+ <section id="{{id}}" class="ee-ref-op card bg-base-100 mb-6 shadow-md">
16
16
  <div class="card-body">
17
17
 
18
18
  <div class="flex flex-wrap items-center gap-2">
@@ -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}}