emailengine-app 2.76.0 → 2.78.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.
- package/.github/workflows/release.yaml +24 -19
- package/.github/workflows/test.yml +80 -0
- package/.ncurc.js +14 -2
- package/.release-please-manifest.json +3 -0
- package/CHANGELOG.md +54 -0
- package/README.md +1 -1
- package/bin/emailengine.js +1 -1
- package/data/google-crawlers.json +1 -1
- package/encrypt.js +72 -5
- package/lib/account/expected-identity.js +88 -0
- package/lib/account.js +75 -26
- package/lib/address-strategies.js +18 -0
- package/lib/api-reference/code-samples.js +194 -0
- package/lib/api-reference/format.js +193 -0
- package/lib/api-reference/index.js +222 -0
- package/lib/api-reference/model.js +338 -0
- package/lib/api-reference/schema-tree.js +366 -0
- package/lib/api-routes/account-routes.js +136 -39
- package/lib/api-routes/behavior-notes.js +57 -0
- package/lib/api-routes/blocklist-routes.js +9 -9
- package/lib/api-routes/changes-routes.js +6 -4
- package/lib/api-routes/chat-routes.js +3 -3
- package/lib/api-routes/delivery-test-routes.js +24 -6
- package/lib/api-routes/export-routes.js +14 -12
- package/lib/api-routes/gateway-routes.js +11 -11
- package/lib/api-routes/license-routes.js +7 -7
- package/lib/api-routes/mailbox-routes.js +18 -9
- package/lib/api-routes/message-routes.js +55 -35
- package/lib/api-routes/oauth2-app-routes.js +22 -16
- package/lib/api-routes/outbox-routes.js +7 -7
- package/lib/api-routes/pubsub-routes.js +3 -3
- package/lib/api-routes/settings-routes.js +10 -9
- package/lib/api-routes/stats-routes.js +3 -3
- package/lib/api-routes/submit-routes.js +58 -8
- package/lib/api-routes/template-routes.js +13 -13
- package/lib/api-routes/token-routes.js +15 -10
- package/lib/api-routes/webhook-route-routes.js +5 -5
- package/lib/append-list.js +3 -14
- package/lib/arf-detect.js +23 -1
- package/lib/autodetect-imap-settings.js +40 -16
- package/lib/base32.js +30 -0
- package/lib/bounce-detect.js +182 -62
- package/lib/consts.js +7 -0
- package/lib/egress-filter.js +89 -8
- package/lib/email-client/base-client.js +72 -82
- package/lib/email-client/gmail-client.js +3 -3
- package/lib/email-client/imap/listing-diff.js +3 -3
- package/lib/email-client/imap/mailbox.js +5 -69
- package/lib/email-client/imap-client.js +3 -2
- package/lib/email-client/message-builder.js +13 -13
- package/lib/email-client/outlook-client.js +1 -1
- package/lib/enum-descriptions.js +130 -0
- package/lib/export.js +1 -1
- package/lib/gateway.js +1 -1
- package/lib/get-raw-email.js +1 -1
- package/lib/imapproxy/imap-core/lib/imap-connection.js +2 -2
- package/lib/imapproxy/imap-core/lib/imap-server.js +2 -2
- package/lib/imapproxy/imap-server.js +42 -28
- package/lib/imapproxy/upstream-client.js +38 -0
- package/lib/license-beacon.js +1 -1
- package/lib/llm-pre-process.js +1 -1
- package/lib/msgpack.js +62 -0
- package/lib/oauth/decode-jwt-payload.js +39 -0
- package/lib/oauth/outlook-identity.js +61 -0
- package/lib/oauth/retry-setup.js +38 -0
- package/lib/oauth2-apps.js +10 -4
- package/lib/openapi/build-document.js +318 -0
- package/lib/openapi/index.js +95 -0
- package/lib/openapi/joi-schema.js +523 -0
- package/lib/outbox.js +66 -3
- package/lib/pre-process.js +1 -1
- package/lib/read-env-value.js +37 -0
- package/lib/routes-ui.js +5 -1
- package/lib/schemas.js +88 -17
- package/lib/swagger-options.js +173 -0
- package/lib/templates.js +1 -1
- package/lib/tokens.js +70 -6
- package/lib/tools.js +117 -48
- package/lib/totp.js +67 -0
- package/lib/ui-routes/account-routes.js +91 -15
- package/lib/ui-routes/admin-config-routes.js +2 -7
- package/lib/ui-routes/admin-entities-routes.js +3 -0
- package/lib/ui-routes/auth-routes.js +6 -24
- package/lib/ui-routes/dashboard-routes.js +2 -26
- package/lib/ui-routes/reference-routes.js +198 -0
- package/lib/ui-routes/route-helpers.js +39 -0
- package/lib/utils/is-email.js +34 -0
- package/lib/utils/to-camel-case.js +17 -0
- package/lib/webhook-egress.js +37 -0
- package/lib/webhooks.js +1 -1
- package/package.json +27 -31
- package/prepare-bundle-deps.sh +28 -0
- package/release-please-config.json +11 -0
- package/sbom.json +1 -1
- package/server.js +11 -3
- package/static/css/flyonui.css +1 -1
- package/static/css/public.css +3 -0
- package/static/css/src/app.tailwind.css +113 -0
- package/static/js/app.js +69 -0
- package/static/js/ee-client.js +238 -8
- package/static/js/reference.js +1021 -0
- package/static/js/ui.js +61 -33
- package/static/licenses.html +658 -1560
- package/translations/README.md +64 -0
- package/translations/de.mo +0 -0
- package/translations/de.po +164 -120
- package/translations/en.po +200 -161
- package/translations/et.mo +0 -0
- package/translations/et.po +163 -120
- package/translations/fr.mo +0 -0
- package/translations/fr.po +163 -120
- package/translations/ja.mo +0 -0
- package/translations/ja.po +163 -120
- package/translations/messages.pot +84 -54
- package/translations/nl.mo +0 -0
- package/translations/nl.po +164 -120
- package/translations/pl.mo +0 -0
- package/translations/pl.po +163 -120
- package/views/account-identity-error.hbs +34 -0
- package/views/accounts/edit.hbs +1 -0
- package/views/accounts/register/imap.hbs +12 -2
- package/views/config/ai.hbs +1 -1
- package/views/config/document-store/chat.hbs +5 -5
- package/views/config/document-store/index.hbs +2 -2
- package/views/config/document-store/pre-processing/index.hbs +1 -1
- package/views/config/email-processing.hbs +1 -1
- package/views/config/imap-proxy.hbs +1 -1
- package/views/config/license.hbs +1 -1
- package/views/config/oauth/index.hbs +3 -3
- package/views/config/security.hbs +1 -1
- package/views/config/smtp.hbs +2 -2
- package/views/dashboard.hbs +1 -1
- package/views/layout/app.hbs +43 -8
- package/views/oauth-scope-error.hbs +1 -1
- package/views/partials/oauth_form.hbs +4 -4
- package/views/partials/reference/anchor-link.hbs +20 -0
- package/views/partials/reference/disclosure.hbs +37 -0
- package/views/partials/reference/nav.hbs +120 -0
- package/views/partials/reference/operation.hbs +127 -0
- package/views/partials/reference/params.hbs +20 -0
- package/views/partials/reference/schema-node.hbs +99 -0
- package/views/partials/reference/schema.hbs +19 -0
- package/views/partials/reference/section-heading.hbs +16 -0
- package/views/partials/reference/token-alert.hbs +49 -0
- package/views/partials/reference/try-field.hbs +31 -0
- package/views/partials/reference/try-it.hbs +78 -0
- package/views/partials/side_menu.hbs +1 -1
- package/views/partials/ui/badge.hbs +4 -2
- package/views/partials/ui/page-header.hbs +1 -1
- package/views/partials/ui/search-input.hbs +31 -0
- package/views/partials/ui/setting-ref.hbs +1 -1
- package/views/partials/ui/stat-card.hbs +4 -2
- package/views/partials/ui/tab.hbs +6 -1
- package/views/partials/ui/tabs.hbs +2 -2
- package/views/reference/index.hbs +76 -0
- package/views/reference/redirect.hbs +49 -0
- package/views/reference/tag.hbs +28 -0
- package/views/reference/token.hbs +49 -0
- package/views/tokens/index.hbs +9 -1
- package/views/webhooks/index.hbs +3 -3
- package/workers/api.js +194 -302
- package/workers/imap.js +1 -1
- package/workers/submit.js +1 -1
- package/workers/webhooks.js +2 -13
- package/views/swagger/index.hbs +0 -82
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
{{!--
|
|
2
|
+
reference/schema-node - one property row in an API reference schema tree.
|
|
3
|
+
|
|
4
|
+
Recursive: the nested-properties block renders this same partial for each child,
|
|
5
|
+
which terminates because lib/api-reference/schema-tree.js builds a finite tree
|
|
6
|
+
(depth-capped, with $ref cycles marked instead of followed).
|
|
7
|
+
|
|
8
|
+
Also rendered directly for operation parameters (reference/params) - the parameter
|
|
9
|
+
view models from buildParameter() carry the same field names and simply have no
|
|
10
|
+
children or variants, so the nested blocks below render nothing for them.
|
|
11
|
+
|
|
12
|
+
Context is a node from buildSchemaTree(): name, anchor, typeLabel, required, nullable,
|
|
13
|
+
deprecated, constraints[], enumValues[], defaultValue, descriptionHtml, children[],
|
|
14
|
+
variants[], openByDefault, truncated, circular, unresolved.
|
|
15
|
+
|
|
16
|
+
`anchor` is the dotted id of this property within its operation, e.g.
|
|
17
|
+
"accountCreate.body.imap.tls.rejectUnauthorized", so a single field can be linked to
|
|
18
|
+
directly. The row highlight on arrival is plain :target CSS; static/js/reference.js only
|
|
19
|
+
has to open the collapsed groups and response tab the row may be buried in.
|
|
20
|
+
|
|
21
|
+
descriptionHtml is pre-escaped by lib/api-reference/format.js (escape first, then a
|
|
22
|
+
closed set of tags added back), which is why it renders unescaped.
|
|
23
|
+
--}}
|
|
24
|
+
<li class="ee-ref-prop min-w-0"{{#if anchor}} id="{{anchor}}"{{/if}}>
|
|
25
|
+
|
|
26
|
+
<div class="ee-ref-prop-head flex flex-wrap items-baseline gap-x-2 gap-y-1">
|
|
27
|
+
{{#if name}}<code class="text-sm font-semibold break-all">{{name}}</code>{{/if}}
|
|
28
|
+
<span class="text-primary text-xs font-medium">{{typeLabel}}</span>
|
|
29
|
+
{{#if required}}<span class="text-error text-2xs font-semibold tracking-wide uppercase">required</span>{{/if}}
|
|
30
|
+
{{#if nullable}}<span class="ee-chip">nullable</span>{{/if}}
|
|
31
|
+
{{#if deprecated}}{{> ui/badge label="deprecated" variant="warning" soft=true icon="" class=""}}{{/if}}
|
|
32
|
+
{{#each constraints}}<span class="ee-chip">{{this}}</span>{{/each}}
|
|
33
|
+
{{#if anchor}}
|
|
34
|
+
{{> reference/anchor-link target=anchor label=(concat "Link to the " name " property") small=true class="ee-ref-prop-anchor"}}
|
|
35
|
+
{{/if}}
|
|
36
|
+
</div>
|
|
37
|
+
|
|
38
|
+
{{#if descriptionHtml}}
|
|
39
|
+
<div class="text-base-content/70 mt-1 text-sm"><p>{{{descriptionHtml}}}</p></div>
|
|
40
|
+
{{/if}}
|
|
41
|
+
|
|
42
|
+
{{#if enumValues}}
|
|
43
|
+
{{#if enumDocumented}}
|
|
44
|
+
{{!-- documented values get a row each; joi .meta({enumDescriptions}) is the source --}}
|
|
45
|
+
<div class="mt-1">
|
|
46
|
+
<span class="text-base-content/50 text-2xs tracking-wide uppercase">Allowed values</span>
|
|
47
|
+
<ul class="ee-ref-nest mt-1 space-y-1">
|
|
48
|
+
{{#each enumValues}}
|
|
49
|
+
<li class="flex flex-wrap items-baseline gap-x-2 text-sm">
|
|
50
|
+
<code class="ee-chip">{{value}}</code>
|
|
51
|
+
{{#if description}}<span class="text-base-content/70">{{description}}</span>{{/if}}
|
|
52
|
+
</li>
|
|
53
|
+
{{/each}}
|
|
54
|
+
</ul>
|
|
55
|
+
</div>
|
|
56
|
+
{{else}}
|
|
57
|
+
<div class="mt-1 flex flex-wrap items-baseline gap-1">
|
|
58
|
+
<span class="text-base-content/50 text-2xs tracking-wide uppercase">Allowed</span>
|
|
59
|
+
{{#each enumValues}}<code class="ee-chip">{{value}}</code>{{/each}}
|
|
60
|
+
</div>
|
|
61
|
+
{{/if}}
|
|
62
|
+
{{/if}}
|
|
63
|
+
|
|
64
|
+
{{#if defaultValue}}
|
|
65
|
+
<div class="text-base-content/50 mt-1 text-xs">Default <code class="ee-chip">{{defaultValue}}</code></div>
|
|
66
|
+
{{/if}}
|
|
67
|
+
|
|
68
|
+
{{#if circular}}
|
|
69
|
+
<div class="text-warning mt-1 text-xs">Recursive reference - see the parent definition</div>
|
|
70
|
+
{{/if}}
|
|
71
|
+
|
|
72
|
+
{{#if truncated}}
|
|
73
|
+
<div class="text-warning mt-1 text-xs">Nesting too deep to display</div>
|
|
74
|
+
{{/if}}
|
|
75
|
+
|
|
76
|
+
{{#if unresolved}}
|
|
77
|
+
<div class="text-warning mt-1 text-xs">Unresolved reference {{unresolved}}</div>
|
|
78
|
+
{{/if}}
|
|
79
|
+
|
|
80
|
+
{{#if variants.length}}
|
|
81
|
+
<div class="ee-ref-nest mt-2 space-y-2">
|
|
82
|
+
{{#each variants}}
|
|
83
|
+
<div>
|
|
84
|
+
<div class="text-base-content/50 text-2xs tracking-wide uppercase">Either</div>
|
|
85
|
+
<ul class="ee-ref-props">{{> reference/schema-node}}</ul>
|
|
86
|
+
</div>
|
|
87
|
+
{{/each}}
|
|
88
|
+
</div>
|
|
89
|
+
{{/if}}
|
|
90
|
+
|
|
91
|
+
{{#if children.length}}
|
|
92
|
+
{{#> reference/disclosure label=childLabel open=openByDefault class="mt-2"}}
|
|
93
|
+
<ul class="ee-ref-props ee-ref-nest mt-2">
|
|
94
|
+
{{#each children}}{{> reference/schema-node}}{{/each}}
|
|
95
|
+
</ul>
|
|
96
|
+
{{/reference/disclosure}}
|
|
97
|
+
{{/if}}
|
|
98
|
+
|
|
99
|
+
</li>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{{!--
|
|
2
|
+
reference/schema - root of a schema tree. Renders the top-level properties as a
|
|
3
|
+
list of reference/schema-node rows, or a single type line when the schema has no
|
|
4
|
+
properties to expand (a bare string, an array of scalars).
|
|
5
|
+
Context is a node from buildSchemaTree().
|
|
6
|
+
--}}
|
|
7
|
+
{{#if children.length}}
|
|
8
|
+
<ul class="ee-ref-props">
|
|
9
|
+
{{#each children}}{{> reference/schema-node}}{{/each}}
|
|
10
|
+
</ul>
|
|
11
|
+
{{else}}
|
|
12
|
+
<div class="flex flex-wrap items-baseline gap-x-2 gap-y-1">
|
|
13
|
+
<span class="text-primary text-xs font-medium">{{typeLabel}}</span>
|
|
14
|
+
{{#each constraints}}<span class="ee-chip">{{this}}</span>{{/each}}
|
|
15
|
+
</div>
|
|
16
|
+
{{#if descriptionHtml}}
|
|
17
|
+
<div class="text-base-content/70 mt-1 text-sm"><p>{{{descriptionHtml}}}</p></div>
|
|
18
|
+
{{/if}}
|
|
19
|
+
{{/if}}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{{!--
|
|
2
|
+
reference/section-heading - small uppercase label for a block inside an operation
|
|
3
|
+
card (Path parameters, Request body, Responses, Code samples).
|
|
4
|
+
Params:
|
|
5
|
+
label - heading text (required)
|
|
6
|
+
suffix - muted normal-case text after the label, e.g. a content type (optional)
|
|
7
|
+
class - extra classes on the heading (optional; the caller owns spacing)
|
|
8
|
+
|
|
9
|
+
Not ui/section-title: that partial emits an <h2> for page-level groups of cards.
|
|
10
|
+
These sit under the operation's own <h3>, so they have to be <h4> to keep the
|
|
11
|
+
heading outline in order.
|
|
12
|
+
--}}
|
|
13
|
+
<h4 class="text-base-content/50 text-xs font-semibold tracking-wide uppercase{{#if class}} {{class}}{{/if}}">
|
|
14
|
+
{{~label~}}
|
|
15
|
+
{{#if suffix}} <span class="text-base-content/40 normal-case">({{suffix}})</span>{{/if}}
|
|
16
|
+
</h4>
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{{!--
|
|
2
|
+
reference/token-alert - "no access token set" banner shown at the top of the reference
|
|
3
|
+
pages. Server-rendered but hidden by default; static/js/reference.js unhides it when
|
|
4
|
+
the tab holds no token, because whether one is set is client state.
|
|
5
|
+
|
|
6
|
+
The banner sticks below the topbar instead of scrolling away, because the Try it panels
|
|
7
|
+
it warns about sit hundreds of pixels down a group page - a warning only visible at the
|
|
8
|
+
top of the page is read once and then gone. Sticky, not fixed: the band keeps its place
|
|
9
|
+
in normal flow, so at rest it pushes the page down instead of covering it, and it takes
|
|
10
|
+
the page background with it so operations passing underneath do not show through.
|
|
11
|
+
Nothing ends up permanently hidden behind it either - reference.js publishes the band's
|
|
12
|
+
measured height as --ee-sticky-band-h, and the layout's scroll-padding (.ee-app-chrome in
|
|
13
|
+
app.tailwind.css) adds it to the scroller's top inset, so anything scrolled into view -
|
|
14
|
+
a deep link, find-in-page, the focus moving through a Try it panel - lands below it.
|
|
15
|
+
|
|
16
|
+
Rendered only when a token is actually required: with the `disableTokens` setting on,
|
|
17
|
+
the API accepts uncredentialed callers, so the banner would be wrong.
|
|
18
|
+
|
|
19
|
+
Not shown on the access-token page itself - the control is already there.
|
|
20
|
+
--}}
|
|
21
|
+
{{#unless disableTokens}}
|
|
22
|
+
{{!-- -mx-6/px-6 is the content column's own gutter (views/layout/app.hbs), cancelled out so
|
|
23
|
+
the opaque band reaches the column edges and nothing scrolls up beside it. The vertical
|
|
24
|
+
padding is the rest of that band: it keeps a strip of page background between the alert
|
|
25
|
+
and whatever is passing underneath, instead of content touching the alert's edge. Both
|
|
26
|
+
pairs cancel to the spacing this banner had before it became sticky. --}}
|
|
27
|
+
<div id="ref-token-alert" class="bg-base-200 @container sticky top-topbar z-20 -mx-6 -mt-2 mb-3 hidden px-6 pt-2 pb-3">
|
|
28
|
+
{{!-- One row wherever there is room for one: with wrapping on, flex breaks the line on the
|
|
29
|
+
text's full width, so the actions drop below it even where they would have fitted
|
|
30
|
+
beside a text column half as wide. Asked of the container rather than the viewport,
|
|
31
|
+
because the constraint is this column - at lg the sidebar and the section nav take
|
|
32
|
+
544px out of the window, and a viewport breakpoint would unwrap the band exactly
|
|
33
|
+
where the column is at its narrowest, stacking the sentence seven lines high. 42rem
|
|
34
|
+
is where the text still fits two lines beside the actions: measured 84-94px for the
|
|
35
|
+
one-row form above it, against 168px for the wrapped form below it. --}}
|
|
36
|
+
<div class="alert alert-soft alert-warning flex flex-wrap items-center gap-3 @2xl:flex-nowrap" role="alert">
|
|
37
|
+
<span class="icon-[tabler--key-off] size-5 shrink-0"></span>
|
|
38
|
+
<div class="min-w-0 grow text-sm">
|
|
39
|
+
No access token is set, so <strong>Try it</strong> requests will be rejected with a 401.
|
|
40
|
+
</div>
|
|
41
|
+
<div class="flex shrink-0 flex-wrap items-center gap-2">
|
|
42
|
+
{{> ui/btn variant="primary" size="sm" icon="icon-[tabler--clock-plus]" label="Mint temporary token"
|
|
43
|
+
class="ref-token-mint" id="" href="" style="" bare="" type="" overlay="" external=""}}
|
|
44
|
+
{{> ui/btn href="/admin/reference/token" variant="neutral" style="soft" size="sm" label="Set a token"
|
|
45
|
+
icon="" id="" bare="" type="" overlay="" external=""}}
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
48
|
+
</div>
|
|
49
|
+
{{/unless}}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{{!--
|
|
2
|
+
reference/try-field - one input in a try-it form. Renders a select for booleans and
|
|
3
|
+
enums and a text field otherwise; static/js/reference.js reads data-param/data-in to
|
|
4
|
+
place the value in the path, the query string or a header.
|
|
5
|
+
|
|
6
|
+
Context is a parameter view model from lib/api-reference/model.js, which already
|
|
7
|
+
carries `in` - so the three groups render from one partial rather than three
|
|
8
|
+
near-identical blocks.
|
|
9
|
+
|
|
10
|
+
Path parameters are prefilled (an operation is not callable without them); query and
|
|
11
|
+
header values start empty with the sample shown as a placeholder, so an unset
|
|
12
|
+
parameter is not silently sent.
|
|
13
|
+
--}}
|
|
14
|
+
<label class="block">
|
|
15
|
+
<span class="text-base-content/70 text-xs font-semibold">{{name}}{{#if required}} <span class="text-error">*</span>{{/if}}</span>
|
|
16
|
+
{{#if isBoolean}}
|
|
17
|
+
<select class="select select-sm mt-1" data-param="{{name}}" data-in="{{in}}">
|
|
18
|
+
<option value=""></option>
|
|
19
|
+
<option value="true">true</option>
|
|
20
|
+
<option value="false">false</option>
|
|
21
|
+
</select>
|
|
22
|
+
{{else if enumValues}}
|
|
23
|
+
<select class="select select-sm mt-1" data-param="{{name}}" data-in="{{in}}">
|
|
24
|
+
<option value=""></option>
|
|
25
|
+
{{#each enumValues}}<option value="{{value}}">{{value}}</option>{{/each}}
|
|
26
|
+
</select>
|
|
27
|
+
{{else}}
|
|
28
|
+
<input type="text" class="input input-sm mt-1" data-param="{{name}}" data-in="{{in}}"
|
|
29
|
+
{{#equals in "path"}}value="{{tryValue}}" {{/equals}}placeholder="{{#if tryValue}}{{tryValue}}{{else}}{{typeLabel}}{{/if}}">
|
|
30
|
+
{{/if}}
|
|
31
|
+
</label>
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
{{!--
|
|
2
|
+
reference/try-it - live request runner for one operation.
|
|
3
|
+
|
|
4
|
+
The form is rendered server-side (one field per parameter, prefilled from the
|
|
5
|
+
schema example) and static/js/reference.js reads it to build and send the request.
|
|
6
|
+
Requests go to this same instance, so they need a real access token - the shared
|
|
7
|
+
token field at the top of the page feeds every panel.
|
|
8
|
+
|
|
9
|
+
The request body is a plain <textarea> rather than an ACE editor on purpose: a tag
|
|
10
|
+
page carries up to 13 operations, and mounting that many editors costs far more
|
|
11
|
+
than the syntax highlighting is worth on a form that is usually submitted as-is.
|
|
12
|
+
|
|
13
|
+
Context is an operation view model from lib/api-reference/model.js.
|
|
14
|
+
--}}
|
|
15
|
+
{{#> reference/disclosure label="Try it" primary=true elId=(concat "try-" id) class="mt-4"}}
|
|
16
|
+
|
|
17
|
+
<form class="ee-ref-try border-base-content/20 mt-3 rounded-box border p-4" data-method="{{method}}" data-path="{{path}}">
|
|
18
|
+
|
|
19
|
+
{{#> ui/alert-banner variant="warning"}}
|
|
20
|
+
<div class="text-sm">Requests run against this EmailEngine instance with real data. A
|
|
21
|
+
<code class="ee-code">{{methodLabel}}</code> here has the same effect as calling the API directly.
|
|
22
|
+
</div>
|
|
23
|
+
{{/ui/alert-banner}}
|
|
24
|
+
|
|
25
|
+
{{#if pathParams.length}}
|
|
26
|
+
<div class="mb-3 grid gap-3 sm:grid-cols-2">
|
|
27
|
+
{{#each pathParams}}{{> reference/try-field}}{{/each}}
|
|
28
|
+
</div>
|
|
29
|
+
{{/if}}
|
|
30
|
+
|
|
31
|
+
{{#if queryParams.length}}
|
|
32
|
+
<div class="mb-3">
|
|
33
|
+
{{> reference/section-heading label="Query" class="mb-2"}}
|
|
34
|
+
<div class="grid gap-3 sm:grid-cols-2">
|
|
35
|
+
{{#each queryParams}}{{> reference/try-field}}{{/each}}
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
{{/if}}
|
|
39
|
+
|
|
40
|
+
{{#if headerParams.length}}
|
|
41
|
+
<div class="mb-3">
|
|
42
|
+
{{> reference/section-heading label="Headers" class="mb-2"}}
|
|
43
|
+
<div class="grid gap-3 sm:grid-cols-2">
|
|
44
|
+
{{#each headerParams}}{{> reference/try-field}}{{/each}}
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
{{/if}}
|
|
48
|
+
|
|
49
|
+
{{#if body}}
|
|
50
|
+
<label class="mb-3 block">
|
|
51
|
+
{{> reference/section-heading label="Request body" suffix=body.contentType}}
|
|
52
|
+
<textarea class="textarea mt-1 font-mono text-xs" rows="10" data-body spellcheck="false">{{body.exampleJson}}</textarea>
|
|
53
|
+
</label>
|
|
54
|
+
{{/if}}
|
|
55
|
+
|
|
56
|
+
{{!-- id="" on both: ui/btn reads `id`, and Handlebars merges a partial's hash params into
|
|
57
|
+
the caller's context, so without it every button here would carry the surrounding
|
|
58
|
+
operation's id (the same trap reference/disclosure documents). --}}
|
|
59
|
+
<div class="flex flex-wrap items-center gap-3">
|
|
60
|
+
{{> ui/btn label="Send request" variant="primary" size="sm" icon="icon-[tabler--send]" type="submit" id="" class=""}}
|
|
61
|
+
{{!-- The code samples above are built from the schema examples; this one is built from
|
|
62
|
+
whatever is in the fields right now, so what you read is what you would run. The
|
|
63
|
+
token is emitted as $EMAILENGINE_TOKEN, never the live one. --}}
|
|
64
|
+
{{> ui/btn label="Copy as curl" bare=true style="text" size="sm" icon="icon-[tabler--copy]" class="ee-ref-try-curl" id=""}}
|
|
65
|
+
<span class="ee-ref-try-status text-base-content/60 text-sm"></span>
|
|
66
|
+
</div>
|
|
67
|
+
|
|
68
|
+
<div class="ee-ref-try-result mt-4 hidden">
|
|
69
|
+
<div class="mb-2 flex flex-wrap items-center gap-2">
|
|
70
|
+
<span class="ee-ref-try-code badge badge-sm"></span>
|
|
71
|
+
<span class="ee-ref-try-time text-base-content/50 text-xs"></span>
|
|
72
|
+
</div>
|
|
73
|
+
<pre class="ee-code-block"><code class="ee-ref-try-body language-json"></code></pre>
|
|
74
|
+
</div>
|
|
75
|
+
|
|
76
|
+
</form>
|
|
77
|
+
|
|
78
|
+
{{/reference/disclosure}}
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
{{> ui/menu-item href="/admin/templates" label="Templates" icon="icon-[tabler--template] size-4.5" active=menuTemplates}}
|
|
12
12
|
|
|
13
13
|
{{> ui/menu-title label="Integrations"}}
|
|
14
|
-
{{> ui/menu-item href="/admin/
|
|
14
|
+
{{> ui/menu-item href="/admin/reference" label="API Reference" icon="icon-[tabler--file-code] size-4.5" active=menuReference}}
|
|
15
15
|
{{> ui/menu-item href="/admin/tokens" label="Access Tokens" icon="icon-[tabler--key] size-4.5" active=menuTokens}}
|
|
16
16
|
{{> ui/menu-item href="/admin/config/oauth" label="OAuth2 Apps" icon="icon-[tabler--brand-oauth] size-4.5" active=menuOauthApps}}
|
|
17
17
|
{{> ui/menu-item href="/admin/webhooks" label="Webhook Routes" icon="icon-[tabler--webhook] size-4.5" active=menuWebhooks}}
|
|
@@ -6,10 +6,12 @@
|
|
|
6
6
|
(default neutral; the legacy "danger" normalizes to error via eeColor)
|
|
7
7
|
soft - true for the soft (tinted) style
|
|
8
8
|
icon - full iconify class (optional)
|
|
9
|
-
|
|
9
|
+
elId - element id (optional). NOT named `id`: Handlebars merges hash params
|
|
10
|
+
into the caller's context, so a partial reading `id` also inherits one
|
|
11
|
+
that merely happens to be in scope - a row's id inside {{#each}}
|
|
10
12
|
class - extra classes, e.g. "state-info" hooks (optional)
|
|
11
13
|
--}}
|
|
12
|
-
<span {{#if
|
|
14
|
+
<span {{#if elId}}id="{{elId}}" {{/if}}class="badge badge-{{eeColor variant}}{{#if soft}} badge-soft{{/if}}{{#if class}} {{class}}{{/if}}">
|
|
13
15
|
{{~#if icon}}<span class="{{icon}} size-3.5 shrink-0"></span>{{/if~}}
|
|
14
16
|
{{~#if label includeZero=true}}{{label}}{{else if @partial-block}}{{> @partial-block label="" variant="" soft="" icon="" id="" class=""}}{{/if~}}
|
|
15
17
|
</span>
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
<h1 class="flex items-center gap-2 text-2xl font-semibold text-base-content">
|
|
24
24
|
{{~#if icon}}<span class="{{icon}} size-6 text-base-content/60"></span>{{/if~}}
|
|
25
25
|
{{title}}
|
|
26
|
-
{{~#if badgeLabel}} {{> ui/badge label=badgeLabel variant=badgeVariant icon=""
|
|
26
|
+
{{~#if badgeLabel}} {{> ui/badge label=badgeLabel variant=badgeVariant icon="" class="" soft=""}}{{/if~}}
|
|
27
27
|
{{~#if stateLabel}} {{> ui/state-badge label=stateLabel dataType=stateType account="" pointer="" class=""}}{{/if~}}
|
|
28
28
|
</h1>
|
|
29
29
|
{{#if @partial-block}}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{{!--
|
|
2
|
+
ui/search-input - text input with a leading magnifier, the standard search field
|
|
3
|
+
look used by the topbar search and the API reference filter.
|
|
4
|
+
{{> ui/search-input id="ref-filter" placeholder="Filter endpoints"}}
|
|
5
|
+
Params:
|
|
6
|
+
id - element id, for the script that reads the value (optional)
|
|
7
|
+
name - form field name, for inputs that submit (optional)
|
|
8
|
+
value - initial value (optional)
|
|
9
|
+
placeholder - placeholder text, also used as the aria-label (required)
|
|
10
|
+
type - input type, "search" or "text" (default "search")
|
|
11
|
+
shortcut - keyboard hint rendered as a <kbd> at the end of the field, for
|
|
12
|
+
fields a page binds a focus hotkey to (optional). Decorative:
|
|
13
|
+
aria-hidden, because the shortcut belongs in the input's own
|
|
14
|
+
accessible name, not as a separate thing to read out.
|
|
15
|
+
shortcutMac - the macOS spelling of the same hint, e.g. "Cmd K" (optional).
|
|
16
|
+
Swapped in by static/js/ui.js, which is where the platform is
|
|
17
|
+
known - the server renders the non-Mac form because it cannot
|
|
18
|
+
tell. Keeping the swap generic means a page that binds a hotkey
|
|
19
|
+
never has to reach into this partial's markup to fix the label.
|
|
20
|
+
class - extra classes on the wrapper, e.g. "grow" (optional)
|
|
21
|
+
The wrapper is the FlyonUI .input; the actual <input> inside it is unstyled and
|
|
22
|
+
grows to fill, which is why the classes sit where they do.
|
|
23
|
+
--}}
|
|
24
|
+
<div class="input input-sm{{#if class}} {{class}}{{/if}}">
|
|
25
|
+
<span class="icon-[tabler--search] text-base-content/60 my-auto me-2 size-4 shrink-0"></span>
|
|
26
|
+
<input type="{{#if type}}{{type}}{{else}}search{{/if}}" class="grow" placeholder="{{placeholder}}" aria-label="{{placeholder}}"
|
|
27
|
+
autocomplete="off" {{#if id}}id="{{id}}" {{/if}}{{#if name}}name="{{name}}" {{/if}}{{#if value}}value="{{value}}" {{/if}}>
|
|
28
|
+
{{#if shortcut}}
|
|
29
|
+
<kbd class="kbd kbd-xs my-auto shrink-0" aria-hidden="true"{{#if shortcutMac}} data-mac="{{shortcutMac}}"{{/if}}>{{shortcut}}</kbd>
|
|
30
|
+
{{/if}}
|
|
31
|
+
</div>
|
|
@@ -17,5 +17,5 @@
|
|
|
17
17
|
flex-row placements where the float is inert (optional)
|
|
18
18
|
--}}
|
|
19
19
|
<div class="text-base-content/60{{#unless nofloat}} float-right{{/unless}} code-link{{#if class}} {{class}}{{/if}}">[{{prefix}}{{#if plain}}{{name}}{{else}}<a
|
|
20
|
-
href="{{#if href}}{{href}}{{else}}/admin/
|
|
20
|
+
href="{{#if href}}{{href}}{{else}}/admin/reference/settings#postV1Settings{{/if}}" target="_blank"
|
|
21
21
|
rel="noopener noreferrer" class="link link-animated">{{name}}</a>{{/if}}{{suffix}}]</div>
|
|
@@ -10,7 +10,9 @@
|
|
|
10
10
|
title - header label next to the icon (optional)
|
|
11
11
|
value - large value text; ignored when a block is given (optional)
|
|
12
12
|
icon - full iconify class shown in the tinted container (optional)
|
|
13
|
-
|
|
13
|
+
elId - element id (optional). NOT named `id`: Handlebars merges hash params
|
|
14
|
+
into the caller's context, so a partial reading `id` also inherits one
|
|
15
|
+
that merely happens to be in scope - a row's id inside {{#each}}
|
|
14
16
|
class - extra classes (optional)
|
|
15
17
|
--}}
|
|
16
18
|
{{#*inline "iconBox"}}
|
|
@@ -18,7 +20,7 @@
|
|
|
18
20
|
<span class="{{icon}} size-5"></span>
|
|
19
21
|
</div>
|
|
20
22
|
{{/inline}}
|
|
21
|
-
<div {{#if
|
|
23
|
+
<div {{#if elId}}id="{{elId}}" {{/if}}class="card bg-base-100 shadow-md{{#if class}} {{class}}{{/if}}">
|
|
22
24
|
<div class="card-body">
|
|
23
25
|
{{#if title}}
|
|
24
26
|
<div class="flex items-center gap-3 mb-2">
|
|
@@ -5,5 +5,10 @@
|
|
|
5
5
|
"<target>-tab" (required)
|
|
6
6
|
label - button text (required)
|
|
7
7
|
active - true for the initially selected tab
|
|
8
|
+
key - stable identity for this tab within its strip, emitted as
|
|
9
|
+
data-tab-key (optional). For scripts that reselect a tab across
|
|
10
|
+
pages: `target` carries the operation id so it cannot match
|
|
11
|
+
anywhere else, and the label is display text that changes when
|
|
12
|
+
the wording does.
|
|
8
13
|
--}}
|
|
9
|
-
<button type="button" class="tab active-tab:tab-active{{#if active}} active{{/if}}" id="{{target}}-tab" data-tab="#{{target}}" role="tab" aria-controls="{{target}}" aria-selected="{{#if active}}true{{else}}false{{/if}}">{{label}}</button>
|
|
14
|
+
<button type="button" class="tab active-tab:tab-active{{#if active}} active{{/if}}" id="{{target}}-tab" data-tab="#{{target}}" role="tab" aria-controls="{{target}}" aria-selected="{{#if active}}true{{else}}false{{/if}}"{{#if key}} data-tab-key="{{key}}"{{/if}}>{{label}}</button>
|
|
@@ -6,14 +6,14 @@
|
|
|
6
6
|
{{/ui/tabs}}
|
|
7
7
|
Params:
|
|
8
8
|
label - aria-label describing the strip (required)
|
|
9
|
-
|
|
9
|
+
elId - element id (optional; see ui/badge for why it is not called `id`)
|
|
10
10
|
class - extra classes on the nav, e.g. "mb-4" (optional)
|
|
11
11
|
Panels are the caller's responsibility: each ui/tab target must match a
|
|
12
12
|
tabpanel element with that id (role="tabpanel" aria-labelledby="<target>-tab").
|
|
13
13
|
The auth-method tabs in oauth_form.hbs intentionally do NOT use this partial -
|
|
14
14
|
they run a custom script instead of the FlyonUI data-tabs plugin.
|
|
15
15
|
--}}
|
|
16
|
-
<nav class="tabs tabs-bordered{{#if class}} {{class}}{{/if}}" aria-label="{{label}}" role="tablist"{{#if
|
|
16
|
+
<nav class="tabs tabs-bordered{{#if class}} {{class}}{{/if}}" aria-label="{{label}}" role="tablist"{{#if elId}} id="{{elId}}"{{/if}} data-tabs>
|
|
17
17
|
{{!-- own hash params neutralized against fallthrough into the block --}}
|
|
18
18
|
{{> @partial-block label="" id="" class=""}}
|
|
19
19
|
</nav>
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
{{!--
|
|
2
|
+
API reference landing page (/admin/reference). Server-rendered from the same
|
|
3
|
+
OpenAPI document that /swagger.json serves - see lib/api-reference/.
|
|
4
|
+
--}}
|
|
5
|
+
{{> reference/token-alert}}
|
|
6
|
+
|
|
7
|
+
{{> ui/page-header title="API Reference" icon="icon-[tabler--api]" class="mb-4"
|
|
8
|
+
subtitle="Every EmailEngine REST endpoint, generated from the same schemas the API validates against."}}
|
|
9
|
+
|
|
10
|
+
{{#> ui/card title="Getting started" bodyClass="space-y-4"}}
|
|
11
|
+
|
|
12
|
+
<dl class="ee-dl">
|
|
13
|
+
<dt>Base URL</dt>
|
|
14
|
+
<dd><code class="ee-chip">{{baseUrl}}</code></dd>
|
|
15
|
+
<dt>Endpoints</dt>
|
|
16
|
+
<dd>{{operationCount}} across {{tags.length}} groups</dd>
|
|
17
|
+
<dt>API version</dt>
|
|
18
|
+
<dd>{{version}}</dd>
|
|
19
|
+
<dt>Specification</dt>
|
|
20
|
+
<dd><a href="/swagger.json" class="link link-primary" target="_blank" rel="noopener noreferrer">/swagger.json</a>
|
|
21
|
+
for Postman and code generators</dd>
|
|
22
|
+
</dl>
|
|
23
|
+
|
|
24
|
+
{{!-- The document's own info.description, not a second copy of it. This page used to
|
|
25
|
+
restate authentication, errors and request processing in its own words, which meant
|
|
26
|
+
two places to keep in step and only one of them published. Pre-escaped by
|
|
27
|
+
lib/api-reference/format.js, hence the triple stash. --}}
|
|
28
|
+
{{#if descriptionHtml}}
|
|
29
|
+
<div class="text-base-content/70 text-sm"><p>{{{descriptionHtml}}}</p></div>
|
|
30
|
+
{{/if}}
|
|
31
|
+
|
|
32
|
+
<div>
|
|
33
|
+
<h3 class="text-base-content mb-1 font-semibold">Error envelope</h3>
|
|
34
|
+
<pre class="ee-code-block"><code class="language-json">{
|
|
35
|
+
"statusCode": 400,
|
|
36
|
+
"error": "Bad Request",
|
|
37
|
+
"message": "Invalid request payload input"
|
|
38
|
+
}</code></pre>
|
|
39
|
+
</div>
|
|
40
|
+
|
|
41
|
+
<div>
|
|
42
|
+
<h3 class="text-base-content mb-1 font-semibold">Code samples</h3>
|
|
43
|
+
<p class="text-base-content/70 text-sm">The snippets on each endpoint read the access token from an
|
|
44
|
+
<code class="ee-chip">EMAILENGINE_TOKEN</code> environment variable, and so does the command behind
|
|
45
|
+
<strong>Copy as curl</strong> in a Try it panel.</p>
|
|
46
|
+
</div>
|
|
47
|
+
|
|
48
|
+
<div class="flex flex-wrap gap-2">
|
|
49
|
+
{{> ui/btn href="/admin/tokens" variant="primary" size="sm" icon="icon-[tabler--key]" label="Access tokens"}}
|
|
50
|
+
{{> ui/btn href="https://learn.emailengine.app/" variant="neutral" style="soft" size="sm"
|
|
51
|
+
icon="icon-[tabler--book]" label="Documentation" external=true}}
|
|
52
|
+
</div>
|
|
53
|
+
|
|
54
|
+
{{/ui/card}}
|
|
55
|
+
|
|
56
|
+
{{> ui/section-title label="Endpoint groups" class="mt-8 mb-3"}}
|
|
57
|
+
|
|
58
|
+
<div class="grid gap-4 sm:grid-cols-2 xl:grid-cols-3">
|
|
59
|
+
{{#each tags}}
|
|
60
|
+
<a href="{{url}}"
|
|
61
|
+
class="card bg-base-100 hover:border-primary/40 border border-transparent shadow-md transition-colors">
|
|
62
|
+
<div class="card-body gap-1 p-4">
|
|
63
|
+
<div class="flex items-baseline justify-between gap-2">
|
|
64
|
+
<h3 class="text-primary font-semibold">{{name}}</h3>
|
|
65
|
+
<span class="text-base-content/40 text-xs">{{operationCount}}</span>
|
|
66
|
+
</div>
|
|
67
|
+
{{#if descriptionHtml}}
|
|
68
|
+
<p class="text-base-content/70 text-sm">{{{descriptionHtml}}}</p>
|
|
69
|
+
{{/if}}
|
|
70
|
+
</div>
|
|
71
|
+
</a>
|
|
72
|
+
{{/each}}
|
|
73
|
+
</div>
|
|
74
|
+
|
|
75
|
+
{{!-- deferred highlighting, sidebar filter and try-it runner; the page content itself is server-rendered --}}
|
|
76
|
+
<script src="/static/js/reference.js" defer></script>
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{{!--
|
|
2
|
+
Compatibility shim for the retired swagger-ui page.
|
|
3
|
+
|
|
4
|
+
/admin/swagger used to deep link as `#/Tag/operationId`. A URL fragment is never sent to
|
|
5
|
+
the server, so the mapping has to happen in the browser - and a 302 would not do either,
|
|
6
|
+
since the browser carries the original fragment through to the new location. Links inside
|
|
7
|
+
this EmailEngine point at /admin/reference directly; this is for bookmarks and for links
|
|
8
|
+
written by older versions.
|
|
9
|
+
|
|
10
|
+
The content below is what remains visible if the lookup falls through or JavaScript is
|
|
11
|
+
off. The redirect normally fires first.
|
|
12
|
+
|
|
13
|
+
redirectMap is serialized by jsonForScript() in lib/api-reference/index.js, which escapes
|
|
14
|
+
`<` so the literal cannot terminate this script element.
|
|
15
|
+
--}}
|
|
16
|
+
<script>
|
|
17
|
+
(() => {
|
|
18
|
+
const map = {{{redirectMap}}};
|
|
19
|
+
const fallback = '/admin/reference';
|
|
20
|
+
|
|
21
|
+
// "#/Account/getV1AccountAccount" -> ["Account", "getV1AccountAccount"]
|
|
22
|
+
const parts = window.location.hash.replace(/^#\/?/, '').split('/').filter(Boolean);
|
|
23
|
+
const operationId = parts[parts.length - 1];
|
|
24
|
+
|
|
25
|
+
// Own-property lookups only: a bare index walks Object.prototype, so a hash ending in
|
|
26
|
+
// "toString" would resolve to a native function and navigate somewhere absurd.
|
|
27
|
+
const lookup = (table, key) => (key && Object.prototype.hasOwnProperty.call(table, key) ? table[key] : null);
|
|
28
|
+
|
|
29
|
+
// Resolve on the operation id. The tag in the old hash is ignored on purpose - tags
|
|
30
|
+
// have been renamed since those links were written - and is consulted only as a
|
|
31
|
+
// fallback for a link whose operation is gone but whose group still exists.
|
|
32
|
+
const operationSlug = lookup(map.operations, operationId);
|
|
33
|
+
const slug = operationSlug || lookup(map.tags, (parts[0] || '').toLowerCase());
|
|
34
|
+
|
|
35
|
+
window.location.replace(slug ? `/admin/reference/${slug}${operationSlug ? `#${operationId}` : ''}` : fallback);
|
|
36
|
+
})();
|
|
37
|
+
</script>
|
|
38
|
+
|
|
39
|
+
{{> ui/page-header title="API Reference" icon="icon-[tabler--api]" class="mb-4"}}
|
|
40
|
+
|
|
41
|
+
<div class="alert alert-soft alert-info flex items-start gap-3" role="alert">
|
|
42
|
+
<span class="icon-[tabler--info-circle] size-5 shrink-0"></span>
|
|
43
|
+
<div class="min-w-0 text-sm">
|
|
44
|
+
<p>The API reference has moved. You should be redirected automatically.</p>
|
|
45
|
+
<p class="mt-2">
|
|
46
|
+
{{> ui/btn href="/admin/reference" variant="primary" size="sm" icon="icon-[tabler--arrow-right]" label="Open the API Reference"}}
|
|
47
|
+
</p>
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{{!--
|
|
2
|
+
API reference page for one endpoint group (/admin/reference/{tag}). Every operation
|
|
3
|
+
in the group is rendered in full - see lib/api-reference/ for the model.
|
|
4
|
+
--}}
|
|
5
|
+
{{> reference/token-alert}}
|
|
6
|
+
|
|
7
|
+
{{> ui/breadcrumb parentHref="/admin/reference" parentLabel="API Reference" current=tag.name class="mb-2"}}
|
|
8
|
+
|
|
9
|
+
{{> ui/page-header title=tag.name icon="icon-[tabler--api]" class="mb-4"}}
|
|
10
|
+
|
|
11
|
+
{{#if tag.descriptionHtml}}
|
|
12
|
+
<p class="text-base-content/70 mb-4">{{{tag.descriptionHtml}}}</p>
|
|
13
|
+
{{/if}}
|
|
14
|
+
|
|
15
|
+
{{#if tag.externalDocs}}
|
|
16
|
+
<p class="mb-4 text-sm">
|
|
17
|
+
<a href="{{tag.externalDocs.url}}" class="link link-primary" target="_blank" rel="noopener noreferrer">
|
|
18
|
+
{{#if tag.externalDocs.description}}{{tag.externalDocs.description}}{{else}}Documentation{{/if}}
|
|
19
|
+
</a>
|
|
20
|
+
</p>
|
|
21
|
+
{{/if}}
|
|
22
|
+
|
|
23
|
+
{{#each operations}}
|
|
24
|
+
{{> reference/operation}}
|
|
25
|
+
{{/each}}
|
|
26
|
+
|
|
27
|
+
{{!-- deferred highlighting, sidebar filter and try-it runner; the page content itself is server-rendered --}}
|
|
28
|
+
<script src="/static/js/reference.js" defer></script>
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{{!--
|
|
2
|
+
Access-token page for the API reference (/admin/reference/token).
|
|
3
|
+
|
|
4
|
+
The single place the try-it token is entered. It is held for the browser tab only
|
|
5
|
+
(sessionStorage, see static/js/reference.js) and reused by the try-it panels on every
|
|
6
|
+
endpoint page, so it does not have to be re-entered while navigating.
|
|
7
|
+
--}}
|
|
8
|
+
{{> ui/breadcrumb parentHref="/admin/reference" parentLabel="API Reference" current="Access token" class="mb-2"}}
|
|
9
|
+
|
|
10
|
+
{{> ui/page-header title="Access token" icon="icon-[tabler--key]" class="mb-4"
|
|
11
|
+
subtitle="Enables the Try it panels on the endpoint pages."}}
|
|
12
|
+
|
|
13
|
+
{{#> ui/card id="ref-token" bodyClass="space-y-4"}}
|
|
14
|
+
|
|
15
|
+
<p class="text-base-content/70 text-sm">The token is held for this browser tab only - it is never written to permanent
|
|
16
|
+
storage, and it is only ever sent to this EmailEngine instance, by requests you trigger yourself.</p>
|
|
17
|
+
|
|
18
|
+
<div>
|
|
19
|
+
{{> reference/section-heading label="Use an existing token" class="mb-2"}}
|
|
20
|
+
<div class="flex flex-wrap items-center gap-2">
|
|
21
|
+
<input type="password" id="ref-access-token" class="input input-sm max-w-sm grow font-mono" placeholder="Paste an access token"
|
|
22
|
+
autocomplete="off" spellcheck="false">
|
|
23
|
+
{{> ui/btn id="ref-token-set" variant="primary" size="sm" icon="icon-[tabler--check]" label="Set token"}}
|
|
24
|
+
</div>
|
|
25
|
+
<p class="text-base-content/50 mt-2 text-xs">Create one on the
|
|
26
|
+
<a href="/admin/tokens" class="link link-primary">Access Tokens</a> page.</p>
|
|
27
|
+
</div>
|
|
28
|
+
|
|
29
|
+
<div>
|
|
30
|
+
{{> reference/section-heading label="Or mint a temporary one" class="mb-2"}}
|
|
31
|
+
<div class="flex flex-wrap items-center gap-2">
|
|
32
|
+
{{> ui/btn id="ref-token-mint" variant="primary" size="sm" icon="icon-[tabler--clock-plus]"
|
|
33
|
+
label="Mint temporary token" class="ref-token-mint"}}
|
|
34
|
+
{{!-- shown by static/js/reference.js only while a token is actually held --}}
|
|
35
|
+
<span id="ref-token-clear-wrap" class="hidden">
|
|
36
|
+
{{> ui/btn id="ref-token-clear" variant="neutral" style="text" size="sm" icon="icon-[tabler--x]" label="Clear"}}
|
|
37
|
+
</span>
|
|
38
|
+
</div>
|
|
39
|
+
<p class="text-base-content/50 mt-2 text-xs">Creates an API-scoped token that expires in one hour and activates it
|
|
40
|
+
here. It is a real token until then - it appears on the
|
|
41
|
+
<a href="/admin/tokens" class="link link-primary">Access Tokens</a> page and can be revoked there.</p>
|
|
42
|
+
</div>
|
|
43
|
+
|
|
44
|
+
<p id="ref-token-feedback" class="text-base-content/70 text-sm"></p>
|
|
45
|
+
|
|
46
|
+
{{/ui/card}}
|
|
47
|
+
|
|
48
|
+
{{!-- deferred highlighting, sidebar filter and try-it runner; the page content itself is server-rendered --}}
|
|
49
|
+
<script src="/static/js/reference.js" defer></script>
|