@fluxmail/core 0.6.1 → 0.8.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/LICENSE.md CHANGED
@@ -1,111 +1,93 @@
1
- # Fluxmail Proprietary License Agreement
1
+ Elastic License 2.0
2
2
 
3
- Version 1.0, July 12, 2026
3
+ URL: https://www.elastic.co/licensing/elastic-license
4
4
 
5
- Copyright © 2026 Fluxmail. All rights reserved.
5
+ ## Acceptance
6
6
 
7
- This Fluxmail Proprietary License Agreement (the “Agreement”) is between Fluxmail and the individual or entity accepting this Agreement (“you”). If you use the Software for an organization, you represent that you have authority to bind that organization, and “you” includes that organization.
7
+ By using the software, you agree to all of the terms and conditions below.
8
8
 
9
- By downloading, copying, installing, modifying, or using the Software, you accept this Agreement. If you do not accept it, do not use the Software.
9
+ ## Copyright License
10
10
 
11
- ## 1. Definitions
11
+ The licensor grants you a non-exclusive, royalty-free, worldwide,
12
+ non-sublicensable, non-transferable license to use, copy, distribute, make
13
+ available, and prepare derivative works of the software, in each case subject to
14
+ the limitations and conditions below.
12
15
 
13
- “Software” means the Fluxmail software distributed with this Agreement, including its source code, object code, documentation, and any Fluxmail updates or modifications provided under this Agreement. Software does not include Third-Party Software.
16
+ ## Limitations
14
17
 
15
- “License Entitlement” means the users, mailboxes, instances, features, usage limits, term, and other rights authorized by a license key, built-in plan, order form, subscription record, or other written authorization issued by Fluxmail.
18
+ You may not provide the software to third parties as a hosted or managed
19
+ service, where the service provides users with access to any substantial set of
20
+ the features or functionality of the software.
16
21
 
17
- “Production Use” means using the Software for live personal, business, organizational, customer-facing, or revenue-generating operations. It includes processing live mailbox data or making the Software available to users other than solely for development, testing, security review, or evaluation.
22
+ You may not move, change, disable, or circumvent the license key functionality
23
+ in the software, and you may not remove or obscure any functionality in the
24
+ software that is protected by the license key.
18
25
 
19
- “Non-Production Use” means private development, testing, security review, or evaluation that does not process live operations or provide a service to end users.
26
+ You may not alter, remove, or obscure any licensing, copyright, or other notices
27
+ of the licensor in the software. Any use of the licensor’s trademarks is subject
28
+ to applicable law.
20
29
 
21
- “Third-Party Software” means software identified as third-party or open-source software, including dependencies distributed with or used by the Software.
30
+ ## Patents
22
31
 
23
- “Competing Product” means a product or service whose primary purpose is to provide third parties with a self-hosted or hosted email integration server, email-agent interface, or email API offering substantially similar core functionality to the Software. It does not include software developed and used solely for your own internal operations.
32
+ The licensor grants you a license, under any patent claims the licensor can
33
+ license, or becomes able to license, to make, have made, use, sell, offer for
34
+ sale, import and have imported the software, in each case subject to the
35
+ limitations and conditions in this license. This license does not cover any
36
+ patent claims that you cause to be infringed by modifications or additions to
37
+ the software. If you or your company make any written claim that the software
38
+ infringes or contributes to infringement of any patent, your patent license for
39
+ the software granted under these terms ends immediately. If your company makes
40
+ such a claim, your patent license ends immediately for work on behalf of your
41
+ company.
24
42
 
25
- ## 2. License grant
43
+ ## Notices
26
44
 
27
- Subject to this Agreement, Fluxmail grants you a limited, worldwide, non-exclusive, non-transferable, non-sublicensable license to:
45
+ You must ensure that anyone who gets a copy of any part of the software from you
46
+ also gets a copy of these terms.
28
47
 
29
- 1. view, audit, download, copy, compile, and run the Software for Non-Production Use;
30
- 2. make private modifications to the Software for your own use;
31
- 3. make reasonable backup and archival copies;
32
- 4. use GitHub’s standard public-repository features to view and fork the Software solely as needed to exercise the rights in items 1 through 3; and
33
- 5. use the Software in Production Use only within a valid License Entitlement.
48
+ If you modify the software, you must include in any modified copies of the
49
+ software prominent notices stating that you have modified the software.
34
50
 
35
- A License Entitlement may be offered without charge. A zero-dollar or built-in entitlement remains subject to this Agreement and to its stated limits.
51
+ ## No Other Rights
36
52
 
37
- All rights not expressly granted in this Agreement are reserved by Fluxmail.
53
+ These terms do not imply any licenses other than those expressly granted in
54
+ these terms.
38
55
 
39
- ## 3. License Entitlements and technical controls
56
+ ## Termination
40
57
 
41
- Your Production Use must stay within your License Entitlement. A License Entitlement applies only to the person, organization, and instances it covers. You may not share a license key outside that person or organization or use it on more instances than authorized.
58
+ If you use the software in violation of these terms, such use is not licensed,
59
+ and your licenses will automatically terminate. If the licensor provides you
60
+ with a notice of your violation, and you cease all violation of this license no
61
+ later than 30 days after you receive that notice, your licenses will be
62
+ reinstated retroactively. However, if you violate these terms after such
63
+ reinstatement, any additional violation of these terms will cause your licenses
64
+ to terminate automatically and permanently.
42
65
 
