imapkit 5.3.0 → 5.3.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/dist/browser/imapkit.js +17 -15
- package/dist/cjs/oauth/pages.js +12 -5
- package/dist/cjs/server.js +5 -1
- package/dist/esm/oauth/pages.js +12 -5
- package/dist/esm/server.js +5 -1
- package/package.json +1 -1
package/dist/cjs/oauth/pages.js
CHANGED
|
@@ -46,7 +46,8 @@ ul.scopes{list-style:none;padding:0;margin:0 0 12px;border:1px solid var(--line)
|
|
|
46
46
|
ul.scopes li{display:flex;gap:10px;padding:8px 12px;border-top:1px solid var(--line);align-items:baseline}
|
|
47
47
|
ul.scopes li:first-child{border-top:0}
|
|
48
48
|
.ck{color:var(--ok);font-weight:700}
|
|
49
|
-
.
|
|
49
|
+
ul.scopes li>span:nth-child(2){flex:1;min-width:0}
|
|
50
|
+
.raw{margin-left:auto;font-family:ui-monospace,Menlo,monospace;font-size:11.5px;color:var(--muted);text-align:right;white-space:nowrap}
|
|
50
51
|
.redir{font-size:13px;color:var(--muted);margin:0 0 16px;overflow-wrap:anywhere}
|
|
51
52
|
.btns{display:flex;flex-direction:row-reverse;gap:10px;margin:0 0 12px}
|
|
52
53
|
button{flex:1;font:inherit;font-weight:600;padding:10px 14px;border-radius:8px;border:1px solid var(--line);background:var(--card);color:var(--text);cursor:pointer;text-align:center;text-decoration:none}
|
|
@@ -70,6 +71,7 @@ table{width:100%;border-collapse:collapse;font-size:13.5px;margin:0 0 6px}
|
|
|
70
71
|
th,td{text-align:left;padding:7px 8px;border-bottom:1px solid var(--line);vertical-align:top}
|
|
71
72
|
th{font-size:12px;color:var(--muted);text-transform:uppercase;letter-spacing:.04em}
|
|
72
73
|
footer{border-top:1px solid var(--line);padding:12px 26px;font-size:12.5px;color:var(--muted)}
|
|
74
|
+
footer a{color:var(--accent)}
|
|
73
75
|
@media (max-width:480px){body{padding:0}main{border-radius:0;border-left:0;border-right:0}.body{padding:20px 16px}footer{padding:12px 16px}}
|
|
74
76
|
`;
|
|
75
77
|
const AVATAR_COLORS = ['#7c5cf6', '#0e9f6e', '#d9480f', '#1c7ed6', '#c2255c', '#5c7cfa', '#2b8a3e'];
|
|
@@ -146,7 +148,8 @@ function consentPage(data) {
|
|
|
146
148
|
checks.push({ level: 'note', text: 'ignored parameters: ' + request.ignored.join(', ') });
|
|
147
149
|
}
|
|
148
150
|
const passed = checks.filter(check => check.level === 'ok').length;
|
|
149
|
-
const
|
|
151
|
+
const warnings = checks.filter(check => check.level === 'warn').length;
|
|
152
|
+
const notes = checks.length - passed - warnings;
|
|
150
153
|
const hasWarning = checks.some(check => check.level === 'warn');
|
|
151
154
|
let target = request.redirectUri;
|
|
152
155
|
let loopback = false;
|
|
@@ -228,7 +231,8 @@ function consentPage(data) {
|
|
|
228
231
|
'><summary>Request details (' +
|
|
229
232
|
passed +
|
|
230
233
|
' passed' +
|
|
231
|
-
(
|
|
234
|
+
(warnings ? ', ' + warnings + (warnings === 1 ? ' warning' : ' warnings') : '') +
|
|
235
|
+
(notes ? ', ' + notes + (notes === 1 ? ' note' : ' notes') : '') +
|
|
232
236
|
')</summary><ul class="checks">' +
|
|
233
237
|
checks.map(check => '<li>' + checkTag(check) + '<span>' + escapeHtml(check.text) + '</span></li>').join('') +
|
|
234
238
|
'</ul><p class="kv">' +
|
|
@@ -243,7 +247,7 @@ function consentPage(data) {
|
|
|
243
247
|
'<button type="submit" name="action" value="outcome" formnovalidate>Send</button></div></details>' +
|
|
244
248
|
'</form>';
|
|
245
249
|
return layout('Sign in to ' + client.name, body, {
|
|
246
|
-
footer: '
|
|
250
|
+
footer: 'Shown because the sign-in policy is prompt (' + escapeHtml(request.source) + '). This request stays open for 10 minutes.'
|
|
247
251
|
});
|
|
248
252
|
}
|
|
249
253
|
/**
|
|
@@ -306,5 +310,8 @@ function indexPage(data) {
|
|
|
306
310
|
'</p><h2>Endpoints</h2><p class="small">' +
|
|
307
311
|
endpoints.map(path => '<code>' + escapeHtml(path) + '</code>').join(' ') +
|
|
308
312
|
'</p>';
|
|
309
|
-
return layout('OAuth provider', body, {
|
|
313
|
+
return layout('OAuth provider', body, {
|
|
314
|
+
wide: true,
|
|
315
|
+
footer: 'Documentation: <a href="https://imapkit.com/docs/guides/oauth" rel="noreferrer">imapkit.com/docs/guides/oauth</a>'
|
|
316
|
+
});
|
|
310
317
|
}
|
package/dist/cjs/server.js
CHANGED
|
@@ -819,7 +819,11 @@ class IMAPServer extends node_stream_1.Stream {
|
|
|
819
819
|
const levels = mailbox.path.split(storage.separator);
|
|
820
820
|
const folderName = levels.pop();
|
|
821
821
|
const parentKey = levels.join(storage.separator);
|
|
822
|
-
|
|
822
|
+
// A child of INBOX lives in INBOX's own folders, unless the personal namespace is "INBOX." itself, where its
|
|
823
|
+
// mailboxes are the namespace's
|
|
824
|
+
const inboxParent = parentKey.toUpperCase() === 'INBOX';
|
|
825
|
+
const holdsNamespace = namespace === this.referenceNamespace && this.inboxHoldsNamespace();
|
|
826
|
+
const parent = ((!inboxParent || !holdsNamespace) && this.folderCache[parentKey]) || storage;
|
|
823
827
|
if (mailbox.folders && Object.keys(mailbox.folders).length && !keepContents) {
|
|
824
828
|
// Sessions that have the mailbox selected keep the old object, a new SELECT finds the
|
|
825
829
|
// placeholder. The placeholder only keeps the children. Plugin data (MAILBOXID, special-use, metadata, ACL,
|
package/dist/esm/oauth/pages.js
CHANGED
|
@@ -41,7 +41,8 @@ ul.scopes{list-style:none;padding:0;margin:0 0 12px;border:1px solid var(--line)
|
|
|
41
41
|
ul.scopes li{display:flex;gap:10px;padding:8px 12px;border-top:1px solid var(--line);align-items:baseline}
|
|
42
42
|
ul.scopes li:first-child{border-top:0}
|
|
43
43
|
.ck{color:var(--ok);font-weight:700}
|
|
44
|
-
.
|
|
44
|
+
ul.scopes li>span:nth-child(2){flex:1;min-width:0}
|
|
45
|
+
.raw{margin-left:auto;font-family:ui-monospace,Menlo,monospace;font-size:11.5px;color:var(--muted);text-align:right;white-space:nowrap}
|
|
45
46
|
.redir{font-size:13px;color:var(--muted);margin:0 0 16px;overflow-wrap:anywhere}
|
|
46
47
|
.btns{display:flex;flex-direction:row-reverse;gap:10px;margin:0 0 12px}
|
|
47
48
|
button{flex:1;font:inherit;font-weight:600;padding:10px 14px;border-radius:8px;border:1px solid var(--line);background:var(--card);color:var(--text);cursor:pointer;text-align:center;text-decoration:none}
|
|
@@ -65,6 +66,7 @@ table{width:100%;border-collapse:collapse;font-size:13.5px;margin:0 0 6px}
|
|
|
65
66
|
th,td{text-align:left;padding:7px 8px;border-bottom:1px solid var(--line);vertical-align:top}
|
|
66
67
|
th{font-size:12px;color:var(--muted);text-transform:uppercase;letter-spacing:.04em}
|
|
67
68
|
footer{border-top:1px solid var(--line);padding:12px 26px;font-size:12.5px;color:var(--muted)}
|
|
69
|
+
footer a{color:var(--accent)}
|
|
68
70
|
@media (max-width:480px){body{padding:0}main{border-radius:0;border-left:0;border-right:0}.body{padding:20px 16px}footer{padding:12px 16px}}
|
|
69
71
|
`;
|
|
70
72
|
const AVATAR_COLORS = ['#7c5cf6', '#0e9f6e', '#d9480f', '#1c7ed6', '#c2255c', '#5c7cfa', '#2b8a3e'];
|
|
@@ -141,7 +143,8 @@ export function consentPage(data) {
|
|
|
141
143
|
checks.push({ level: 'note', text: 'ignored parameters: ' + request.ignored.join(', ') });
|
|
142
144
|
}
|
|
143
145
|
const passed = checks.filter(check => check.level === 'ok').length;
|
|
144
|
-
const
|
|
146
|
+
const warnings = checks.filter(check => check.level === 'warn').length;
|
|
147
|
+
const notes = checks.length - passed - warnings;
|
|
145
148
|
const hasWarning = checks.some(check => check.level === 'warn');
|
|
146
149
|
let target = request.redirectUri;
|
|
147
150
|
let loopback = false;
|
|
@@ -223,7 +226,8 @@ export function consentPage(data) {
|
|
|
223
226
|
'><summary>Request details (' +
|
|
224
227
|
passed +
|
|
225
228
|
' passed' +
|
|
226
|
-
(
|
|
229
|
+
(warnings ? ', ' + warnings + (warnings === 1 ? ' warning' : ' warnings') : '') +
|
|
230
|
+
(notes ? ', ' + notes + (notes === 1 ? ' note' : ' notes') : '') +
|
|
227
231
|
')</summary><ul class="checks">' +
|
|
228
232
|
checks.map(check => '<li>' + checkTag(check) + '<span>' + escapeHtml(check.text) + '</span></li>').join('') +
|
|
229
233
|
'</ul><p class="kv">' +
|
|
@@ -238,7 +242,7 @@ export function consentPage(data) {
|
|
|
238
242
|
'<button type="submit" name="action" value="outcome" formnovalidate>Send</button></div></details>' +
|
|
239
243
|
'</form>';
|
|
240
244
|
return layout('Sign in to ' + client.name, body, {
|
|
241
|
-
footer: '
|
|
245
|
+
footer: 'Shown because the sign-in policy is prompt (' + escapeHtml(request.source) + '). This request stays open for 10 minutes.'
|
|
242
246
|
});
|
|
243
247
|
}
|
|
244
248
|
/**
|
|
@@ -301,5 +305,8 @@ export function indexPage(data) {
|
|
|
301
305
|
'</p><h2>Endpoints</h2><p class="small">' +
|
|
302
306
|
endpoints.map(path => '<code>' + escapeHtml(path) + '</code>').join(' ') +
|
|
303
307
|
'</p>';
|
|
304
|
-
return layout('OAuth provider', body, {
|
|
308
|
+
return layout('OAuth provider', body, {
|
|
309
|
+
wide: true,
|
|
310
|
+
footer: 'Documentation: <a href="https://imapkit.com/docs/guides/oauth" rel="noreferrer">imapkit.com/docs/guides/oauth</a>'
|
|
311
|
+
});
|
|
305
312
|
}
|
package/dist/esm/server.js
CHANGED
|
@@ -778,7 +778,11 @@ class IMAPServer extends Stream {
|
|
|
778
778
|
const levels = mailbox.path.split(storage.separator);
|
|
779
779
|
const folderName = levels.pop();
|
|
780
780
|
const parentKey = levels.join(storage.separator);
|
|
781
|
-
|
|
781
|
+
// A child of INBOX lives in INBOX's own folders, unless the personal namespace is "INBOX." itself, where its
|
|
782
|
+
// mailboxes are the namespace's
|
|
783
|
+
const inboxParent = parentKey.toUpperCase() === 'INBOX';
|
|
784
|
+
const holdsNamespace = namespace === this.referenceNamespace && this.inboxHoldsNamespace();
|
|
785
|
+
const parent = ((!inboxParent || !holdsNamespace) && this.folderCache[parentKey]) || storage;
|
|
782
786
|
if (mailbox.folders && Object.keys(mailbox.folders).length && !keepContents) {
|
|
783
787
|
// Sessions that have the mailbox selected keep the old object, a new SELECT finds the
|
|
784
788
|
// placeholder. The placeholder only keeps the children. Plugin data (MAILBOXID, special-use, metadata, ACL,
|