jmap-kit 0.0.0 → 1.0.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/LICENSE +21 -0
- package/README.md +138 -3
- package/dist/src/capabilities/blob/blob.d.ts +83 -0
- package/dist/src/capabilities/blob/blob.js +98 -0
- package/dist/src/capabilities/blob/blob.js.map +1 -0
- package/dist/src/capabilities/blob/types.d.ts +212 -0
- package/dist/src/capabilities/blob/types.js +16 -0
- package/dist/src/capabilities/blob/types.js.map +1 -0
- package/dist/src/capabilities/blob-capability.d.ts +195 -0
- package/dist/src/capabilities/blob-capability.js +277 -0
- package/dist/src/capabilities/blob-capability.js.map +1 -0
- package/dist/src/capabilities/core/core.d.ts +47 -0
- package/dist/src/capabilities/core/core.js +59 -0
- package/dist/src/capabilities/core/core.js.map +1 -0
- package/dist/src/capabilities/core/types.d.ts +13 -0
- package/dist/src/capabilities/core/types.js +2 -0
- package/dist/src/capabilities/core/types.js.map +1 -0
- package/dist/src/capabilities/core-capability.d.ts +307 -0
- package/dist/src/capabilities/core-capability.js +344 -0
- package/dist/src/capabilities/core-capability.js.map +1 -0
- package/dist/src/capabilities/email/email.d.ts +124 -0
- package/dist/src/capabilities/email/email.js +136 -0
- package/dist/src/capabilities/email/email.js.map +1 -0
- package/dist/src/capabilities/email/types.d.ts +776 -0
- package/dist/src/capabilities/email/types.js +2 -0
- package/dist/src/capabilities/email/types.js.map +1 -0
- package/dist/src/capabilities/email-capability.d.ts +266 -0
- package/dist/src/capabilities/email-capability.js +241 -0
- package/dist/src/capabilities/email-capability.js.map +1 -0
- package/dist/src/capabilities/emailsubmission/emailsubmission.d.ts +95 -0
- package/dist/src/capabilities/emailsubmission/emailsubmission.js +107 -0
- package/dist/src/capabilities/emailsubmission/emailsubmission.js.map +1 -0
- package/dist/src/capabilities/emailsubmission/types.d.ts +256 -0
- package/dist/src/capabilities/emailsubmission/types.js +2 -0
- package/dist/src/capabilities/emailsubmission/types.js.map +1 -0
- package/dist/src/capabilities/example/example.d.ts +80 -0
- package/dist/src/capabilities/example/example.js +91 -0
- package/dist/src/capabilities/example/example.js.map +1 -0
- package/dist/src/capabilities/example/types.d.ts +33 -0
- package/dist/src/capabilities/example/types.js +2 -0
- package/dist/src/capabilities/example/types.js.map +1 -0
- package/dist/src/capabilities/identity/identity.d.ts +71 -0
- package/dist/src/capabilities/identity/identity.js +83 -0
- package/dist/src/capabilities/identity/identity.js.map +1 -0
- package/dist/src/capabilities/identity/types.d.ts +110 -0
- package/dist/src/capabilities/identity/types.js +2 -0
- package/dist/src/capabilities/identity/types.js.map +1 -0
- package/dist/src/capabilities/mailbox/mailbox.d.ts +91 -0
- package/dist/src/capabilities/mailbox/mailbox.js +103 -0
- package/dist/src/capabilities/mailbox/mailbox.js.map +1 -0
- package/dist/src/capabilities/mailbox/types.d.ts +248 -0
- package/dist/src/capabilities/mailbox/types.js +2 -0
- package/dist/src/capabilities/mailbox/types.js.map +1 -0
- package/dist/src/capabilities/maskedemail/maskedemail.d.ts +60 -0
- package/dist/src/capabilities/maskedemail/maskedemail.js +72 -0
- package/dist/src/capabilities/maskedemail/maskedemail.js.map +1 -0
- package/dist/src/capabilities/maskedemail/types.d.ts +67 -0
- package/dist/src/capabilities/maskedemail/types.js +4 -0
- package/dist/src/capabilities/maskedemail/types.js.map +1 -0
- package/dist/src/capabilities/maskedemail-capability.d.ts +112 -0
- package/dist/src/capabilities/maskedemail-capability.js +166 -0
- package/dist/src/capabilities/maskedemail-capability.js.map +1 -0
- package/dist/src/capabilities/searchsnippet/searchsnippet.d.ts +51 -0
- package/dist/src/capabilities/searchsnippet/searchsnippet.js +63 -0
- package/dist/src/capabilities/searchsnippet/searchsnippet.js.map +1 -0
- package/dist/src/capabilities/searchsnippet/types.d.ts +88 -0
- package/dist/src/capabilities/searchsnippet/types.js +2 -0
- package/dist/src/capabilities/searchsnippet/types.js.map +1 -0
- package/dist/src/capabilities/submission-capability.d.ts +89 -0
- package/dist/src/capabilities/submission-capability.js +75 -0
- package/dist/src/capabilities/submission-capability.js.map +1 -0
- package/dist/src/capabilities/thread/thread.d.ts +58 -0
- package/dist/src/capabilities/thread/thread.js +70 -0
- package/dist/src/capabilities/thread/thread.js.map +1 -0
- package/dist/src/capabilities/thread/types.d.ts +43 -0
- package/dist/src/capabilities/thread/types.js +2 -0
- package/dist/src/capabilities/thread/types.js.map +1 -0
- package/dist/src/capabilities/utils/assert-invocation-datatype.d.ts +7 -0
- package/dist/src/capabilities/utils/assert-invocation-datatype.js +13 -0
- package/dist/src/capabilities/utils/assert-invocation-datatype.js.map +1 -0
- package/dist/src/capabilities/utils/assert-invocation-method.d.ts +7 -0
- package/dist/src/capabilities/utils/assert-invocation-method.js +13 -0
- package/dist/src/capabilities/utils/assert-invocation-method.js.map +1 -0
- package/dist/src/capabilities/utils/assert-invocation.d.ts +7 -0
- package/dist/src/capabilities/utils/assert-invocation.js +22 -0
- package/dist/src/capabilities/utils/assert-invocation.js.map +1 -0
- package/dist/src/capabilities/utils/assert-non-nullish.d.ts +1 -0
- package/dist/src/capabilities/utils/assert-non-nullish.js +6 -0
- package/dist/src/capabilities/utils/assert-non-nullish.js.map +1 -0
- package/dist/src/capabilities/utils/create-readonly-account-validator.d.ts +49 -0
- package/dist/src/capabilities/utils/create-readonly-account-validator.js +80 -0
- package/dist/src/capabilities/utils/create-readonly-account-validator.js.map +1 -0
- package/dist/src/capabilities/vacationresponse/types.d.ts +100 -0
- package/dist/src/capabilities/vacationresponse/types.js +2 -0
- package/dist/src/capabilities/vacationresponse/types.js.map +1 -0
- package/dist/src/capabilities/vacationresponse/vacationresponse.d.ts +61 -0
- package/dist/src/capabilities/vacationresponse/vacationresponse.js +73 -0
- package/dist/src/capabilities/vacationresponse/vacationresponse.js.map +1 -0
- package/dist/src/capabilities/vacationresponse-capability.d.ts +65 -0
- package/dist/src/capabilities/vacationresponse-capability.js +68 -0
- package/dist/src/capabilities/vacationresponse-capability.js.map +1 -0
- package/dist/src/capability-registry/capability-registry.d.ts +148 -0
- package/dist/src/capability-registry/capability-registry.js +360 -0
- package/dist/src/capability-registry/capability-registry.js.map +1 -0
- package/dist/src/capability-registry/types.d.ts +385 -0
- package/dist/src/capability-registry/types.js +2 -0
- package/dist/src/capability-registry/types.js.map +1 -0
- package/dist/src/capability-registry/utils.d.ts +71 -0
- package/dist/src/capability-registry/utils.js +163 -0
- package/dist/src/capability-registry/utils.js.map +1 -0
- package/dist/src/common/registry.d.ts +366 -0
- package/dist/src/common/registry.js +321 -0
- package/dist/src/common/registry.js.map +1 -0
- package/dist/src/common/types.d.ts +338 -0
- package/dist/src/common/types.js +21 -0
- package/dist/src/common/types.js.map +1 -0
- package/dist/src/common/utils.d.ts +20 -0
- package/dist/src/common/utils.js +26 -0
- package/dist/src/common/utils.js.map +1 -0
- package/dist/src/index.d.ts +40 -0
- package/dist/src/index.js +33 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/invocation/arguments-proxy.d.ts +14 -0
- package/dist/src/invocation/arguments-proxy.js +37 -0
- package/dist/src/invocation/arguments-proxy.js.map +1 -0
- package/dist/src/invocation/error-invocation.d.ts +27 -0
- package/dist/src/invocation/error-invocation.js +39 -0
- package/dist/src/invocation/error-invocation.js.map +1 -0
- package/dist/src/invocation/invocation.d.ts +111 -0
- package/dist/src/invocation/invocation.js +158 -0
- package/dist/src/invocation/invocation.js.map +1 -0
- package/dist/src/invocation/result-reference.d.ts +86 -0
- package/dist/src/invocation/result-reference.js +118 -0
- package/dist/src/invocation/result-reference.js.map +1 -0
- package/dist/src/invocation/types.d.ts +637 -0
- package/dist/src/invocation/types.js +2 -0
- package/dist/src/invocation/types.js.map +1 -0
- package/dist/src/invocation/utils.d.ts +21 -0
- package/dist/src/invocation/utils.js +30 -0
- package/dist/src/invocation/utils.js.map +1 -0
- package/dist/src/invocation-factory/invocation-factory-manager.d.ts +20 -0
- package/dist/src/invocation-factory/invocation-factory-manager.js +50 -0
- package/dist/src/invocation-factory/invocation-factory-manager.js.map +1 -0
- package/dist/src/invocation-factory/invocation-list.d.ts +32 -0
- package/dist/src/invocation-factory/invocation-list.js +77 -0
- package/dist/src/invocation-factory/invocation-list.js.map +1 -0
- package/dist/src/invocation-factory/types.d.ts +11 -0
- package/dist/src/invocation-factory/types.js +2 -0
- package/dist/src/invocation-factory/types.js.map +1 -0
- package/dist/src/jmap-client/jmap-client.d.ts +252 -0
- package/dist/src/jmap-client/jmap-client.js +777 -0
- package/dist/src/jmap-client/jmap-client.js.map +1 -0
- package/dist/src/jmap-client/types.d.ts +427 -0
- package/dist/src/jmap-client/types.js +21 -0
- package/dist/src/jmap-client/types.js.map +1 -0
- package/dist/src/jmap-client/utils/abort-controller.d.ts +8 -0
- package/dist/src/jmap-client/utils/abort-controller.js +24 -0
- package/dist/src/jmap-client/utils/abort-controller.js.map +1 -0
- package/dist/src/jmap-client/utils/assert-connected.d.ts +7 -0
- package/dist/src/jmap-client/utils/assert-connected.js +11 -0
- package/dist/src/jmap-client/utils/assert-connected.js.map +1 -0
- package/dist/src/jmap-client/utils/deep-freeze.d.ts +7 -0
- package/dist/src/jmap-client/utils/deep-freeze.js +17 -0
- package/dist/src/jmap-client/utils/deep-freeze.js.map +1 -0
- package/dist/src/jmap-client/utils/emitter.d.ts +9 -0
- package/dist/src/jmap-client/utils/emitter.js +18 -0
- package/dist/src/jmap-client/utils/emitter.js.map +1 -0
- package/dist/src/jmap-client/utils/filter-session-capabilities.d.ts +22 -0
- package/dist/src/jmap-client/utils/filter-session-capabilities.js +40 -0
- package/dist/src/jmap-client/utils/filter-session-capabilities.js.map +1 -0
- package/dist/src/jmap-client/utils/jmap-request-error.d.ts +28 -0
- package/dist/src/jmap-client/utils/jmap-request-error.js +48 -0
- package/dist/src/jmap-client/utils/jmap-request-error.js.map +1 -0
- package/dist/src/jmap-client/utils/logger.d.ts +6 -0
- package/dist/src/jmap-client/utils/logger.js +22 -0
- package/dist/src/jmap-client/utils/logger.js.map +1 -0
- package/dist/src/jmap-client/utils/merge-headers.d.ts +11 -0
- package/dist/src/jmap-client/utils/merge-headers.js +40 -0
- package/dist/src/jmap-client/utils/merge-headers.js.map +1 -0
- package/dist/src/jmap-client/utils/template-utils.d.ts +27 -0
- package/dist/src/jmap-client/utils/template-utils.js +61 -0
- package/dist/src/jmap-client/utils/template-utils.js.map +1 -0
- package/dist/src/jmap-client/utils/track-utils.d.ts +19 -0
- package/dist/src/jmap-client/utils/track-utils.js +35 -0
- package/dist/src/jmap-client/utils/track-utils.js.map +1 -0
- package/dist/src/jmap-client/utils/transport.d.ts +12 -0
- package/dist/src/jmap-client/utils/transport.js +38 -0
- package/dist/src/jmap-client/utils/transport.js.map +1 -0
- package/dist/src/jmap-client/utils/validate-session.d.ts +19 -0
- package/dist/src/jmap-client/utils/validate-session.js +29 -0
- package/dist/src/jmap-client/utils/validate-session.js.map +1 -0
- package/dist/src/request-builder/request-builder.d.ts +95 -0
- package/dist/src/request-builder/request-builder.js +343 -0
- package/dist/src/request-builder/request-builder.js.map +1 -0
- package/dist/src/request-builder/types.d.ts +32 -0
- package/dist/src/request-builder/types.js +2 -0
- package/dist/src/request-builder/types.js.map +1 -0
- package/package.json +69 -3
|
@@ -0,0 +1,776 @@
|
|
|
1
|
+
import type { Id, TZDate, UnsignedInt, UTCDate } from "../../common/types.js";
|
|
2
|
+
import type { BaseChangesRequestInvocationArgs, BaseChangesResponseInvocationArgs, BaseCopyRequestInvocationArgs, BaseCopyResponseInvocationArgs, BaseGetRequestInvocationArgs, BaseGetResponseInvocationArgs, BaseQueryChangesRequestInvocationArgs, BaseQueryChangesResponseInvocationArgs, BaseQueryRequestInvocationArgs, BaseQueryResponseInvocationArgs, BaseSetRequestInvocationArgs, BaseSetResponseInvocationArgs, SetError } from "../../invocation/types.js";
|
|
3
|
+
/**
|
|
4
|
+
* Keywords defined in the
|
|
5
|
+
* {@link https://www.iana.org/assignments/imap-jmap-keywords/imap-jmap-keywords.xhtml IMAP and JMAP Keywords Registry}
|
|
6
|
+
*/
|
|
7
|
+
export type JMAPKeywords = "$draft" | "$seen" | "$flagged" | "$answered" | "$forwarded" | "$phishing" | "$junk" | "$notjunk" | "$mdnsent" | "$submitPending" | "$submitted" | "$important";
|
|
8
|
+
/**
|
|
9
|
+
* Header fields parsed as an address-list value, as specified in
|
|
10
|
+
* {@link https://www.rfc-editor.org/rfc/rfc5322.html RFC 5322}, Section 3.4,
|
|
11
|
+
* into the EmailAddress[] type. There is an EmailAddress item for each
|
|
12
|
+
* mailbox parsed from the address-list. Group and comment information
|
|
13
|
+
* is discarded.
|
|
14
|
+
*/
|
|
15
|
+
export type EmailAddress = {
|
|
16
|
+
/**
|
|
17
|
+
* The display-name of the mailbox {@link https://www.rfc-editor.org/rfc/rfc5322.html RFC 5322}.
|
|
18
|
+
* If this is a quoted-string:
|
|
19
|
+
* - The surrounding DQUOTE characters are removed.
|
|
20
|
+
* - Any quoted-pair is decoded.
|
|
21
|
+
* - White space is unfolded, and then any leading and trailing white space is removed.
|
|
22
|
+
*
|
|
23
|
+
* If there is no display-name but there is a comment immediately following the `addr-spec`,
|
|
24
|
+
* the value of this SHOULD be used instead. Otherwise, this property is null.
|
|
25
|
+
*/
|
|
26
|
+
name?: string | null;
|
|
27
|
+
/**
|
|
28
|
+
* The addr-spec of the mailbox {@link https://www.rfc-editor.org/rfc/rfc5322.html RFC 5322}.
|
|
29
|
+
*/
|
|
30
|
+
value: string;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Header fields parsed as an address-list value, as specified in
|
|
34
|
+
* {@link https://www.rfc-editor.org/rfc/rfc5322.html RFC 5322}, Section 3.4,
|
|
35
|
+
* into the EmailAddressGroup[] type. Consecutive mailbox values that
|
|
36
|
+
* are not part of a group are still collected under an EmailAddressGroup
|
|
37
|
+
* object to provide a uniform type.
|
|
38
|
+
*/
|
|
39
|
+
export type EmailAddressGroup = {
|
|
40
|
+
/**
|
|
41
|
+
* The display-name of the group {@link https://www.rfc-editor.org/rfc/rfc5322.html RFC 5322},
|
|
42
|
+
* or null if the addresses are not part of a group. If this is a quoted-string,
|
|
43
|
+
* it is processed the same as the name in the EmailAddress type.
|
|
44
|
+
*/
|
|
45
|
+
name?: string | null;
|
|
46
|
+
/**
|
|
47
|
+
* The mailbox values that belong to this group, represented as EmailAddress objects.
|
|
48
|
+
*/
|
|
49
|
+
addresses: EmailAddress[];
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Raw header field value as a string (no parsing applied)
|
|
53
|
+
*/
|
|
54
|
+
export type EmailHeaderFieldParsedFormRaw = string;
|
|
55
|
+
/**
|
|
56
|
+
* Header field value parsed as text (RFC 2047 decoding applied)
|
|
57
|
+
*/
|
|
58
|
+
export type EmailHeaderFieldParsedFormText = string;
|
|
59
|
+
/**
|
|
60
|
+
* Header field value parsed as an address list into EmailAddress objects
|
|
61
|
+
*/
|
|
62
|
+
export type EmailHeaderFieldParsedFormAddresses = EmailAddress[];
|
|
63
|
+
/**
|
|
64
|
+
* Header field value parsed as a grouped address list into EmailAddressGroup objects
|
|
65
|
+
*/
|
|
66
|
+
export type EmailHeaderFieldParsedFormGroupedAddresses = EmailAddressGroup[];
|
|
67
|
+
/**
|
|
68
|
+
* Header field value parsed as message IDs (e.g., In-Reply-To, References)
|
|
69
|
+
*/
|
|
70
|
+
export type EmailHeaderFieldParsedFormMessageIds = string[] | null;
|
|
71
|
+
/**
|
|
72
|
+
* Header field value parsed as a date with timezone information
|
|
73
|
+
*/
|
|
74
|
+
export type EmailHeaderFieldParsedFormDate = TZDate | null;
|
|
75
|
+
/**
|
|
76
|
+
* Header field value parsed as a list of URLs
|
|
77
|
+
*/
|
|
78
|
+
export type EmailHeaderFieldParsedFormURLs = string[] | null;
|
|
79
|
+
/**
|
|
80
|
+
* Union of all possible parsed forms for email header field values
|
|
81
|
+
*/
|
|
82
|
+
export type EmailHeaderFieldParsedForms = EmailHeaderFieldParsedFormRaw | EmailHeaderFieldParsedFormAddresses | EmailHeaderFieldParsedFormGroupedAddresses | EmailHeaderFieldParsedFormMessageIds | EmailHeaderFieldParsedFormDate | EmailHeaderFieldParsedFormURLs;
|
|
83
|
+
/**
|
|
84
|
+
* An email header field as defined in
|
|
85
|
+
* {@link https://www.rfc-editor.org/rfc/rfc5322.html RFC 5322}
|
|
86
|
+
*/
|
|
87
|
+
export type EmailHeader = {
|
|
88
|
+
/**
|
|
89
|
+
* The header field name as defined in
|
|
90
|
+
* {@link https://www.rfc-editor.org/rfc/rfc5322.html RFC 5322},
|
|
91
|
+
* with the same capitalization that it has in the message.
|
|
92
|
+
*/
|
|
93
|
+
readonly name: string;
|
|
94
|
+
/**
|
|
95
|
+
* The header field value as defined in
|
|
96
|
+
* {@link https://www.rfc-editor.org/rfc/rfc5322.html RFC 5322},
|
|
97
|
+
* in Raw form.
|
|
98
|
+
*/
|
|
99
|
+
readonly value: string;
|
|
100
|
+
};
|
|
101
|
+
/**
|
|
102
|
+
* These properties are derived from the message body
|
|
103
|
+
* {@link https://www.rfc-editor.org/rfc/rfc5322.html RFC 5322}
|
|
104
|
+
* and its MIME entities {@link https://www.rfc-editor.org/rfc/rfc2045.html RFC 2045}.
|
|
105
|
+
*/
|
|
106
|
+
export type EmailBodyPart = {
|
|
107
|
+
/**
|
|
108
|
+
* Identifies this part uniquely within the Email. This is scoped to the emailId
|
|
109
|
+
* and has no meaning outside of the JMAP Email object representation. This is `null`
|
|
110
|
+
* if, and only if, the part is of type multipart/*.
|
|
111
|
+
*/
|
|
112
|
+
partId?: string | null;
|
|
113
|
+
/**
|
|
114
|
+
* The id representing the raw octets of the contents of the part, after decoding
|
|
115
|
+
* any known Content-Transfer-Encoding (as defined in
|
|
116
|
+
* {@link https://www.rfc-editor.org/rfc/rfc2045.html RFC 2045}), or null if, and only if,
|
|
117
|
+
* the part is of type multipart/*.
|
|
118
|
+
* Note that two parts may be transfer-encoded differently but have the same blob id
|
|
119
|
+
* if their decoded octets are identical and the server is using a secure hash of the
|
|
120
|
+
* data for the blob id. If the transfer encoding is unknown, it is treated as though
|
|
121
|
+
* it had no transfer encoding.
|
|
122
|
+
*/
|
|
123
|
+
blobId?: Id | null;
|
|
124
|
+
/**
|
|
125
|
+
* The size, in octets, of the raw data after content transfer decoding (as referenced
|
|
126
|
+
* by the blobId, i.e., the number of octets in the file the user would download).
|
|
127
|
+
*/
|
|
128
|
+
size: UnsignedInt;
|
|
129
|
+
/**
|
|
130
|
+
* This is a list of all header fields in the part, in the order they appear in
|
|
131
|
+
* the message. The values are in Raw form.
|
|
132
|
+
*/
|
|
133
|
+
headers: EmailHeader[];
|
|
134
|
+
/**
|
|
135
|
+
* This is the decoded filename parameter of the Content-Disposition header
|
|
136
|
+
* field per {@link https://www.rfc-editor.org/rfc/rfc2231.html RFC 2231}, or
|
|
137
|
+
* (for compatibility with existing systems) if not present, then it’s the
|
|
138
|
+
* decoded name parameter of the Content-Type header field per
|
|
139
|
+
* {@link https://www.rfc-editor.org/rfc/rfc2047.html RFC 2047}.
|
|
140
|
+
*/
|
|
141
|
+
name?: string | null;
|
|
142
|
+
/**
|
|
143
|
+
* The value of the Content-Type header field of the part, if present; otherwise,
|
|
144
|
+
* the implicit type as per the MIME standard (text/plain or message/rfc822 if
|
|
145
|
+
* inside a multipart/digest). CFWS is removed and any parameters are stripped.
|
|
146
|
+
*/
|
|
147
|
+
type: string;
|
|
148
|
+
/**
|
|
149
|
+
* The value of the charset parameter of the Content-Type header field,
|
|
150
|
+
* if present, or `null` if the header field is present but not of type
|
|
151
|
+
* `text/*`. If there is no Content-Type header field, or it exists and
|
|
152
|
+
* is of type `text/*` but has no charset parameter, this is the implicit
|
|
153
|
+
* charset as per the MIME standard: `us-ascii`.
|
|
154
|
+
*/
|
|
155
|
+
charset?: string | null;
|
|
156
|
+
/**
|
|
157
|
+
* The value of the Content-Disposition header field of the part, if present;
|
|
158
|
+
* otherwise, it’s null. CFWS is removed and any parameters are stripped.
|
|
159
|
+
*/
|
|
160
|
+
disposition?: string | null;
|
|
161
|
+
/**
|
|
162
|
+
* The value of the Content-Id header field of the part, if present;
|
|
163
|
+
* otherwise it’s null. CFWS and surrounding angle brackets (<>) are removed.
|
|
164
|
+
* This may be used to reference the content from within a text/html body part
|
|
165
|
+
* HTML using the cid: protocol, as defined in
|
|
166
|
+
* {@link https://www.rfc-editor.org/rfc/rfc2392.html RFC 2392}.
|
|
167
|
+
*/
|
|
168
|
+
cid?: string | null;
|
|
169
|
+
/**
|
|
170
|
+
* The list of language tags, as defined in
|
|
171
|
+
* {@link https://www.rfc-editor.org/rfc/rfc3282.html RFC 3282}, in the
|
|
172
|
+
* Content-Language header field of the part, if present.
|
|
173
|
+
*/
|
|
174
|
+
language?: string[] | null;
|
|
175
|
+
/**
|
|
176
|
+
* The URI, as defined in {@link https://www.rfc-editor.org/rfc/rfc2557.html RFC 2557},
|
|
177
|
+
* in the Content-Location header field of the part, if present.
|
|
178
|
+
*/
|
|
179
|
+
location?: string | null;
|
|
180
|
+
/**
|
|
181
|
+
* If the type is multipart/*, this contains the body parts of each child.
|
|
182
|
+
*/
|
|
183
|
+
subParts?: EmailBodyPart[] | null;
|
|
184
|
+
};
|
|
185
|
+
/**
|
|
186
|
+
* An EmailBodyValue object has the following properties:
|
|
187
|
+
*/
|
|
188
|
+
export type EmailBodyValue = {
|
|
189
|
+
/**
|
|
190
|
+
* The value of the body part after decoding Content-Transfer-Encoding and
|
|
191
|
+
* the Content-Type charset, if both known to the server, and with any CRLF
|
|
192
|
+
* replaced with a single LF. The server MAY use heuristics to determine
|
|
193
|
+
* the charset to use for decoding if the charset is unknown, no charset is
|
|
194
|
+
* given, or it believes the charset given is incorrect. Decoding is best
|
|
195
|
+
* effort; the server SHOULD insert the unicode replacement character (U+FFFD)
|
|
196
|
+
* and continue when a malformed section is encountered.
|
|
197
|
+
*
|
|
198
|
+
* Note that due to the charset decoding and line ending normalisation,
|
|
199
|
+
* the length of this string will probably not be exactly the same as the size
|
|
200
|
+
* property on the corresponding EmailBodyPart.
|
|
201
|
+
*/
|
|
202
|
+
value: string;
|
|
203
|
+
/**
|
|
204
|
+
* (default: false) This is true if malformed sections were found while decoding the charset, or the charset was unknown, or the content-transfer-encoding was unknown.
|
|
205
|
+
*/
|
|
206
|
+
isEncodingProblem?: boolean;
|
|
207
|
+
/**
|
|
208
|
+
* (default: false) This is true if the value has been truncated.
|
|
209
|
+
*/
|
|
210
|
+
isTruncated?: boolean;
|
|
211
|
+
};
|
|
212
|
+
/**
|
|
213
|
+
* EmailObject properties that may be set via an `Email/set` call
|
|
214
|
+
*/
|
|
215
|
+
export type EmailObjectServerSet = Readonly<{
|
|
216
|
+
/**
|
|
217
|
+
* (immutable) The id of the Email object.
|
|
218
|
+
*
|
|
219
|
+
* Note that this is the JMAP object id, NOT the Message-ID header field value
|
|
220
|
+
* of the message {@link https://www.rfc-editor.org/rfc/rfc5322.html RFC 5322}.
|
|
221
|
+
*/
|
|
222
|
+
id: Id;
|
|
223
|
+
/**
|
|
224
|
+
* (immutable) The id representing the raw octets of the message
|
|
225
|
+
* {@link https://www.rfc-editor.org/rfc/rfc5322.html RFC 5322} for this Email.
|
|
226
|
+
* This may be used to download the raw original message or to attach it
|
|
227
|
+
* directly to another Email, etc.
|
|
228
|
+
*/
|
|
229
|
+
blobId: Id;
|
|
230
|
+
/**
|
|
231
|
+
* (immutable) The id of the Thread to which this Email belongs.
|
|
232
|
+
*/
|
|
233
|
+
threadId: Id;
|
|
234
|
+
/**
|
|
235
|
+
* (immutable) The size, in octets, of the raw data for the message
|
|
236
|
+
* {@link https://www.rfc-editor.org/rfc/rfc5322.html RFC 5322} (as referenced
|
|
237
|
+
* by the blobId, i.e., the number of octets in the file the user would
|
|
238
|
+
* download).
|
|
239
|
+
*/
|
|
240
|
+
size: UnsignedInt;
|
|
241
|
+
/**
|
|
242
|
+
* (immutable) This is a list of all header fields
|
|
243
|
+
* {@link https://www.rfc-editor.org/rfc/rfc5322.html RFC 5322}, in the same order
|
|
244
|
+
* they appear in the message.
|
|
245
|
+
*/
|
|
246
|
+
headers: EmailHeader[];
|
|
247
|
+
/**
|
|
248
|
+
* (immutable) This is true if there are one or more parts in the message
|
|
249
|
+
* that a client UI should offer as downloadable. A server SHOULD set
|
|
250
|
+
* hasAttachment to true if the attachments list contains at least one item
|
|
251
|
+
* that does not have Content-Disposition: inline. The server MAY ignore
|
|
252
|
+
* parts in this list that are processed automatically in some way or are
|
|
253
|
+
* referenced as embedded images in one of the text/html parts of the message.
|
|
254
|
+
*/
|
|
255
|
+
hasAttachment: boolean;
|
|
256
|
+
/**
|
|
257
|
+
* (immutable) A plaintext fragment of the message body. This is intended
|
|
258
|
+
* to be shown as a preview line when listing messages in the mail store
|
|
259
|
+
* and may be truncated when shown. The server may choose which part of
|
|
260
|
+
* the message to include in the preview; skipping quoted sections and
|
|
261
|
+
* salutations and collapsing white space can result in a more useful
|
|
262
|
+
* preview.
|
|
263
|
+
*
|
|
264
|
+
* This MUST NOT be more than 256 characters in length.
|
|
265
|
+
*
|
|
266
|
+
* As this is derived from the message content by the server, and the
|
|
267
|
+
* algorithm for doing so could change over time, fetching this for an
|
|
268
|
+
* Email a second time MAY return a different result. However, the
|
|
269
|
+
* previous value is not considered incorrect, and the change SHOULD NOT
|
|
270
|
+
* cause the Email object to be considered as changed by the server.
|
|
271
|
+
*/
|
|
272
|
+
preview: string;
|
|
273
|
+
}>;
|
|
274
|
+
/**
|
|
275
|
+
* EmailObject properties that may be set via an `Email/set` call
|
|
276
|
+
*/
|
|
277
|
+
export type EmailObjectSettable = {
|
|
278
|
+
/**
|
|
279
|
+
* The set of Mailbox ids this Email belongs to. An Email in the mail store
|
|
280
|
+
* MUST belong to one or more Mailboxes at all times (until it is destroyed).
|
|
281
|
+
* The set is represented as an object, with each key being a Mailbox id. The
|
|
282
|
+
* value for each key in the object MUST be true.
|
|
283
|
+
*/
|
|
284
|
+
mailboxIds: Record<Id, true>;
|
|
285
|
+
/**
|
|
286
|
+
* (default: `{}`) A set of keywords that apply to the Email. The set is represented
|
|
287
|
+
* as an object, with the keys being the keywords. The value for each key in the
|
|
288
|
+
* object MUST be true.
|
|
289
|
+
*
|
|
290
|
+
* Keywords are shared with IMAP. The six system keywords from IMAP get special
|
|
291
|
+
* treatment. The following four keywords have their first character changed from
|
|
292
|
+
* `\` in IMAP to `$` in JMAP and have particular semantic meaning:
|
|
293
|
+
* - `$draft`: The Email is a draft the user is composing.
|
|
294
|
+
* - `$seen`: The Email has been read.
|
|
295
|
+
* - `$flagged`: The Email has been flagged for urgent/special attention.
|
|
296
|
+
* - `$answered`: The Email has been replied to.
|
|
297
|
+
*
|
|
298
|
+
* The IMAP `\Recent` keyword is not exposed via JMAP. The IMAP `\Deleted`
|
|
299
|
+
* keyword is also not present: IMAP uses a delete+expunge model, which
|
|
300
|
+
* JMAP does not.
|
|
301
|
+
*
|
|
302
|
+
* Users may add arbitrary keywords to an Email. For compatibility with IMAP,
|
|
303
|
+
* a keyword is a case-insensitive string of 1–255 characters in the ASCII
|
|
304
|
+
* subset `%x21–%x7e` (excludes control chars and space), and it MUST NOT
|
|
305
|
+
* include any of these characters:
|
|
306
|
+
*
|
|
307
|
+
* `( ) { ] % * " \`
|
|
308
|
+
*
|
|
309
|
+
* Because JSON is case sensitive, servers MUST return keywords in lowercase.
|
|
310
|
+
*
|
|
311
|
+
* The IMAP and JMAP Keywords registry as established in
|
|
312
|
+
* {@link https://www.rfc-editor.org/rfc/rfc5788.html RFC 5788} assigns semantic meaning
|
|
313
|
+
* to some other keywords in common use.
|
|
314
|
+
*
|
|
315
|
+
* New keywords may be established here in the future. In particular, note:
|
|
316
|
+
* - `$forwarded`: The Email has been forwarded.
|
|
317
|
+
* - `$phishing`: The Email is highly likely to be phishing. Clients SHOULD
|
|
318
|
+
* warn users to take care when viewing this Email and disable links and
|
|
319
|
+
* attachments.
|
|
320
|
+
* - `$junk`: The Email is definitely spam. Clients SHOULD set this flag when
|
|
321
|
+
* users report spam to help train automated spam-detection systems.
|
|
322
|
+
* - `$notjunk`: The Email is definitely not spam. Clients SHOULD set this
|
|
323
|
+
* flag when users indicate an Email is legitimate, to help train
|
|
324
|
+
* automated spam-detection systems.
|
|
325
|
+
*/
|
|
326
|
+
keywords?: Record<JMAPKeywords, true> | Record<string, true>;
|
|
327
|
+
/**
|
|
328
|
+
* (immutable; default: time of creation on server) The date the Email
|
|
329
|
+
* was received by the message store. This is the internal date in IMAP
|
|
330
|
+
* {@link https://www.rfc-editor.org/rfc/rfc3501.html RFC 3501}.
|
|
331
|
+
*/
|
|
332
|
+
readonly receivedAt?: UTCDate;
|
|
333
|
+
/**
|
|
334
|
+
* (immutable) The value is identical to the value of header:Message-ID:asMessageIds.
|
|
335
|
+
* For messages conforming to {@link https://www.rfc-editor.org/rfc/rfc5322.html RFC 5322}
|
|
336
|
+
* this will be an array with a single entry.
|
|
337
|
+
*/
|
|
338
|
+
readonly messageId?: string[] | null;
|
|
339
|
+
/**
|
|
340
|
+
* (immutable) The value is identical to the value of header:In-Reply-To:asMessageIds.
|
|
341
|
+
*/
|
|
342
|
+
readonly inReplyTo?: string[] | null;
|
|
343
|
+
/**
|
|
344
|
+
* (immutable) The value is identical to the value of header:References:asMessageIds.
|
|
345
|
+
*/
|
|
346
|
+
readonly references?: string[] | null;
|
|
347
|
+
/**
|
|
348
|
+
* (immutable) The value is identical to the value of header:Sender:asAddresses.
|
|
349
|
+
*/
|
|
350
|
+
readonly sender?: EmailAddress[] | null;
|
|
351
|
+
/**
|
|
352
|
+
* (immutable) The value is identical to the value of header:From:asAddresses.
|
|
353
|
+
*/
|
|
354
|
+
readonly from?: EmailAddress[] | null;
|
|
355
|
+
/**
|
|
356
|
+
* (immutable) The value is identical to the value of header:To:asAddresses.
|
|
357
|
+
*/
|
|
358
|
+
readonly to?: EmailAddress[] | null;
|
|
359
|
+
/**
|
|
360
|
+
* (immutable) The value is identical to the value of header:Cc:asAddresses.
|
|
361
|
+
*/
|
|
362
|
+
readonly cc?: EmailAddress[] | null;
|
|
363
|
+
/**
|
|
364
|
+
* (immutable) The value is identical to the value of header:Bcc:asAddresses.
|
|
365
|
+
*/
|
|
366
|
+
readonly bcc?: EmailAddress[] | null;
|
|
367
|
+
/**
|
|
368
|
+
* (immutable) The value is identical to the value of header:Reply-To:asAddresses.
|
|
369
|
+
*/
|
|
370
|
+
readonly replyTo?: EmailAddress[] | null;
|
|
371
|
+
/**
|
|
372
|
+
* (immutable) The value is identical to the value of header:Subject:asText.
|
|
373
|
+
*/
|
|
374
|
+
readonly subject?: string | null;
|
|
375
|
+
/**
|
|
376
|
+
* (immutable; default on creation: current server time)
|
|
377
|
+
* The value is identical to the value of header:Date:asDate.
|
|
378
|
+
*/
|
|
379
|
+
readonly sentAt?: TZDate | null;
|
|
380
|
+
/**
|
|
381
|
+
* (immutable) This is the full MIME structure of the message body,
|
|
382
|
+
* without recursing into message/rfc822 or message/global parts.
|
|
383
|
+
* Note that EmailBodyParts may have subParts if they are of type
|
|
384
|
+
* multipart/*.
|
|
385
|
+
*/
|
|
386
|
+
bodyStructure: EmailBodyPart;
|
|
387
|
+
/**
|
|
388
|
+
* (immutable) This is a map of partId to an EmailBodyValue object for none,
|
|
389
|
+
* some, or all text/* parts. Which parts are included and whether the value
|
|
390
|
+
* is truncated is determined by various arguments to Email/get and Email/parse.
|
|
391
|
+
*/
|
|
392
|
+
bodyValues: Record<string, EmailBodyValue>;
|
|
393
|
+
/**
|
|
394
|
+
* (immutable) A list of text/plain, text/html, image/*, audio/*, and/or video/*
|
|
395
|
+
* parts to display (sequentially) as the message body, with a preference for
|
|
396
|
+
* text/plain when alternative versions are available.
|
|
397
|
+
*/
|
|
398
|
+
textBody: EmailBodyPart[];
|
|
399
|
+
/**
|
|
400
|
+
* (immutable) A list of text/plain, text/html, image/*, audio/*, and/or video/*
|
|
401
|
+
* parts to display (sequentially) as the message body, with a preference for
|
|
402
|
+
* text/html when alternative versions are available.
|
|
403
|
+
*/
|
|
404
|
+
htmlBody: EmailBodyPart[];
|
|
405
|
+
/**
|
|
406
|
+
* (immutable) A list, traversing depth-first, of all parts in bodyStructure
|
|
407
|
+
* that satisfy either of the following conditions:
|
|
408
|
+
* - not of type multipart/* and not included in textBody or htmlBody
|
|
409
|
+
* - of type image/*, audio/*, or video/* and not in both textBody and htmlBody
|
|
410
|
+
*
|
|
411
|
+
* None of these parts include subParts, including message/* types. Attached
|
|
412
|
+
* messages may be fetched using the Email/parse method and the blobId.
|
|
413
|
+
*
|
|
414
|
+
* Note that a text/html body part HTML may reference image parts in
|
|
415
|
+
* attachments by using cid: links to reference the Content-Id, as defined in
|
|
416
|
+
* {@link https://www.rfc-editor.org/rfc/rfc2392.html RFC 2392}, or by referencing
|
|
417
|
+
* the Content-Location.
|
|
418
|
+
*/
|
|
419
|
+
attachments: Omit<EmailBodyPart, "subParts">[];
|
|
420
|
+
};
|
|
421
|
+
export type EmailObjectHeaderField = {
|
|
422
|
+
/**
|
|
423
|
+
* The client may request/send properties representing individual header fields of the form:
|
|
424
|
+
*
|
|
425
|
+
* `header:{header-field-name}`
|
|
426
|
+
*
|
|
427
|
+
* Where {header-field-name} means any series of one or more printable ASCII characters
|
|
428
|
+
* (i.e., characters that have values between 33 and 126, inclusive), except for colon (:).
|
|
429
|
+
* The property may also have the following suffixes:
|
|
430
|
+
*
|
|
431
|
+
* - :as{header-form} This means the value is in a parsed form, where
|
|
432
|
+
* {header-form} is one of the parsed-form names:
|
|
433
|
+
* `Raw`, `Text`, `Addresses`, `GroupedAddresses`, `MessageIds`, `Date`, `URLs`.
|
|
434
|
+
* . If not given, the value is in Raw form.
|
|
435
|
+
*
|
|
436
|
+
* - :all This means the value is an array, with the items corresponding to each
|
|
437
|
+
* instance of the header field, in the order they appear in the message.
|
|
438
|
+
* If this suffix is not used, the result is the value of the last instance of
|
|
439
|
+
* the header field (i.e., identical to the last item in the array if :all is used),
|
|
440
|
+
* or null if none.
|
|
441
|
+
*
|
|
442
|
+
* If both suffixes are used, they MUST be specified in the order above.
|
|
443
|
+
* Header field names are matched case insensitively. The value is typed
|
|
444
|
+
* according to the requested form or to an array of that type if :all is used.
|
|
445
|
+
* If no header fields exist in the message with the requested name, the value
|
|
446
|
+
* is null if fetching a single instance or an empty array if requesting :all.
|
|
447
|
+
*/
|
|
448
|
+
[header: `header:${string}`]: EmailHeaderFieldParsedForms | EmailHeaderFieldParsedForms[];
|
|
449
|
+
};
|
|
450
|
+
export type EmailObject = EmailObjectSettable & EmailObjectServerSet & EmailObjectHeaderField;
|
|
451
|
+
/**
|
|
452
|
+
* The EmailImport object referencing the blobs to be imported
|
|
453
|
+
*/
|
|
454
|
+
export type EmailImport = {
|
|
455
|
+
/**
|
|
456
|
+
* The id of the blob containing the raw message
|
|
457
|
+
* {@link https://www.rfc-editor.org/rfc/rfc5322.html RFC 5322}.
|
|
458
|
+
*/
|
|
459
|
+
blobId: Id;
|
|
460
|
+
/**
|
|
461
|
+
* The ids of the Mailboxes to assign this Email to.
|
|
462
|
+
* At least one Mailbox MUST be given.
|
|
463
|
+
*/
|
|
464
|
+
mailboxIds: Record<Id, true>;
|
|
465
|
+
/**
|
|
466
|
+
* (default: {}) The keywords to apply to the Email.
|
|
467
|
+
*/
|
|
468
|
+
keywords?: Record<string, boolean>;
|
|
469
|
+
/**
|
|
470
|
+
* (default: time of most recent Received header, or time of import on server
|
|
471
|
+
* if none) The receivedAt date to set on the Email.
|
|
472
|
+
*/
|
|
473
|
+
receivedAt?: UTCDate;
|
|
474
|
+
};
|
|
475
|
+
/**
|
|
476
|
+
* The arguments for fetching Email objects via an `Email/get` call
|
|
477
|
+
*/
|
|
478
|
+
export type EmailGetRequestInvocationArgs = BaseGetRequestInvocationArgs<EmailObject> & {
|
|
479
|
+
/**
|
|
480
|
+
* A list of properties to fetch for each EmailBodyPart returned. If omitted, this defaults to:
|
|
481
|
+
*
|
|
482
|
+
* [ "partId", "blobId", "size", "name", "type", "charset",
|
|
483
|
+
* "disposition", "cid", "language", "location" ]
|
|
484
|
+
*/
|
|
485
|
+
bodyProperties?: string[];
|
|
486
|
+
/**
|
|
487
|
+
* (default: false) If true, the bodyValues property includes any text/* part
|
|
488
|
+
* in the textBody property.
|
|
489
|
+
*/
|
|
490
|
+
fetchTextBodyValues?: boolean;
|
|
491
|
+
/**
|
|
492
|
+
* (default: false) If true, the bodyValues property includes any text/* part
|
|
493
|
+
* in the htmlBody property.
|
|
494
|
+
*/
|
|
495
|
+
fetchHTMLBodyValues?: boolean;
|
|
496
|
+
/**
|
|
497
|
+
* (default: false) If true, the bodyValues property includes any text/* part
|
|
498
|
+
* in the bodyStructure property.
|
|
499
|
+
*/
|
|
500
|
+
fetchAllBodyValues?: boolean;
|
|
501
|
+
/**
|
|
502
|
+
* (default: 0) If greater than zero, the value property of any EmailBodyValue
|
|
503
|
+
* object returned in bodyValues MUST be truncated if necessary so it does not
|
|
504
|
+
* exceed this number of octets in size. If 0 (the default), no truncation occurs.
|
|
505
|
+
*/
|
|
506
|
+
maxBodyValueBytes?: UnsignedInt;
|
|
507
|
+
};
|
|
508
|
+
export type EmailGetResponseInvocationArgs = BaseGetResponseInvocationArgs<EmailObject>;
|
|
509
|
+
/**
|
|
510
|
+
* The arguments for fetching Email changes via an `Email/changes` call
|
|
511
|
+
*/
|
|
512
|
+
export type EmailChangesRequestInvocationArgs = BaseChangesRequestInvocationArgs;
|
|
513
|
+
/**
|
|
514
|
+
* The response to an `Email/changes` call
|
|
515
|
+
*/
|
|
516
|
+
export type EmailChangesResponseInvocationArgs = BaseChangesResponseInvocationArgs;
|
|
517
|
+
export type EmailFilterCondition = Partial<{
|
|
518
|
+
/**
|
|
519
|
+
* A Mailbox id. An Email must be in this Mailbox to match the condition.
|
|
520
|
+
*/
|
|
521
|
+
inMailbox: Id;
|
|
522
|
+
/**
|
|
523
|
+
* A list of Mailbox ids. An Email must be in at least one Mailbox not in
|
|
524
|
+
* this list to match the condition. This is to allow messages solely in
|
|
525
|
+
* trash/spam to be easily excluded from a search.
|
|
526
|
+
*/
|
|
527
|
+
inMailboxOtherThan: Id[];
|
|
528
|
+
/**
|
|
529
|
+
* The receivedAt date-time of the Email must be before this date-time to
|
|
530
|
+
* match the condition.
|
|
531
|
+
*/
|
|
532
|
+
before: UTCDate;
|
|
533
|
+
/**
|
|
534
|
+
* The receivedAt date-time of the Email must be the same or after this
|
|
535
|
+
* date-time to match the condition.
|
|
536
|
+
*/
|
|
537
|
+
after: UTCDate;
|
|
538
|
+
/**
|
|
539
|
+
* The size property of the Email must be equal to or greater than this
|
|
540
|
+
* number to match the condition.
|
|
541
|
+
*/
|
|
542
|
+
minSize: UnsignedInt;
|
|
543
|
+
/**
|
|
544
|
+
* The size property of the Email must be less than this number to match
|
|
545
|
+
* the condition.
|
|
546
|
+
*/
|
|
547
|
+
maxSize: UnsignedInt;
|
|
548
|
+
/**
|
|
549
|
+
* All Emails (including this one) in the same Thread as this Email must have
|
|
550
|
+
* the given keyword to match the condition.
|
|
551
|
+
*/
|
|
552
|
+
allInThreadHaveKeyword: string;
|
|
553
|
+
/**
|
|
554
|
+
* At least one Email (possibly this one) in the same Thread as this Email
|
|
555
|
+
* must have the given keyword to match the condition.
|
|
556
|
+
*/
|
|
557
|
+
someInThreadHaveKeyword: string;
|
|
558
|
+
/**
|
|
559
|
+
* All Emails (including this one) in the same Thread as this Email must not
|
|
560
|
+
* have the given keyword to match the condition.
|
|
561
|
+
*/
|
|
562
|
+
noneInThreadHaveKeyword: string;
|
|
563
|
+
/**
|
|
564
|
+
* This Email must have the given keyword to match the condition.
|
|
565
|
+
*/
|
|
566
|
+
hasKeyword: string;
|
|
567
|
+
/**
|
|
568
|
+
* This Email must not have the given keyword to match the condition.
|
|
569
|
+
*/
|
|
570
|
+
notKeyword: string;
|
|
571
|
+
/**
|
|
572
|
+
* The hasAttachment property of the Email must be identical to the value
|
|
573
|
+
* given to match the condition.
|
|
574
|
+
*/
|
|
575
|
+
hasAttachment: boolean;
|
|
576
|
+
/**
|
|
577
|
+
* Looks for the text in Emails. The server MUST look up text in the From,
|
|
578
|
+
* To, Cc, Bcc, and Subject header fields of the message and SHOULD look
|
|
579
|
+
* inside any `text/*` or other body parts that may be converted to text by
|
|
580
|
+
* the server. The server MAY extend the search to any additional textual
|
|
581
|
+
* property.
|
|
582
|
+
*/
|
|
583
|
+
text: string;
|
|
584
|
+
/**
|
|
585
|
+
* Looks for the text in the From header field of the message.
|
|
586
|
+
*/
|
|
587
|
+
from: string;
|
|
588
|
+
/**
|
|
589
|
+
* Looks for the text in the To header field of the message.
|
|
590
|
+
*/
|
|
591
|
+
to: string;
|
|
592
|
+
/**
|
|
593
|
+
* Looks for the text in the Cc header field of the message.
|
|
594
|
+
*/
|
|
595
|
+
cc: string;
|
|
596
|
+
/**
|
|
597
|
+
* Looks for the text in the Bcc header field of the message.
|
|
598
|
+
*/
|
|
599
|
+
bcc: string;
|
|
600
|
+
/**
|
|
601
|
+
* Looks for the text in the Subject header field of the message.
|
|
602
|
+
*/
|
|
603
|
+
subject: string;
|
|
604
|
+
/**
|
|
605
|
+
* Looks for the text in one of the body parts of the message. The server
|
|
606
|
+
* MAY exclude MIME body parts with content media types other than `text/*`
|
|
607
|
+
* and `message/*` from consideration in search matching. Care should be
|
|
608
|
+
* taken to match based on the text content actually presented to an end
|
|
609
|
+
* user by viewers for that media type or otherwise identified as appropriate
|
|
610
|
+
* for search indexing. Matching document metadata uninteresting to an end
|
|
611
|
+
* user (e.g., markup tag and attribute names) is undesirable.
|
|
612
|
+
*/
|
|
613
|
+
body: string;
|
|
614
|
+
/**
|
|
615
|
+
* The array MUST contain either one or two elements. The first element is
|
|
616
|
+
* the name of the header field to match against. The second (optional)
|
|
617
|
+
* element is the text to look for in the header field value. If not supplied,
|
|
618
|
+
* the message matches simply if it has a header field of the given name.
|
|
619
|
+
*/
|
|
620
|
+
header: string[];
|
|
621
|
+
}>;
|
|
622
|
+
/**
|
|
623
|
+
* The arguments to query Email objects via an `Email/query` call
|
|
624
|
+
*/
|
|
625
|
+
export type EmailQueryRequestInvocationArgs = BaseQueryRequestInvocationArgs<EmailObject, EmailFilterCondition> & {
|
|
626
|
+
/**
|
|
627
|
+
* (default: false) If true, Emails in the same Thread as a previous Email in
|
|
628
|
+
* the list (given the filter and sort order) will be removed from the list.
|
|
629
|
+
* This means only one Email at most will be included in the list for any
|
|
630
|
+
* given Thread.
|
|
631
|
+
*/
|
|
632
|
+
collapseThreads?: boolean;
|
|
633
|
+
};
|
|
634
|
+
/**
|
|
635
|
+
* The response to an `Email/query` call
|
|
636
|
+
*/
|
|
637
|
+
export type EmailQueryResponseInvocationArgs = BaseQueryResponseInvocationArgs;
|
|
638
|
+
/**
|
|
639
|
+
* The arguments to query changes to Email objects via an `Email/queryChanges` call
|
|
640
|
+
*/
|
|
641
|
+
export type EmailQueryChangesRequestInvocationArgs = BaseQueryChangesRequestInvocationArgs<EmailObject, EmailFilterCondition> & {
|
|
642
|
+
/**
|
|
643
|
+
* (default: false) If true, Emails in the same Thread as a previous Email in
|
|
644
|
+
* the list (given the filter and sort order) will be removed from the list.
|
|
645
|
+
* This means only one Email at most will be included in the list for any
|
|
646
|
+
* given Thread.
|
|
647
|
+
*/
|
|
648
|
+
collapseThreads?: boolean;
|
|
649
|
+
};
|
|
650
|
+
/**
|
|
651
|
+
* The response to an `Email/queryChanges` call
|
|
652
|
+
*/
|
|
653
|
+
export type EmailQueryChangesResponseInvocationArgs = BaseQueryChangesResponseInvocationArgs;
|
|
654
|
+
/**
|
|
655
|
+
* The arguments to copy or move objects between two different Email accounts via an `Email/copy` call
|
|
656
|
+
*/
|
|
657
|
+
export type EmailCopyRequestInvocationArgs = BaseCopyRequestInvocationArgs<Pick<EmailObject, "id" | "mailboxIds" | "keywords" | "receivedAt">>;
|
|
658
|
+
export type EmailCopyResponseInvocationArgs = BaseCopyResponseInvocationArgs<Pick<EmailObject, "id" | "blobId" | "threadId" | "size">>;
|
|
659
|
+
/**
|
|
660
|
+
* The arguments for creating, updating, and destroying Email objects via an `Email/set` call
|
|
661
|
+
*/
|
|
662
|
+
export type EmailSetRequestInvocationArgs = BaseSetRequestInvocationArgs<EmailObjectSettable>;
|
|
663
|
+
/**
|
|
664
|
+
* The response to an `Email/set` call
|
|
665
|
+
*/
|
|
666
|
+
export type EmailSetResponseInvocationArgs = BaseSetResponseInvocationArgs<Pick<EmailObject, "id" | "blobId" | "threadId" | "size">>;
|
|
667
|
+
/**
|
|
668
|
+
* The arguments for importing Email objects via an `Email/import` call
|
|
669
|
+
*/
|
|
670
|
+
export type EmailImportRequestInvocationArgs = {
|
|
671
|
+
/**
|
|
672
|
+
* The id of the account to use.
|
|
673
|
+
*/
|
|
674
|
+
accountId: Id;
|
|
675
|
+
/**
|
|
676
|
+
* This is a state string as returned by the Email/get method. If supplied,
|
|
677
|
+
* the string must match the current state of the account referenced by the
|
|
678
|
+
* accountId; otherwise, the method will be aborted and a stateMismatch error
|
|
679
|
+
* returned. If null, any changes will be applied to the current state.
|
|
680
|
+
*/
|
|
681
|
+
ifInState?: string | null;
|
|
682
|
+
/**
|
|
683
|
+
* A map of creation id (client specified) to EmailImport objects.
|
|
684
|
+
*/
|
|
685
|
+
emails: Record<Id, EmailImport>;
|
|
686
|
+
};
|
|
687
|
+
export type EmailImportResponseInvocationArgs = {
|
|
688
|
+
/** The id of the account used for this call. */
|
|
689
|
+
accountId: Id;
|
|
690
|
+
/**
|
|
691
|
+
* The state string that would have been returned by Email/get on this account before making the
|
|
692
|
+
* requested changes, or `null` if the server doesn’t know what the previous state string was.
|
|
693
|
+
*/
|
|
694
|
+
oldState: string | null;
|
|
695
|
+
/** The state string that will now be returned by `Email/get` on this account. */
|
|
696
|
+
newState: string;
|
|
697
|
+
/**
|
|
698
|
+
* A map of the creation id to an object containing the `id`, `blobId`, `threadId`, and `size`
|
|
699
|
+
* properties for each successfully imported Email, or `null` if none.
|
|
700
|
+
*/
|
|
701
|
+
created: Record<Id, Pick<EmailObject, "id" | "blobId" | "threadId" | "size">> | null;
|
|
702
|
+
/**
|
|
703
|
+
* A map of the creation id to a SetError object for each Email that failed to be created, or
|
|
704
|
+
* `null` if all successful. The possible errors are defined above.
|
|
705
|
+
*/
|
|
706
|
+
notCreated: Record<Id, SetError<"create", "invalidEmail", {
|
|
707
|
+
type: "alreadyExists";
|
|
708
|
+
existingId: Id;
|
|
709
|
+
}>> | null;
|
|
710
|
+
};
|
|
711
|
+
/**
|
|
712
|
+
* The arguments for parsing Email objects via an `Email/parse` call
|
|
713
|
+
*/
|
|
714
|
+
export type EmailParseRequestInvocationArgs = {
|
|
715
|
+
/**
|
|
716
|
+
* The id of the account to use.
|
|
717
|
+
*/
|
|
718
|
+
accountId: Id;
|
|
719
|
+
/**
|
|
720
|
+
* The ids of the blobs to parse.
|
|
721
|
+
*/
|
|
722
|
+
blobIds: Id[];
|
|
723
|
+
/**
|
|
724
|
+
* If supplied, only the properties listed in the array are returned for each
|
|
725
|
+
* Email object. If omitted, defaults to:
|
|
726
|
+
*
|
|
727
|
+
* [ "messageId", "inReplyTo", "references", "sender", "from", "to",
|
|
728
|
+
* "cc", "bcc", "replyTo", "subject", "sentAt", "hasAttachment",
|
|
729
|
+
* "preview", "bodyValues", "textBody", "htmlBody", "attachments" ]`
|
|
730
|
+
*/
|
|
731
|
+
properties?: (keyof EmailObject)[];
|
|
732
|
+
/**
|
|
733
|
+
* A list of properties to fetch for each EmailBodyPart returned. If omitted, defaults to the same value as the Email/get “bodyProperties” default argument.
|
|
734
|
+
*/
|
|
735
|
+
bodyProperties?: string[];
|
|
736
|
+
/**
|
|
737
|
+
* (default: false) If true, the bodyValues property includes any text/* part in the textBody property.
|
|
738
|
+
*/
|
|
739
|
+
fetchTextBodyValues?: boolean;
|
|
740
|
+
/**
|
|
741
|
+
* (default: false) If true, the bodyValues property includes any text/* part in the htmlBody property.
|
|
742
|
+
*/
|
|
743
|
+
fetchHTMLBodyValues?: boolean;
|
|
744
|
+
/**
|
|
745
|
+
* (default: false) If true, the bodyValues property includes any text/* part in the bodyStructure property.
|
|
746
|
+
*/
|
|
747
|
+
fetchAllBodyValues?: boolean;
|
|
748
|
+
/**
|
|
749
|
+
* (default: 0) If greater than zero, the value property of any EmailBodyValue object returned in bodyValues MUST be truncated if necessary so it does not exceed this number of octets in size. If 0 (the default), no truncation occurs.
|
|
750
|
+
*/
|
|
751
|
+
maxBodyValueBytes?: UnsignedInt;
|
|
752
|
+
};
|
|
753
|
+
export type EmailParseResponseInvocationArgs = {
|
|
754
|
+
/** The id of the account used for the call. */
|
|
755
|
+
accountId: Id;
|
|
756
|
+
/**
|
|
757
|
+
* A map of blob id to parsed Email representation for each successfully parsed blob, or null if
|
|
758
|
+
* none.
|
|
759
|
+
*/
|
|
760
|
+
parsed: Record<Id, EmailObject> | null;
|
|
761
|
+
/**
|
|
762
|
+
* A list of ids given that corresponded to blobs that could not be parsed as Emails, or null if
|
|
763
|
+
* none.
|
|
764
|
+
*/
|
|
765
|
+
notParsable: Id[] | null;
|
|
766
|
+
/** A list of blob ids given that could not be found, or null if none. */
|
|
767
|
+
notFound: Id[] | null;
|
|
768
|
+
};
|
|
769
|
+
/**
|
|
770
|
+
* Union type of all Email capability request invocation arguments
|
|
771
|
+
*/
|
|
772
|
+
export type EmailRequestInvocationArgs = EmailGetRequestInvocationArgs | EmailChangesRequestInvocationArgs | EmailQueryRequestInvocationArgs | EmailQueryChangesRequestInvocationArgs | EmailCopyRequestInvocationArgs | EmailSetRequestInvocationArgs | EmailImportRequestInvocationArgs | EmailParseRequestInvocationArgs;
|
|
773
|
+
/**
|
|
774
|
+
* Union type of all Email capability response invocation arguments
|
|
775
|
+
*/
|
|
776
|
+
export type EmailResponseInvocationArgs = EmailGetResponseInvocationArgs | EmailChangesResponseInvocationArgs | EmailQueryResponseInvocationArgs | EmailQueryChangesResponseInvocationArgs | EmailCopyResponseInvocationArgs | EmailSetResponseInvocationArgs | EmailImportResponseInvocationArgs | EmailParseResponseInvocationArgs;
|