43
- You may not modify, remove, disable, circumvent, bypass, or interfere with any license-key validation, entitlement enforcement, usage metering, plan limitation, or other technical restriction in the Software. You may not enable or expose functionality protected by any of those controls except as authorized by your License Entitlement.
66
+ ## No Liability
44
67
 
45
- Modified versions and derivative works containing any part of the Software remain subject to this Agreement. Production Use of them requires a valid License Entitlement covering that use.
68
+ *As far as the law allows, the software comes as is, without any warranty or
69
+ condition, and the licensor will not be liable to you for any damages arising
70
+ out of these terms or the use or nature of the software, under any kind of
71
+ legal claim.*
46
72
 
47
- ## 4. Restrictions
73
+ ## Definitions
48
74
 
49
- Unless Fluxmail gives you separate written permission, you may not:
75
+ The **licensor** is the entity offering these terms, and the **software** is the
76
+ software the licensor makes available under these terms, including any portion
77
+ of it.
50
78
 
51
- 1. distribute, publish, sell, sublicense, rent, lease, or otherwise provide the Software or a modified version to a third party;
52
- 2. publish or maintain a fork for distributing the Software, providing production-ready builds to others, avoiding License Entitlements, or operating a Competing Product;
53
- 3. offer the Software or its substantial features to third parties as a hosted, managed, time-sharing, or service-bureau product;
54
- 4. white-label the Software or represent it as your own product;
55
- 5. embed or incorporate the Software into a product or service distributed or provided to third parties;
56
- 6. use the Software or its source code to develop, train, support, or operate a Competing Product;
57
- 7. exceed or help another person exceed a License Entitlement;
58
- 8. remove, alter, or obscure copyright, license, attribution, or trademark notices; or
59
- 9. use Fluxmail names, logos, or trademarks except as allowed by applicable law or separate written permission.
79
+ **you** refers to the individual or entity agreeing to these terms.
60
80
 
61
- These restrictions do not limit rights that applicable law does not allow Fluxmail to restrict.
81
+ **your company** is any legal entity, sole proprietorship, or other kind of
82
+ organization that you work for, plus all organizations that have control over,
83
+ are under the control of, or are under common control with that
84
+ organization. **control** means ownership of substantially all the assets of an
85
+ entity, or the power to direct its management and policies by vote, contract, or
86
+ otherwise. Control can be direct or indirect.
62
87
 
63
- ## 5. Ownership and modifications
88
+ **your licenses** are all the licenses granted to you for the software under
89
+ these terms.
64
90
 
65
- Fluxmail and its licensors retain all right, title, and interest in the Software, including all intellectual property rights. This Agreement does not transfer ownership of the Software to you.
91
+ **use** means anything you do with the software requiring one of your licenses.
66
92
 
67
- As between you and Fluxmail, you retain ownership of code you write independently. Your ownership of a modification does not give you rights in the underlying Software or permission to distribute or commercially exploit a combined or derivative work.
68
-
69
- ## 6. Third-Party Software
70
-
71
- Third-Party Software is licensed under its own terms, not this Agreement. If a third-party license conflicts with this Agreement for that Third-Party Software, the third-party license controls for that component. You are responsible for complying with applicable third-party terms.
72
-
73
- ## 7. Orders, subscriptions, and other agreements
74
-
75
- Pricing, payment, renewal, cancellation, support, and service terms may be stated in an order form, subscription terms, or another agreement with Fluxmail. If that agreement conflicts with this Agreement, it controls for the specific subject and parties it covers.
76
-
77
- Each release of the Software is governed by the license version distributed with that release. Fluxmail may distribute later releases under updated terms, but updated terms do not change the license for a release you already received unless you agree otherwise.
78
-
79
- ## 8. Term and termination
80
-
81
- This Agreement continues until terminated. It terminates automatically if you materially breach it and do not cure the breach within 30 days after receiving notice from Fluxmail. A breach involving circumvention of technical controls, unauthorized distribution, or misuse of a license key may be terminated immediately if it cannot reasonably be cured.
82
-
83
- When this Agreement terminates, you must stop using and delete all copies of the Software in your possession or control, except copies you must retain by law. Sections 4 through 12 survive termination. Termination does not affect rights or remedies that accrued before termination.
84
-
85
- Expiration, cancellation, or downgrade of a License Entitlement may reduce or end your authorized Production Use without terminating this Agreement. Any grace period or restricted mode is determined by the applicable License Entitlement and the Software release you use.
86
-
87
- ## 9. Disclaimer of warranties
88
-
89
- TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED “AS IS” AND “AS AVAILABLE,” WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND. FLUXMAIL DISCLAIMS ALL EXPRESS, IMPLIED, AND STATUTORY WARRANTIES, INCLUDING WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE, NON-INFRINGEMENT, AND THAT THE SOFTWARE WILL BE SECURE, UNINTERRUPTED, OR ERROR-FREE.
90
-
91
- ## 10. Limitation of liability
92
-
93
- TO THE MAXIMUM EXTENT PERMITTED BY LAW, FLUXMAIL WILL NOT BE LIABLE FOR ANY INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL, EXEMPLARY, OR PUNITIVE DAMAGES, OR FOR ANY LOSS OF DATA, REVENUE, PROFITS, GOODWILL, OR BUSINESS OPPORTUNITY, ARISING OUT OF OR RELATED TO THE SOFTWARE OR THIS AGREEMENT, EVEN IF FLUXMAIL WAS ADVISED THAT SUCH DAMAGES WERE POSSIBLE.
94
-
95
- TO THE MAXIMUM EXTENT PERMITTED BY LAW, FLUXMAIL’S TOTAL LIABILITY ARISING OUT OF OR RELATED TO THE SOFTWARE OR THIS AGREEMENT WILL NOT EXCEED THE GREATER OF (A) THE AMOUNT YOU PAID FLUXMAIL FOR THE SOFTWARE DURING THE 12 MONTHS BEFORE THE EVENT GIVING RISE TO THE CLAIM OR (B) US$100.
96
-
97
- Some jurisdictions do not allow certain warranty disclaimers or liability limitations. In those jurisdictions, these provisions apply only to the extent permitted by law.
98
-
99
- ## 11. Notices
100
-
101
- Fluxmail may give you notice under this Agreement by email to any address you provided in connection with a License Entitlement, order, subscription, support request, or other communication with Fluxmail. An email notice is deemed received on the first business day after it is sent unless Fluxmail receives a delivery-failure message. You are responsible for keeping your contact information current.
102
-
103
- ## 12. General terms
104
-
105
- You may not assign or transfer this Agreement or your License Entitlement without Fluxmail’s prior written consent. Fluxmail may assign this Agreement in connection with a merger, acquisition, reorganization, or sale of substantially all related assets.
106
-
107
- If any provision of this Agreement is unenforceable, it will be enforced to the maximum extent permitted, and the remaining provisions will remain in effect. A waiver must be in writing and applies only to the specific instance stated. Headings are for convenience and do not affect interpretation.
108
-
109
- This Agreement is governed by the laws of the State of New Jersey, excluding its conflict-of-law rules. Any dispute arising out of or relating to the Software or this Agreement must be brought exclusively in a state or federal court of competent jurisdiction located in New Jersey. You and Fluxmail consent to the personal jurisdiction of those courts. This paragraph does not limit rights that applicable law does not allow a party to waive.
110
-
111
- This Agreement, together with any applicable License Entitlement and agreement described in Section 7, is the entire agreement between you and Fluxmail about the Software and replaces prior discussions or understandings about its licensing.
93
+ **trademark** means trademarks, service marks, and similar rights.
package/dist/index.d.ts CHANGED
@@ -3,4 +3,5 @@ export * from './errors.js';
3
3
  export * from './provider.js';
