emailengine-app 2.79.1 → 2.79.2
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/.release-please-manifest.json +1 -1
- package/CHANGELOG.md +40 -0
- package/bin/emailengine.js +8 -1
- package/config/default.toml +6 -0
- package/data/google-crawlers.json +1 -1
- package/lib/account.js +95 -18
- package/lib/api-routes/account-routes.js +13 -1
- package/lib/api-routes/index.js +12 -0
- package/lib/api-routes/mailbox-routes.js +6 -0
- package/lib/api-routes/mcp-oauth-routes.js +259 -0
- package/lib/api-routes/mcp-routes.js +172 -0
- package/lib/api-routes/message-routes.js +125 -4
- package/lib/api-routes/outbox-routes.js +7 -0
- package/lib/api-routes/permission-map.js +97 -1
- package/lib/api-routes/route-helpers.js +16 -4
- package/lib/api-routes/route-metadata.js +24 -4
- package/lib/api-routes/submit-routes.js +41 -0
- package/lib/api-routes/template-routes.js +7 -0
- package/lib/api-routes/token-routes.js +4 -2
- package/lib/consts.js +30 -1
- package/lib/email-client/base-client.js +102 -117
- package/lib/email-client/gmail-client.js +87 -22
- package/lib/email-client/imap/mailbox.js +140 -66
- package/lib/email-client/outlook-client.js +17 -14
- package/lib/enum-descriptions.js +2 -1
- package/lib/field-usage.js +17 -1
- package/lib/lua/s-list-accounts.lua +5 -2
- package/lib/mcp/index.js +29 -0
- package/lib/mcp/inject.js +70 -0
- package/lib/mcp/json-schema.js +120 -0
- package/lib/mcp/listen.js +171 -0
- package/lib/mcp/oauth.js +324 -0
- package/lib/mcp/protocol.js +489 -0
- package/lib/mcp/resources.js +139 -0
- package/lib/mcp/tools.js +655 -0
- package/lib/openapi/index.js +3 -1
- package/lib/response-stream.js +52 -21
- package/lib/routes-ui.js +4 -0
- package/lib/schemas.js +24 -3
- package/lib/token-permission-view.js +104 -8
- package/lib/tokens.js +34 -5
- package/lib/tools.js +96 -0
- package/lib/ui-routes/account-routes.js +43 -1
- package/lib/ui-routes/admin-config-routes.js +114 -1
- package/lib/ui-routes/admin-entities-routes.js +54 -5
- package/lib/ui-routes/auth-routes.js +13 -0
- package/lib/ui-routes/mcp-consent-routes.js +330 -0
- package/lib/ui-routes/route-helpers.js +116 -1
- package/lib/utils/network.js +9 -1
- package/lib/web-safe-html.js +61 -0
- package/lib/webhooks.js +3 -8
- package/package.json +9 -8
- package/sbom.json +1 -1
- package/scripts/README.md +25 -0
- package/scripts/build-icon.js +77 -0
- package/static/css/flyonui.css +1 -1
- package/static/css/src/app.tailwind.css +98 -0
- package/static/emailengine.ico +0 -0
- package/static/js/ui.js +465 -1
- package/static/licenses.html +42 -22
- package/translations/messages.pot +57 -57
- package/views/config/mcp.hbs +361 -0
- package/views/config/oauth/index.hbs +7 -0
- package/views/layout/prompt.hbs +62 -0
- package/views/mcp/authorize.hbs +136 -0
- package/views/partials/head_assets.hbs +3 -3
- package/views/partials/mcp_access_levels.hbs +13 -0
- package/views/partials/mcp_account_limit.hbs +14 -0
- package/views/partials/mcp_tool_count.hbs +19 -0
- package/views/partials/side_menu.hbs +1 -0
- package/views/partials/ui/account-picker.hbs +59 -0
- package/views/partials/ui/code-block.hbs +26 -0
- package/views/partials/ui/menu-item.hbs +5 -0
- package/views/partials/ui/radio.hbs +41 -0
- package/views/partials/ui/tab.hbs +15 -10
- package/views/partials/ui/tabs.hbs +8 -5
- package/views/templates/template.hbs +4 -3
- package/views/tokens/index.hbs +8 -2
- package/views/tokens/new.hbs +514 -243
- package/winconf.js +148 -48
- package/workers/api.js +198 -48
package/scripts/README.md
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
# Scripts
|
|
2
2
|
|
|
3
|
+
## build-icon.js
|
|
4
|
+
|
|
5
|
+
Regenerates `static/emailengine.ico` from `static/logo.png`. The result is committed, so run
|
|
6
|
+
this only when the logo artwork changes - a normal build does not need ImageMagick.
|
|
7
|
+
|
|
8
|
+
### Usage
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
brew install imagemagick
|
|
12
|
+
npm run build:icon
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
### What it does
|
|
16
|
+
|
|
17
|
+
Builds a 7-image icon (256, 128, 64, 48, 32, 24, 16), PNG-compressing the two largest members
|
|
18
|
+
and using uncompressed 32-bit DIBs for the rest.
|
|
19
|
+
|
|
20
|
+
### Notes
|
|
21
|
+
|
|
22
|
+
- Do not replace it with a plain `magick -define icon:auto-resize=...` call. ImageMagick writes
|
|
23
|
+
every member as an uncompressed BMP, and the resulting icon is large enough to break the
|
|
24
|
+
packaged Windows executable outright. The header comment in the script explains why.
|
|
25
|
+
- `winconf.js` prints the remaining `.rsrc` headroom on every build. That number is the budget
|
|
26
|
+
for any future icon or resource change.
|
|
27
|
+
|
|
3
28
|
## refresh-test-tokens.js
|
|
4
29
|
|
|
5
30
|
Helper script to refresh OAuth2 tokens for Gmail test accounts.
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
// Regenerates static/emailengine.ico, the icon winconf.js stamps into the Windows executable.
|
|
5
|
+
// Run it when the logo artwork changes; the result is committed, so a normal build needs
|
|
6
|
+
// neither this script nor ImageMagick.
|
|
7
|
+
//
|
|
8
|
+
// The members are assembled here rather than by a single `magick -define icon:auto-resize=...`
|
|
9
|
+
// call because ImageMagick writes every one of them as an uncompressed BMP, and a 256x256 BMP
|
|
10
|
+
// alone is 270KB. The resulting icon is large enough to break the packaged exe - see the comment
|
|
11
|
+
// on payloadOffset() in winconf.js - so the two biggest sizes are PNG-compressed instead, which
|
|
12
|
+
// keeps the whole file around 63KB.
|
|
13
|
+
|
|
14
|
+
const { load } = require('resedit/cjs');
|
|
15
|
+
const { execFileSync } = require('child_process');
|
|
16
|
+
const { mkdtempSync, readFileSync, writeFileSync, rmSync } = require('fs');
|
|
17
|
+
const { tmpdir } = require('os');
|
|
18
|
+
const { join, resolve } = require('path');
|
|
19
|
+
|
|
20
|
+
const SOURCE = resolve(__dirname, '../static/logo.png');
|
|
21
|
+
const TARGET = resolve(__dirname, '../static/emailengine.ico');
|
|
22
|
+
|
|
23
|
+
// Windows renders the icon at all of these: 16 in the Explorer list view and the title bar, 32
|
|
24
|
+
// and 48 in the larger views, 256 for the extra large one. PNG for the two biggest, an
|
|
25
|
+
// uncompressed 32-bit DIB for the rest, which is the convention Windows has read since Vista
|
|
26
|
+
const PNG_SIZES = [256, 128];
|
|
27
|
+
const BMP_SIZES = [64, 48, 32, 24, 16];
|
|
28
|
+
|
|
29
|
+
function magick(args) {
|
|
30
|
+
try {
|
|
31
|
+
execFileSync('magick', args, { stdio: ['ignore', 'ignore', 'pipe'] });
|
|
32
|
+
} catch (err) {
|
|
33
|
+
if (err.code === 'ENOENT') {
|
|
34
|
+
throw new Error('ImageMagick is required to rebuild the icon: brew install imagemagick', { cause: err });
|
|
35
|
+
}
|
|
36
|
+
throw new Error(`magick ${args.join(' ')} failed: ${String(err.stderr || err.message).trim()}`, { cause: err });
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
load()
|
|
41
|
+
.then(ResEdit => {
|
|
42
|
+
const workDir = mkdtempSync(join(tmpdir(), 'ee-icon-'));
|
|
43
|
+
|
|
44
|
+
try {
|
|
45
|
+
const icons = [];
|
|
46
|
+
|
|
47
|
+
for (let size of PNG_SIZES) {
|
|
48
|
+
const file = join(workDir, `png-${size}.png`);
|
|
49
|
+
magick([SOURCE, '-background', 'none', '-resize', `${size}x${size}`, '-strip', '-define', 'png:compression-level=9', file]);
|
|
50
|
+
// The dimensions have to be passed in: RawIconItem does not read them out of the
|
|
51
|
+
// PNG header, and without them the directory entry is written as 0x0 at 0bpp
|
|
52
|
+
icons.push({ data: ResEdit.Data.RawIconItem.from(readFileSync(file), size, size, 32) });
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// ImageMagick's own DIB members are well formed, so the small sizes are taken from an
|
|
56
|
+
// ico it builds rather than encoded here
|
|
57
|
+
const smallIco = join(workDir, 'small.ico');
|
|
58
|
+
magick([SOURCE, '-background', 'none', '-define', `icon:auto-resize=${BMP_SIZES.join(',')}`, smallIco]);
|
|
59
|
+
icons.push(...ResEdit.Data.IconFile.from(readFileSync(smallIco)).icons);
|
|
60
|
+
|
|
61
|
+
const iconFile = new ResEdit.Data.IconFile();
|
|
62
|
+
iconFile.icons = icons;
|
|
63
|
+
|
|
64
|
+
const ico = Buffer.from(iconFile.generate());
|
|
65
|
+
writeFileSync(TARGET, ico);
|
|
66
|
+
|
|
67
|
+
console.log(`Wrote ${TARGET}`);
|
|
68
|
+
console.log(` ${icons.length} images: ${icons.map(icon => `${icon.data.width}x${icon.data.height}`).join(', ')}`);
|
|
69
|
+
console.log(` ${ico.length} bytes`);
|
|
70
|
+
} finally {
|
|
71
|
+
rmSync(workDir, { recursive: true, force: true });
|
|
72
|
+
}
|
|
73
|
+
})
|
|
74
|
+
.catch(err => {
|
|
75
|
+
console.error('Error building the icon:', err);
|
|
76
|
+
process.exit(1);
|
|
77
|
+
});
|