4
4
  export * from './reply.js';
5
5
  export * from './addresses.js';
6
+ export * from './search.js';
6
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC"}
package/dist/index.js CHANGED
@@ -3,4 +3,5 @@ export * from './errors.js';
3
3
  export * from './provider.js';
4
4
  export * from './reply.js';
5
5
  export * from './addresses.js';
6
+ export * from './search.js';
6
7
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC"}
@@ -0,0 +1,53 @@
1
+ import type { EmailQuery, PortableEmailQuery, PortableFolderRole, SearchCapabilities, SearchDiagnostic, SearchFilter } from './types.js';
2
+ declare const normalizedPortableEmailQuery: unique symbol;
3
+ export type NormalizedPortableEmailQuery = PortableEmailQuery & {
4
+ readonly [normalizedPortableEmailQuery]: true;
5
+ };
6
+ export type NormalizeEmailQueryResult<T> = {
7
+ success: true;
8
+ query: T;
9
+ } | {
10
+ success: false;
11
+ diagnostics: SearchDiagnostic[];
12
+ };
13
+ export interface SearchToken {
14
+ kind: 'text' | 'filter' | 'invalid';
15
+ raw: string;
16
+ value: string;
17
+ start: number;
18
+ end: number;
19
+ field?: SearchFilter;
20
+ }
21
+ export type ParseEmailSearchResult = {
22
+ valid: true;
23
+ query: NormalizedPortableEmailQuery;
24
+ tokens: SearchToken[];
25
+ diagnostics: SearchDiagnostic[];
26
+ } | {
27
+ valid: false;
28
+ query: PortableEmailQuery;
29
+ tokens: SearchToken[];
30
+ diagnostics: SearchDiagnostic[];
31
+ };
32
+ export type SearchRequirement = {
33
+ filter: Exclude<SearchFilter, 'folder'>;
34
+ } | {
35
+ filter: 'folder';
36
+ role: PortableFolderRole;
37
+ };
38
+ export interface PortableEmailQuerySupport {
39
+ supported: boolean;
40
+ unsupported: SearchRequirement[];
41
+ unknown: SearchRequirement[];
42
+ }
43
+ export declare function isPortableFolderRole(value: string): value is PortableFolderRole;
44
+ export declare function normalizeEmailQuery(query: EmailQuery): NormalizeEmailQueryResult<EmailQuery>;
45
+ export declare function normalizePortableEmailQuery(query: PortableEmailQuery): NormalizeEmailQueryResult<NormalizedPortableEmailQuery>;
46
+ export declare function mergeEmailQueries(parsed: PortableEmailQuery, structured: EmailQuery): NormalizeEmailQueryResult<EmailQuery>;
47
+ export declare function parseEmailSearch(input: string): ParseEmailSearchResult;
48
+ export declare function formatEmailSearch(query: NormalizedPortableEmailQuery): string;
49
+ export declare function requiredSearchFilters(query: PortableEmailQuery): SearchRequirement[];
50
+ export declare function supportsPortableEmailQuery(capabilities: SearchCapabilities, query: PortableEmailQuery): PortableEmailQuerySupport;
51
+ export declare function intersectSearchCapabilities(capabilities: readonly SearchCapabilities[]): SearchCapabilities;
52
+ export {};
53
+ //# sourceMappingURL=search.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../src/search.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,kBAAkB,EAClB,kBAAkB,EAElB,kBAAkB,EAClB,gBAAgB,EAChB,YAAY,EACb,MAAM,YAAY,CAAC;AAEpB,OAAO,CAAC,MAAM,4BAA4B,EAAE,OAAO,MAAM,CAAC;AAE1D,MAAM,MAAM,4BAA4B,GAAG,kBAAkB,GAAG;IAC9D,QAAQ,CAAC,CAAC,4BAA4B,CAAC,EAAE,IAAI,CAAC;CAC/C,CAAC;AAEF,MAAM,MAAM,yBAAyB,CAAC,CAAC,IACnC;IAAE,OAAO,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,CAAC,CAAA;CAAE,GAC3B;IAAE,OAAO,EAAE,KAAK,CAAC;IAAC,WAAW,EAAE,gBAAgB,EAAE,CAAA;CAAE,CAAC;AAExD,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS,CAAC;IACpC,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE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gB,qBAAqB,CAAC,KAAK,EAAE,kBAAkB,GAAG,iBAAiB,EAAE,CAiBpF;AAED,wBAAgB,0BAA0B,CACxC,YAAY,EAAE,kBAAkB,EAChC,KAAK,EAAE,kBAAkB,GACxB,yBAAyB,CAiB3B;AAQD,wBAAgB,2BAA2B,CAAC,YAAY,EAAE,SAAS,kBAAkB,EAAE,GAAG,kBAAkB,CAwB3G"}
package/dist/search.js ADDED
@@ -0,0 +1,446 @@
1
+ const PORTABLE_FOLDER_ROLES = [
2
+ 'inbox',
3
+ 'sent',
4
+ 'drafts',
5
+ 'archive',
6
+ 'spam',
7
+ 'trash',
8
+ 'all',
9
+ ];
10
+ const PORTABLE_FOLDER_ROLE_SET = new Set(PORTABLE_FOLDER_ROLES);
11
+ const STRING_FIELDS = ['folder', 'text', 'from', 'to', 'subject', 'after', 'before', 'rawProviderQuery'];
12
+ const PORTABLE_STRING_FIELDS = ['text', 'from', 'to', 'subject', 'after', 'before'];
13
+ const DATE_FIELDS = ['after', 'before'];
14
+ const FIELD_OPERATORS = ['from', 'to', 'subject', 'in', 'after', 'before'];
15
+ const VALUE_OPERATORS = [
16
+ 'is:read',
17
+ 'is:unread',
18
+ 'is:starred',
19
+ 'is:unstarred',
20
+ 'has:attachment',
21
+ '-has:attachment',
22
+ ];
23
+ function diagnostic(code, severity, message, lexeme, suggestion) {
24
+ return {
25
+ code,
26
+ severity,
27
+ message,
28
+ ...(lexeme ? { start: lexeme.start, end: lexeme.end } : {}),
29
+ ...(suggestion ? { suggestion } : {}),
30
+ };
31
+ }
32
+ function validDate(value) {
33
+ if (!/^\d{4}-\d{2}-\d{2}$/.test(value))
34
+ return false;
35
+ const parsed = new Date(`${value}T00:00:00.000Z`);
36
+ return !Number.isNaN(parsed.valueOf()) && parsed.toISOString().slice(0, 10) === value;
37
+ }
38
+ export function isPortableFolderRole(value) {
39
+ return PORTABLE_FOLDER_ROLE_SET.has(value);
40
+ }
41
+ function normalizeString(value, collapseWhitespace = false) {
42
+ const trimmed = value.trim();
43
+ return collapseWhitespace ? trimmed.replace(/\s+/g, ' ') : trimmed;
44
+ }
45
+ function normalizeQuery(input, portable) {
46
+ const query = {};
47
+ const diagnostics = [];
48
+ for (const field of STRING_FIELDS) {
49
+ const value = input[field];
50
+ if (value === undefined)
51
+ continue;
52
+ if (typeof value !== 'string') {
53
+ diagnostics.push(diagnostic('invalid_type', 'error', `${field} must be a string.`));
54
+ continue;
55
+ }
56
+ const normalized = normalizeString(value, field === 'text');
57
+ if (!normalized) {
58
+ diagnostics.push(diagnostic('empty_value', 'error', `${field} cannot be empty.`));
59
+ continue;
60
+ }
61
+ query[field] = normalized;
62
+ }
63
+ for (const field of ['read', 'starred', 'hasAttachment']) {
64
+ const value = input[field];
65
+ if (value === undefined)
66
+ continue;
67
+ if (typeof value !== 'boolean') {
68
+ diagnostics.push(diagnostic('invalid_type', 'error', `${field} must be a boolean.`));
69
+ continue;
70
+ }
71
+ query[field] = value;
72
+ }
73
+ if (portable && query.folder !== undefined && !PORTABLE_FOLDER_ROLE_SET.has(query.folder)) {
74
+ diagnostics.push(diagnostic('unsupported_folder', 'error', `in must be one of: ${PORTABLE_FOLDER_ROLES.join(', ')}.`));
75
+ }
76
+ if (portable && query.rawProviderQuery !== undefined) {
77
+ diagnostics.push(diagnostic('unsupported_native_query', 'error', 'rawProviderQuery is not available in portable queries.'));
78
+ }
79
+ if (query.text !== undefined && query.rawProviderQuery !== undefined) {
80
+ diagnostics.push(diagnostic('conflicting_query', 'error', 'text cannot be combined with rawProviderQuery.'));
81
+ }
82
+ for (const field of DATE_FIELDS) {
83
+ const value = query[field];
84
+ if (typeof value === 'string' && !validDate(value)) {
85
+ diagnostics.push(diagnostic('invalid_date', 'error', `${field} must use YYYY-MM-DD.`));
86
+ }
87
+ }
88
+ if (typeof query.after === 'string' &&
89
+ typeof query.before === 'string' &&
90
+ validDate(query.after) &&
91
+ validDate(query.before) &&
92
+ query.after >= query.before) {
93
+ diagnostics.push(diagnostic('invalid_date_range', 'error', 'after must be earlier than before.'));
94
+ }
95
+ if (diagnostics.length)
96
+ return { success: false, diagnostics };
97
+ return { success: true, query: query };
98
+ }
99
+ export function normalizeEmailQuery(query) {
100
+ return normalizeQuery(query, false);
101
+ }
102
+ export function normalizePortableEmailQuery(query) {
103
+ return normalizeQuery(query, true);
104
+ }
105
+ export function mergeEmailQueries(parsed, structured) {
106
+ const diagnostics = [];
107
+ for (const field of [
108
+ 'folder',
109
+ 'text',
110
+ 'from',
111
+ 'to',
112
+ 'subject',
113
+ 'read',
114
+ 'starred',
115
+ 'hasAttachment',
116
+ 'after',
117
+ 'before',
118
+ ]) {
119
+ if (parsed[field] !== undefined && structured[field] !== undefined) {
120
+ diagnostics.push(diagnostic('duplicate_filter', 'error', `${field} is set by both the typed query and a structured filter.`));
121
+ }
122
+ }
123
+ if (diagnostics.length)
124
+ return { success: false, diagnostics };
125
+ return normalizeEmailQuery({ ...parsed, ...structured });
126
+ }
127
+ function lex(input) {
128
+ const lexemes = [];
129
+ let index = 0;
130
+ while (index < input.length) {
131
+ while (index < input.length && /\s/.test(input[index]))
132
+ index += 1;
133
+ if (index >= input.length)
134
+ break;
135
+ const start = index;
136
+ let value = '';
137
+ let quoted = false;
138
+ let inQuote = false;
139
+ let malformed = false;
140
+ while (index < input.length) {
141
+ const character = input[index];
142
+ if (!inQuote && /\s/.test(character))
143
+ break;
144
+ if (character === '"') {
145
+ quoted = true;
146
+ inQuote = !inQuote;
147
+ index += 1;
148
+ continue;
149
+ }
150
+ if (character === '\\' && inQuote) {
151
+ const escaped = input[index + 1];
152
+ if (escaped === '"' || escaped === '\\') {
153
+ value += escaped;
154
+ index += 2;
155
+ continue;
156
+ }
157
+ }
158
+ value += character;
159
+ index += 1;
160
+ }
161
+ if (inQuote)
162
+ malformed = true;
163
+ lexemes.push({ raw: input.slice(start, index), value, start, end: index, quoted, malformed });
164
+ }
165
+ return lexemes;
166
+ }
167
+ function damerauLevenshtein(left, right) {
168
+ const rows = left.length + 1;
169
+ const columns = right.length + 1;
170
+ const matrix = Array.from({ length: rows }, () => Array(columns).fill(0));
171
+ for (let row = 0; row < rows; row += 1)
172
+ matrix[row][0] = row;
173
+ for (let column = 0; column < columns; column += 1)
174
+ matrix[0][column] = column;
175
+ for (let row = 1; row < rows; row += 1) {
176
+ for (let column = 1; column < columns; column += 1) {
177
+ const cost = left[row - 1] === right[column - 1] ? 0 : 1;
178
+ matrix[row][column] = Math.min(matrix[row - 1][column] + 1, matrix[row][column - 1] + 1, matrix[row - 1][column - 1] + cost);
179
+ if (row > 1 && column > 1 && left[row - 1] === right[column - 2] && left[row - 2] === right[column - 1]) {
180
+ matrix[row][column] = Math.min(matrix[row][column], matrix[row - 2][column - 2] + cost);
181
+ }
182
+ }
183
+ }
184
+ return matrix[left.length][right.length];
185
+ }
186
+ function typoSuggestion(value) {
187
+ const normalized = value.toLowerCase();
188
+ const valueOperator = VALUE_OPERATORS.find((candidate) => damerauLevenshtein(normalized, candidate) === 1);
189
+ if (valueOperator)
190
+ return valueOperator;
191
+ const separator = normalized.indexOf(':');
192
+ const field = separator > 0 ? normalized.slice(0, separator) : normalized;
193
+ return FIELD_OPERATORS.find((candidate) => damerauLevenshtein(field, candidate) === 1);
194
+ }
195
+ function literalToken(lexeme, tokens, text) {
196
+ tokens.push({
197
+ kind: 'text',
198
+ raw: lexeme.raw,
199
+ value: lexeme.value,
200
+ start: lexeme.start,
201
+ end: lexeme.end,
202
+ });
203
+ if (lexeme.value)
204
+ text.push(lexeme.value);
205
+ }
206
+ function invalidToken(lexeme, tokens) {
207
+ tokens.push({
208
+ kind: 'invalid',
209
+ raw: lexeme.raw,
210
+ value: lexeme.value,
211
+ start: lexeme.start,
212
+ end: lexeme.end,
213
+ });
214
+ }
215
+ export function parseEmailSearch(input) {
216
+ const query = {};
217
+ const tokens = [];
218
+ const diagnostics = [];
219
+ const text = [];
220
+ const assigned = new Map();
221
+ if (!input.trim()) {
222
+ const normalized = normalizePortableEmailQuery(query);
223
+ if (normalized.success) {
224
+ return {
225
+ valid: true,
226
+ query: normalized.query,
227
+ tokens,
228
+ diagnostics,
229
+ };
230
+ }
231
+ return {
232
+ valid: false,
233
+ query,
234
+ tokens,
235
+ diagnostics: normalized.diagnostics,
236
+ };
237
+ }
238
+ const assign = (field, value, lexeme) => {
239
+ if (assigned.has(field)) {
240
+ diagnostics.push(diagnostic('duplicate_filter', 'error', `${field} is specified more than once.`, lexeme));
241
+ invalidToken(lexeme, tokens);
242
+ return false;
243
+ }
244
+ assigned.set(field, lexeme);
245
+ Object.assign(query, { [field]: value });
246
+ tokens.push({
247
+ kind: 'filter',
248
+ raw: lexeme.raw,
249
+ value: String(value),
250
+ start: lexeme.start,
251
+ end: lexeme.end,
252
+ field: field === 'folder' ? 'folder' : field,
253
+ });
254
+ return true;
255
+ };
256
+ for (const lexeme of lex(input)) {
257
+ if (lexeme.malformed) {
258
+ diagnostics.push(diagnostic('malformed_quote', 'error', 'This quoted value is not closed.', lexeme));
259
+ invalidToken(lexeme, tokens);
260
+ continue;
261
+ }
262
+ const lower = lexeme.value.toLowerCase();
263
+ const quotedLiteral = lexeme.quoted && lexeme.raw.startsWith('"');
264
+ if (quotedLiteral) {
265
+ if (!lexeme.value) {
266
+ diagnostics.push(diagnostic('empty_value', 'error', 'Quoted search text cannot be empty.', lexeme));
267
+ invalidToken(lexeme, tokens);
268
+ continue;
269
+ }
270
+ literalToken(lexeme, tokens, text);
271
+ continue;
272
+ }
273
+ const booleanOperator = {
274
+ 'is:read': ['read', true],
275
+ 'is:unread': ['read', false],
276
+ 'is:starred': ['starred', true],
277
+ 'is:unstarred': ['starred', false],
278
+ 'has:attachment': ['hasAttachment', true],
279
+ '-has:attachment': ['hasAttachment', false],
280
+ };
281
+ const boolean = booleanOperator[lower];
282
+ if (boolean) {
283
+ assign(boolean[0], boolean[1], lexeme);
284
+ continue;
285
+ }
286
+ const separator = lexeme.value.indexOf(':');
287
+ const operator = separator > 0 ? lexeme.value.slice(0, separator).toLowerCase() : '';
288
+ const value = separator > 0 ? lexeme.value.slice(separator + 1) : '';
289
+ if (FIELD_OPERATORS.includes(operator)) {
290
+ if (!value) {
291
+ diagnostics.push(diagnostic('missing_value', 'error', `${operator}: requires a value.`, lexeme));
292
+ invalidToken(lexeme, tokens);
293
+ continue;
294
+ }
295
+ if (operator === 'in') {
296
+ if (!PORTABLE_FOLDER_ROLE_SET.has(value.toLowerCase())) {
297
+ diagnostics.push(diagnostic('unsupported_folder', 'error', `in: accepts ${PORTABLE_FOLDER_ROLES.join(', ')}. Use folder discovery for custom folders.`, lexeme));
298
+ invalidToken(lexeme, tokens);
299
+ continue;
300
+ }
301
+ assign('folder', value.toLowerCase(), lexeme);
302
+ continue;
303
+ }
304
+ const field = operator;
305
+ if ((field === 'after' || field === 'before') && !validDate(value)) {
306
+ diagnostics.push(diagnostic('invalid_date', 'error', `${field}: must use YYYY-MM-DD.`, lexeme));
307
+ invalidToken(lexeme, tokens);
308
+ continue;
309
+ }
310
+ assign(field, value, lexeme);
311
+ continue;
312
+ }
313
+ const isUrl = /^[a-z][a-z\d+.-]*:\/\//i.test(lexeme.value);
314
+ const isTime = /^\d{1,2}:\d{2}(?::\d{2})?(?:[ap]m)?$/i.test(lexeme.value);
315
+ if (!lexeme.quoted && !isUrl && !isTime) {
316
+ const suggestion = typoSuggestion(lower);
317
+ if (suggestion) {
318
+ diagnostics.push(diagnostic('possible_operator_typo', 'warning', `Did you mean ${suggestion}${separator > 0 && !suggestion.includes(':') ? ':' : ''}?`, lexeme, suggestion));
319
+ }
320
+ }
321
+ literalToken(lexeme, tokens, text);
322
+ }
323
+ if (text.length)
324
+ query.text = text.join(' ').replace(/\s+/g, ' ').trim();
325
+ if (query.after && query.before && query.after >= query.before) {
326
+ const afterToken = assigned.get('after');
327
+ const beforeToken = assigned.get('before');
328
+ const rejectedField = afterToken.start > beforeToken.start ? 'after' : 'before';
329
+ const rejectedToken = assigned.get(rejectedField);
330
+ delete query[rejectedField];
331
+ const token = tokens.find((candidate) => candidate.start === rejectedToken.start && candidate.end === rejectedToken.end);
332
+ if (token) {
333
+ token.kind = 'invalid';
334
+ delete token.field;
335
+ }
336
+ diagnostics.push(diagnostic('invalid_date_range', 'error', 'after must be earlier than before.', rejectedToken));
337
+ }
338
+ const normalized = normalizePortableEmailQuery(query);
339
+ if (!normalized.success)
340
+ diagnostics.push(...normalized.diagnostics);
341
+ const valid = !diagnostics.some((item) => item.severity === 'error') && normalized.success;
342
+ if (valid)
343
+ return { valid: true, query: normalized.query, tokens, diagnostics };
344
+ return { valid: false, query, tokens, diagnostics };
345
+ }
346
+ function quote(value) {
347
+ return `"${value.replaceAll('\\', '\\\\').replaceAll('"', '\\"')}"`;
348
+ }
349
+ export function formatEmailSearch(query) {
350
+ const normalized = normalizePortableEmailQuery(query);
351
+ if (!normalized.success || query.rawProviderQuery !== undefined) {
352
+ throw new TypeError('formatEmailSearch requires a normalized portable email query.');
353
+ }
354
+ const q = normalized.query;
355
+ const parts = [];
356
+ if (q.folder)
357
+ parts.push(`in:${q.folder}`);
358
+ if (q.from)
359
+ parts.push(`from:${quote(q.from)}`);
360
+ if (q.to)
361
+ parts.push(`to:${quote(q.to)}`);
362
+ if (q.subject)
363
+ parts.push(`subject:${quote(q.subject)}`);
364
+ if (q.read !== undefined)
365
+ parts.push(q.read ? 'is:read' : 'is:unread');
366
+ if (q.starred !== undefined)
367
+ parts.push(q.starred ? 'is:starred' : 'is:unstarred');
368
+ if (q.hasAttachment !== undefined)
369
+ parts.push(q.hasAttachment ? 'has:attachment' : '-has:attachment');
370
+ if (q.after)
371
+ parts.push(`after:${q.after}`);
372
+ if (q.before)
373
+ parts.push(`before:${q.before}`);
374
+ if (q.text)
375
+ parts.push(quote(q.text));
376
+ return parts.join(' ');
377
+ }
378
+ export function requiredSearchFilters(query) {
379
+ const requirements = [];
380
+ if (query.folder)
381
+ requirements.push({ filter: 'folder', role: query.folder });
382
+ for (const filter of [
383
+ 'text',
384
+ 'from',
385
+ 'to',
386
+ 'subject',
387
+ 'read',
388
+ 'starred',
389
+ 'hasAttachment',
390
+ 'after',
391
+ 'before',
392
+ ]) {
393
+ if (query[filter] !== undefined)
394
+ requirements.push({ filter });
395
+ }
396
+ return requirements;
397
+ }
398
+ export function supportsPortableEmailQuery(capabilities, query) {
399
+ const unsupported = [];
400
+ const unknown = [];
401
+ for (const requirement of requiredSearchFilters(query)) {
402
+ if (requirement.filter === 'folder') {
403
+ if (!capabilities.filters.includes('folder')) {
404
+ unsupported.push(requirement);
405
+ continue;
406
+ }
407
+ const availability = capabilities.folderRoles[requirement.role];
408
+ if (availability === 'unavailable')
409
+ unsupported.push(requirement);
410
+ if (availability === 'unknown')
411
+ unknown.push(requirement);
412
+ }
413
+ else if (!capabilities.filters.includes(requirement.filter)) {
414
+ unsupported.push(requirement);
415
+ }
416
+ }
417
+ return { supported: unsupported.length === 0 && unknown.length === 0, unsupported, unknown };
418
+ }
419
+ function intersectAvailability(values) {
420
+ if (values.includes('unavailable'))
421
+ return 'unavailable';
422
+ if (values.includes('unknown'))
423
+ return 'unknown';
424
+ return 'available';
425
+ }
426
+ export function intersectSearchCapabilities(capabilities) {
427
+ const filters = capabilities.length
428
+ ? capabilities[0].filters.filter((filter) => capabilities.slice(1).every((candidate) => candidate.filters.includes(filter)))
429
+ : [];
430
+ const folderRoles = Object.fromEntries(PORTABLE_FOLDER_ROLES.map((role) => [
431
+ role,
432
+ capabilities.length
433
+ ? intersectAvailability(capabilities.map((candidate) => candidate.folderRoles[role]))
434
+ : 'unknown',
435
+ ]));
436
+ const native = capabilities.map((candidate) => candidate.nativeQuery);
437
+ const syntax = native[0]?.syntax;
438
+ const nativeQuery = syntax && native.every((candidate) => candidate?.syntax === syntax)
439
+ ? {
440
+ syntax,
441
+ availability: intersectAvailability(native.map((candidate) => candidate.availability)),
442
+ }
443
+ : null;
444
+ return { filters, folderRoles, nativeQuery };
445
+ }
446
+ //# sourceMappingURL=search.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search.js","sourceRo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AAC,WAAW,CAAC,CAAC;IACtE,MAAM,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC;IACjC,MAAM,WAAW,GACf,MAAM,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC;QACjE,CAAC,CAAC;YACE,MAAM;YACN,YAAY,EAAE,qBAAqB,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAU,CAAC,YAAY,CAAC,CAAC;SACxF;QACH,CAAC,CAAC,IAAI,CAAC;IACX,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,CAAC;AAC/C,CAAC"}
package/dist/types.d.ts CHANGED
@@ -1,11 +1,25 @@
1
1
  export type Provider = 'gmail' | 'outlook' | 'imap';
2
+ export type PortableFolderRole = 'inbox' | 'sent' | 'drafts' | 'archive' | 'spam' | 'trash' | 'all';
3
+ export type SearchAvailability = 'available' | 'unavailable' | 'unknown';
4
+ export type SearchFilter = 'folder' | 'text' | 'from' | 'to' | 'subject' | 'read' | 'starred' | 'hasAttachment' | 'after' | 'before';
5
+ export interface SearchCapabilities {
6
+ filters: SearchFilter[];
7
+ folderRoles: Record<PortableFolderRole, SearchAvailability>;
8
+ nativeQuery: null | {
9
+ syntax: 'gmail' | 'outlook-kql';
10
+ availability: SearchAvailability;
11
+ unavailableReason?: string;
12
+ };
13
+ }
2
14
  export interface Capabilities {
3
15
  /** Gmail labels and Outlook categories. */
4
16
  labels: boolean;
5
17
  /** Gmail/Outlook thread server-side; IMAP threads are synthesized from References headers. */
6
18
  serverThreads: boolean;
7
- /** Gmail q= / Graph $search vs IMAP SEARCH. */
19
+ /** @deprecated Use search capabilities instead. */
8
20
  serverSearch: 'rich' | 'basic';
21
+ /** Search behavior available for this account. */
22
+ search: SearchCapabilities;
9
23
  /** Whether list results include snippets without fetching bodies. */
10
24
  snippets: boolean;
11
25
  }
@@ -139,27 +153,43 @@ export type ModifyAction = 'markRead' | 'markUnread' | 'star' | 'unstar' | 'arch
139
153
  export interface EmailQuery {
140
154
  /** Folder id or role. An omitted folder uses All Mail, excluding Spam and Trash. */
141
155
  folder?: string;
142
- /** Full-text search. */
156
+ /** Literal full-text search. Provider operators are escaped. */
143
157
  text?: string;
144
158
  from?: string;
145
159
  to?: string;
146
160
  subject?: string;
147
- unreadOnly?: boolean;
148
- starredOnly?: boolean;
161
+ read?: boolean;
162
+ starred?: boolean;
149
163
  hasAttachment?: boolean;
150
- /** ISO date (inclusive). */
164
+ /** YYYY-MM-DD received/internal date (inclusive, UTC). */
151
165
  after?: string;
152
- /** ISO date (exclusive). */
166
+ /** YYYY-MM-DD received/internal date (exclusive, UTC). */
153
167
  before?: string;
154
168
  /** Escape hatch: passed to the provider verbatim (e.g. Gmail q=). */
155
169
  rawProviderQuery?: string;
156
170
  }
171
+ export interface PortableEmailQuery extends Omit<EmailQuery, 'folder' | 'rawProviderQuery'> {
172
+ folder?: PortableFolderRole;
173
+ }
157
174
  export interface PageOpts {
158
175
  pageSize?: number;
159
176
  pageToken?: string;
160
177
  }
178
+ export type SearchDiagnosticSeverity = 'error' | 'warning';
179
+ export interface SearchDiagnostic {
180
+ code: string;
181
+ severity: SearchDiagnosticSeverity;
182
+ message: string;
183
+ start?: number;
184
+ end?: number;
185
+ suggestion?: string;
186
+ }
161
187
  export interface Page<T> {
162
188
  items: T[];
163
189
  nextPageToken?: string;
190
+ diagnostics?: SearchDiagnostic[];
191
+ incomplete?: true;
192
+ incompleteReason?: 'scan_limit' | 'provider_limit';
193
+ inspectedCandidates?: number;
164
194
  }
165
195
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;AAEpD,MAAM,WAAW,YAAY;I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AAC;IACb,QAAQ,EAAE,wBAAwB,CAAC;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,IAAI,CAAC,CAAC;IACrB,KAAK,EAAE,CAAC,EAAE,CAAC;IACX,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,gBAAgB,EAAE,CAAC;IACjC,UAAU,CAAC,EAAE,IAAI,CAAC;IAClB,gBAAgB,CAAC,EAAE,YAAY,GAAG,gBAAgB,CAAC;IACnD,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B"}
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@fluxmail/core",
3
- "version": "0.6.1",
3
+ "version": "0.8.0",
4
4
  "description": "Unified email types and provider interface for Fluxmail",
5
- "license": "SEE LICENSE IN LICENSE.md",
5
+ "license": "Elastic-2.0",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "git+https://github.com/churichard/fluxmail.git",