@3sixty/mailbox-models 0.0.0-stage → 0.20.0-next.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 +201 -0
- package/README.md +24 -2
- package/dist/es/factories/emailConsumerFactory.js +9 -0
- package/dist/es/factories/emailConsumerFactory.js.map +1 -0
- package/dist/es/factories/emailProtocolConnectorConfigSchemaFactory.js +9 -0
- package/dist/es/factories/emailProtocolConnectorConfigSchemaFactory.js.map +1 -0
- package/dist/es/factories/emailProtocolConnectorFactory.js +9 -0
- package/dist/es/factories/emailProtocolConnectorFactory.js.map +1 -0
- package/dist/es/factories/emailProtocolConnectorStateSchemaFactory.js +11 -0
- package/dist/es/factories/emailProtocolConnectorStateSchemaFactory.js.map +1 -0
- package/dist/es/index.js +44 -0
- package/dist/es/index.js.map +1 -0
- package/dist/es/models/IEmail.js +2 -0
- package/dist/es/models/IEmail.js.map +1 -0
- package/dist/es/models/IEmailAddress.js +4 -0
- package/dist/es/models/IEmailAddress.js.map +1 -0
- package/dist/es/models/IEmailAttachment.js +4 -0
- package/dist/es/models/IEmailAttachment.js.map +1 -0
- package/dist/es/models/IEmailConsumer.js +2 -0
- package/dist/es/models/IEmailConsumer.js.map +1 -0
- package/dist/es/models/IEmailHeader.js +4 -0
- package/dist/es/models/IEmailHeader.js.map +1 -0
- package/dist/es/models/IEmailProtocolConnector.js +2 -0
- package/dist/es/models/IEmailProtocolConnector.js.map +1 -0
- package/dist/es/models/IEmailProtocolConnectorAuthCallback.js +2 -0
- package/dist/es/models/IEmailProtocolConnectorAuthCallback.js.map +1 -0
- package/dist/es/models/IEmailProtocolConnectorAuthState.js +4 -0
- package/dist/es/models/IEmailProtocolConnectorAuthState.js.map +1 -0
- package/dist/es/models/IEmailProtocolConnectorOptions.js +4 -0
- package/dist/es/models/IEmailProtocolConnectorOptions.js.map +1 -0
- package/dist/es/models/IEmailProtocolConnectorRetrievalCallback.js +2 -0
- package/dist/es/models/IEmailProtocolConnectorRetrievalCallback.js.map +1 -0
- package/dist/es/models/IMailStorageComponent.js +2 -0
- package/dist/es/models/IMailStorageComponent.js.map +1 -0
- package/dist/es/models/IMailbox.js +2 -0
- package/dist/es/models/IMailbox.js.map +1 -0
- package/dist/es/models/IMailboxComponent.js +2 -0
- package/dist/es/models/IMailboxComponent.js.map +1 -0
- package/dist/es/models/IMailboxConfigField.js +2 -0
- package/dist/es/models/IMailboxConfigField.js.map +1 -0
- package/dist/es/models/IMailboxCreateResult.js +4 -0
- package/dist/es/models/IMailboxCreateResult.js.map +1 -0
- package/dist/es/models/IMailboxUpdateResult.js +4 -0
- package/dist/es/models/IMailboxUpdateResult.js.map +1 -0
- package/dist/es/models/IStoredEmail.js +2 -0
- package/dist/es/models/IStoredEmail.js.map +1 -0
- package/dist/es/models/api/IMailStorageGetRequest.js +4 -0
- package/dist/es/models/api/IMailStorageGetRequest.js.map +1 -0
- package/dist/es/models/api/IMailStorageGetResponse.js +2 -0
- package/dist/es/models/api/IMailStorageGetResponse.js.map +1 -0
- package/dist/es/models/api/IMailStorageListRequest.js +4 -0
- package/dist/es/models/api/IMailStorageListRequest.js.map +1 -0
- package/dist/es/models/api/IMailStorageListResponse.js +2 -0
- package/dist/es/models/api/IMailStorageListResponse.js.map +1 -0
- package/dist/es/models/api/IMailStorageRemoveRequest.js +4 -0
- package/dist/es/models/api/IMailStorageRemoveRequest.js.map +1 -0
- package/dist/es/models/api/IMailboxCompleteAuthRequest.js +4 -0
- package/dist/es/models/api/IMailboxCompleteAuthRequest.js.map +1 -0
- package/dist/es/models/api/IMailboxConnectorSchemaRequest.js +4 -0
- package/dist/es/models/api/IMailboxConnectorSchemaRequest.js.map +1 -0
- package/dist/es/models/api/IMailboxConnectorSchemaResponse.js +2 -0
- package/dist/es/models/api/IMailboxConnectorSchemaResponse.js.map +1 -0
- package/dist/es/models/api/IMailboxCreateRequest.js +2 -0
- package/dist/es/models/api/IMailboxCreateRequest.js.map +1 -0
- package/dist/es/models/api/IMailboxCreateResponse.js +2 -0
- package/dist/es/models/api/IMailboxCreateResponse.js.map +1 -0
- package/dist/es/models/api/IMailboxGetRequest.js +4 -0
- package/dist/es/models/api/IMailboxGetRequest.js.map +1 -0
- package/dist/es/models/api/IMailboxGetResponse.js +2 -0
- package/dist/es/models/api/IMailboxGetResponse.js.map +1 -0
- package/dist/es/models/api/IMailboxListRequest.js +4 -0
- package/dist/es/models/api/IMailboxListRequest.js.map +1 -0
- package/dist/es/models/api/IMailboxListResponse.js +2 -0
- package/dist/es/models/api/IMailboxListResponse.js.map +1 -0
- package/dist/es/models/api/IMailboxRemoveRequest.js +4 -0
- package/dist/es/models/api/IMailboxRemoveRequest.js.map +1 -0
- package/dist/es/models/api/IMailboxUpdateRequest.js +2 -0
- package/dist/es/models/api/IMailboxUpdateRequest.js.map +1 -0
- package/dist/es/models/api/IMailboxUpdateResponse.js +2 -0
- package/dist/es/models/api/IMailboxUpdateResponse.js.map +1 -0
- package/dist/es/models/mailboxMetricIds.js +13 -0
- package/dist/es/models/mailboxMetricIds.js.map +1 -0
- package/dist/es/models/mailboxMetrics.js +16 -0
- package/dist/es/models/mailboxMetrics.js.map +1 -0
- package/dist/es/utils/mailHelper.js +92 -0
- package/dist/es/utils/mailHelper.js.map +1 -0
- package/dist/types/factories/emailConsumerFactory.d.ts +6 -0
- package/dist/types/factories/emailProtocolConnectorConfigSchemaFactory.d.ts +6 -0
- package/dist/types/factories/emailProtocolConnectorFactory.d.ts +6 -0
- package/dist/types/factories/emailProtocolConnectorStateSchemaFactory.d.ts +8 -0
- package/dist/types/index.d.ts +41 -0
- package/dist/types/models/IEmail.d.ts +80 -0
- package/dist/types/models/IEmailAddress.d.ts +13 -0
- package/dist/types/models/IEmailAttachment.d.ts +17 -0
- package/dist/types/models/IEmailConsumer.d.ts +11 -0
- package/dist/types/models/IEmailHeader.d.ts +17 -0
- package/dist/types/models/IEmailProtocolConnector.d.ts +50 -0
- package/dist/types/models/IEmailProtocolConnectorAuthCallback.d.ts +12 -0
- package/dist/types/models/IEmailProtocolConnectorAuthState.d.ts +12 -0
- package/dist/types/models/IEmailProtocolConnectorOptions.d.ts +19 -0
- package/dist/types/models/IEmailProtocolConnectorRetrievalCallback.d.ts +10 -0
- package/dist/types/models/IMailStorageComponent.d.ts +39 -0
- package/dist/types/models/IMailbox.d.ts +46 -0
- package/dist/types/models/IMailboxComponent.d.ts +71 -0
- package/dist/types/models/IMailboxConfigField.d.ts +30 -0
- package/dist/types/models/IMailboxCreateResult.d.ts +15 -0
- package/dist/types/models/IMailboxUpdateResult.d.ts +11 -0
- package/dist/types/models/IStoredEmail.d.ts +18 -0
- package/dist/types/models/api/IMailStorageGetRequest.d.ts +14 -0
- package/dist/types/models/api/IMailStorageGetResponse.d.ts +10 -0
- package/dist/types/models/api/IMailStorageListRequest.d.ts +26 -0
- package/dist/types/models/api/IMailStorageListResponse.d.ts +19 -0
- package/dist/types/models/api/IMailStorageRemoveRequest.d.ts +14 -0
- package/dist/types/models/api/IMailboxCompleteAuthRequest.d.ts +16 -0
- package/dist/types/models/api/IMailboxConnectorSchemaRequest.d.ts +14 -0
- package/dist/types/models/api/IMailboxConnectorSchemaResponse.d.ts +10 -0
- package/dist/types/models/api/IMailboxCreateRequest.d.ts +10 -0
- package/dist/types/models/api/IMailboxCreateResponse.d.ts +29 -0
- package/dist/types/models/api/IMailboxGetRequest.d.ts +14 -0
- package/dist/types/models/api/IMailboxGetResponse.d.ts +10 -0
- package/dist/types/models/api/IMailboxListRequest.d.ts +18 -0
- package/dist/types/models/api/IMailboxListResponse.d.ts +19 -0
- package/dist/types/models/api/IMailboxRemoveRequest.d.ts +14 -0
- package/dist/types/models/api/IMailboxUpdateRequest.d.ts +19 -0
- package/dist/types/models/api/IMailboxUpdateResponse.d.ts +20 -0
- package/dist/types/models/mailboxMetricIds.d.ts +13 -0
- package/dist/types/models/mailboxMetrics.d.ts +5 -0
- package/dist/types/utils/mailHelper.d.ts +41 -0
- package/docs/changelog.md +0 -0
- package/docs/examples.md +145 -0
- package/docs/reference/classes/MailHelper.md +118 -0
- package/docs/reference/index.md +55 -0
- package/docs/reference/interfaces/IEmail.md +151 -0
- package/docs/reference/interfaces/IEmailAddress.md +19 -0
- package/docs/reference/interfaces/IEmailAttachment.md +27 -0
- package/docs/reference/interfaces/IEmailConsumer.md +21 -0
- package/docs/reference/interfaces/IEmailHeader.md +27 -0
- package/docs/reference/interfaces/IEmailProtocolConnector.md +154 -0
- package/docs/reference/interfaces/IEmailProtocolConnectorAuthState.md +14 -0
- package/docs/reference/interfaces/IEmailProtocolConnectorOptions.md +25 -0
- package/docs/reference/interfaces/IMailStorageComponent.md +119 -0
- package/docs/reference/interfaces/IMailStorageGetRequest.md +17 -0
- package/docs/reference/interfaces/IMailStorageGetResponse.md +11 -0
- package/docs/reference/interfaces/IMailStorageListRequest.md +35 -0
- package/docs/reference/interfaces/IMailStorageListResponse.md +23 -0
- package/docs/reference/interfaces/IMailStorageRemoveRequest.md +17 -0
- package/docs/reference/interfaces/IMailbox.md +97 -0
- package/docs/reference/interfaces/IMailboxCompleteAuthRequest.md +22 -0
- package/docs/reference/interfaces/IMailboxComponent.md +191 -0
- package/docs/reference/interfaces/IMailboxConfigField.md +51 -0
- package/docs/reference/interfaces/IMailboxConnectorSchemaRequest.md +17 -0
- package/docs/reference/interfaces/IMailboxConnectorSchemaResponse.md +11 -0
- package/docs/reference/interfaces/IMailboxCreateRequest.md +11 -0
- package/docs/reference/interfaces/IMailboxCreateResponse.md +40 -0
- package/docs/reference/interfaces/IMailboxCreateResult.md +21 -0
- package/docs/reference/interfaces/IMailboxGetRequest.md +17 -0
- package/docs/reference/interfaces/IMailboxGetResponse.md +11 -0
- package/docs/reference/interfaces/IMailboxListRequest.md +23 -0
- package/docs/reference/interfaces/IMailboxListResponse.md +23 -0
- package/docs/reference/interfaces/IMailboxRemoveRequest.md +17 -0
- package/docs/reference/interfaces/IMailboxUpdateRequest.md +25 -0
- package/docs/reference/interfaces/IMailboxUpdateResponse.md +26 -0
- package/docs/reference/interfaces/IMailboxUpdateResult.md +13 -0
- package/docs/reference/interfaces/IStoredEmail.md +247 -0
- package/docs/reference/type-aliases/IEmailProtocolConnectorAuthCallback.md +48 -0
- package/docs/reference/type-aliases/IEmailProtocolConnectorRetrievalCallback.md +35 -0
- package/docs/reference/type-aliases/MailboxMetricIds.md +5 -0
- package/docs/reference/variables/EmailConsumerFactory.md +5 -0
- package/docs/reference/variables/EmailProtocolConnectorConfigSchemaFactory.md +5 -0
- package/docs/reference/variables/EmailProtocolConnectorFactory.md +5 -0
- package/docs/reference/variables/EmailProtocolConnectorStateSchemaFactory.md +7 -0
- package/docs/reference/variables/MailboxMetricIds.md +13 -0
- package/docs/reference/variables/MailboxMetrics.md +5 -0
- package/locales/en.json +1 -0
- package/package.json +54 -5
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
# Interface: IEmailProtocolConnector\<TState, TAuthState\>
|
|
2
|
+
|
|
3
|
+
Interface describing an email protocol connector that handles message retrieval.
|
|
4
|
+
|
|
5
|
+
## Extends
|
|
6
|
+
|
|
7
|
+
- `IComponent`
|
|
8
|
+
|
|
9
|
+
## Type Parameters
|
|
10
|
+
|
|
11
|
+
### TState
|
|
12
|
+
|
|
13
|
+
`TState` = `unknown`
|
|
14
|
+
|
|
15
|
+
### TAuthState
|
|
16
|
+
|
|
17
|
+
`TAuthState` *extends* [`IEmailProtocolConnectorAuthState`](IEmailProtocolConnectorAuthState.md) = [`IEmailProtocolConnectorAuthState`](IEmailProtocolConnectorAuthState.md)
|
|
18
|
+
|
|
19
|
+
## Methods
|
|
20
|
+
|
|
21
|
+
### retrieve() {#retrieve}
|
|
22
|
+
|
|
23
|
+
> **retrieve**(`instanceId`, `state`, `authCallback`, `retrievalCallback`, `options`): `Promise`\<`void`\>
|
|
24
|
+
|
|
25
|
+
Start the internal polling loop for the given instance.
|
|
26
|
+
|
|
27
|
+
#### Parameters
|
|
28
|
+
|
|
29
|
+
##### instanceId
|
|
30
|
+
|
|
31
|
+
`string`
|
|
32
|
+
|
|
33
|
+
The identifier of the mailbox instance being polled.
|
|
34
|
+
|
|
35
|
+
##### state
|
|
36
|
+
|
|
37
|
+
`TState`
|
|
38
|
+
|
|
39
|
+
The current connector state for the instance.
|
|
40
|
+
|
|
41
|
+
##### authCallback
|
|
42
|
+
|
|
43
|
+
[`IEmailProtocolConnectorAuthCallback`](../type-aliases/IEmailProtocolConnectorAuthCallback.md)\<`TAuthState`\>
|
|
44
|
+
|
|
45
|
+
Callback invoked when authentication fails during a poll cycle.
|
|
46
|
+
|
|
47
|
+
##### retrievalCallback
|
|
48
|
+
|
|
49
|
+
[`IEmailProtocolConnectorRetrievalCallback`](../type-aliases/IEmailProtocolConnectorRetrievalCallback.md)
|
|
50
|
+
|
|
51
|
+
Callback invoked with retrieved messages after each poll cycle.
|
|
52
|
+
|
|
53
|
+
##### options
|
|
54
|
+
|
|
55
|
+
[`IEmailProtocolConnectorOptions`](IEmailProtocolConnectorOptions.md)
|
|
56
|
+
|
|
57
|
+
Options supplied by the owning component.
|
|
58
|
+
|
|
59
|
+
#### Returns
|
|
60
|
+
|
|
61
|
+
`Promise`\<`void`\>
|
|
62
|
+
|
|
63
|
+
A promise that resolves when the polling loop has been started.
|
|
64
|
+
|
|
65
|
+
***
|
|
66
|
+
|
|
67
|
+
### retrieveStop() {#retrievestop}
|
|
68
|
+
|
|
69
|
+
> **retrieveStop**(): `Promise`\<`void`\>
|
|
70
|
+
|
|
71
|
+
Stop the internal polling loop.
|
|
72
|
+
|
|
73
|
+
#### Returns
|
|
74
|
+
|
|
75
|
+
`Promise`\<`void`\>
|
|
76
|
+
|
|
77
|
+
A promise that resolves when the polling loop has been stopped.
|
|
78
|
+
|
|
79
|
+
***
|
|
80
|
+
|
|
81
|
+
### initiateAuth()? {#initiateauth}
|
|
82
|
+
|
|
83
|
+
> `optional` **initiateAuth**(`instanceId`, `state`, `options`): `Promise`\<`TAuthState` \| `undefined`\>
|
|
84
|
+
|
|
85
|
+
Start an authentication flow for a mailbox before it is polled for the first time.
|
|
86
|
+
Only implemented by connectors whose credentials are issued by an external flow, such as
|
|
87
|
+
an OAuth consent redirect, so the caller can hand the flow straight to the operator who
|
|
88
|
+
created the mailbox rather than waiting for the first poll to report it.
|
|
89
|
+
|
|
90
|
+
#### Parameters
|
|
91
|
+
|
|
92
|
+
##### instanceId
|
|
93
|
+
|
|
94
|
+
`string`
|
|
95
|
+
|
|
96
|
+
The identifier of the mailbox instance being authenticated.
|
|
97
|
+
|
|
98
|
+
##### state
|
|
99
|
+
|
|
100
|
+
`TState`
|
|
101
|
+
|
|
102
|
+
The current connector state for the instance, which may already hold credentials.
|
|
103
|
+
|
|
104
|
+
##### options
|
|
105
|
+
|
|
106
|
+
[`IEmailProtocolConnectorOptions`](IEmailProtocolConnectorOptions.md)
|
|
107
|
+
|
|
108
|
+
Options supplied by the owning component, carrying the callback URI the flow
|
|
109
|
+
must return to and the state which correlates it back to the mailbox.
|
|
110
|
+
|
|
111
|
+
#### Returns
|
|
112
|
+
|
|
113
|
+
`Promise`\<`TAuthState` \| `undefined`\>
|
|
114
|
+
|
|
115
|
+
The auth state carrying the URL to open for the user, or undefined when the
|
|
116
|
+
mailbox is already able to authenticate itself.
|
|
117
|
+
|
|
118
|
+
***
|
|
119
|
+
|
|
120
|
+
### completeAuth()? {#completeauth}
|
|
121
|
+
|
|
122
|
+
> `optional` **completeAuth**(`instanceId`, `authPayload`, `options`): `Promise`\<`void`\>
|
|
123
|
+
|
|
124
|
+
Complete an authentication flow the connector reported through its auth callback.
|
|
125
|
+
Only implemented by connectors whose credentials are issued by an external flow, such as
|
|
126
|
+
an OAuth consent redirect. The outcome is reported back through the auth callback the
|
|
127
|
+
connector was given by retrieve, so nothing is returned here.
|
|
128
|
+
|
|
129
|
+
#### Parameters
|
|
130
|
+
|
|
131
|
+
##### instanceId
|
|
132
|
+
|
|
133
|
+
`string`
|
|
134
|
+
|
|
135
|
+
The identifier of the mailbox instance being authenticated.
|
|
136
|
+
|
|
137
|
+
##### authPayload
|
|
138
|
+
|
|
139
|
+
`unknown`
|
|
140
|
+
|
|
141
|
+
The protocol-specific data handed to the redirect, such as an OAuth code.
|
|
142
|
+
|
|
143
|
+
##### options
|
|
144
|
+
|
|
145
|
+
[`IEmailProtocolConnectorOptions`](IEmailProtocolConnectorOptions.md)
|
|
146
|
+
|
|
147
|
+
Options supplied by the owning component, carrying the same callback URI the
|
|
148
|
+
flow was started with.
|
|
149
|
+
|
|
150
|
+
#### Returns
|
|
151
|
+
|
|
152
|
+
`Promise`\<`void`\>
|
|
153
|
+
|
|
154
|
+
A promise that resolves when the flow has been completed.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Interface: IEmailProtocolConnectorAuthState
|
|
2
|
+
|
|
3
|
+
The state a protocol connector produces when a mailbox has to be authenticated by an
|
|
4
|
+
external flow. Connectors which carry more through the flow extend this with their own
|
|
5
|
+
properties, but the URL is named here so callers can open it without knowing the protocol.
|
|
6
|
+
|
|
7
|
+
## Properties
|
|
8
|
+
|
|
9
|
+
### authUrl? {#authurl}
|
|
10
|
+
|
|
11
|
+
> `optional` **authUrl?**: `string`
|
|
12
|
+
|
|
13
|
+
The URL to open for the user to authenticate the mailbox, such as an OAuth consent URL.
|
|
14
|
+
Absent when the connector has no URL to send the user to.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Interface: IEmailProtocolConnectorOptions
|
|
2
|
+
|
|
3
|
+
Options supplied to a protocol connector by the component which owns it.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
### callbackUri? {#callbackuri}
|
|
8
|
+
|
|
9
|
+
> `optional` **callbackUri?**: `string`
|
|
10
|
+
|
|
11
|
+
The fixed URI an external authentication flow returns to, which correlates the response
|
|
12
|
+
back to the mailbox it belongs to. Connectors which start such a flow must send the
|
|
13
|
+
external service to this URI rather than one of their own.
|
|
14
|
+
Absent when the owning component has no public origin recorded for the mailbox, which
|
|
15
|
+
leaves a connector able to poll with the credentials it has but unable to start a flow.
|
|
16
|
+
|
|
17
|
+
***
|
|
18
|
+
|
|
19
|
+
### correlationState {#correlationstate}
|
|
20
|
+
|
|
21
|
+
> **correlationState**: `string`
|
|
22
|
+
|
|
23
|
+
The opaque value a connector must carry through an external authentication flow so the
|
|
24
|
+
response returns to the owning component identifying both the partition and the mailbox.
|
|
25
|
+
It is passed back verbatim, so the component needs no search to correlate the callback.
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
# Interface: IMailStorageComponent
|
|
2
|
+
|
|
3
|
+
Interface describing the mail storage component for persisting and querying received emails.
|
|
4
|
+
|
|
5
|
+
## Extends
|
|
6
|
+
|
|
7
|
+
- `IComponent`
|
|
8
|
+
|
|
9
|
+
## Methods
|
|
10
|
+
|
|
11
|
+
### store() {#store}
|
|
12
|
+
|
|
13
|
+
> **store**(`mailboxId`, `email`): `Promise`\<`string`\>
|
|
14
|
+
|
|
15
|
+
Store an email received from a mailbox.
|
|
16
|
+
|
|
17
|
+
#### Parameters
|
|
18
|
+
|
|
19
|
+
##### mailboxId
|
|
20
|
+
|
|
21
|
+
`string`
|
|
22
|
+
|
|
23
|
+
The identifier of the mailbox that received the email.
|
|
24
|
+
|
|
25
|
+
##### email
|
|
26
|
+
|
|
27
|
+
[`IEmail`](IEmail.md)
|
|
28
|
+
|
|
29
|
+
The email to store.
|
|
30
|
+
|
|
31
|
+
#### Returns
|
|
32
|
+
|
|
33
|
+
`Promise`\<`string`\>
|
|
34
|
+
|
|
35
|
+
The identifier assigned to the stored email.
|
|
36
|
+
|
|
37
|
+
***
|
|
38
|
+
|
|
39
|
+
### get() {#get}
|
|
40
|
+
|
|
41
|
+
> **get**(`id`): `Promise`\<[`IStoredEmail`](IStoredEmail.md)\>
|
|
42
|
+
|
|
43
|
+
Retrieve a stored email by its identifier.
|
|
44
|
+
|
|
45
|
+
#### Parameters
|
|
46
|
+
|
|
47
|
+
##### id
|
|
48
|
+
|
|
49
|
+
`string`
|
|
50
|
+
|
|
51
|
+
The identifier of the stored email.
|
|
52
|
+
|
|
53
|
+
#### Returns
|
|
54
|
+
|
|
55
|
+
`Promise`\<[`IStoredEmail`](IStoredEmail.md)\>
|
|
56
|
+
|
|
57
|
+
The stored email.
|
|
58
|
+
|
|
59
|
+
***
|
|
60
|
+
|
|
61
|
+
### remove() {#remove}
|
|
62
|
+
|
|
63
|
+
> **remove**(`id`): `Promise`\<`void`\>
|
|
64
|
+
|
|
65
|
+
Remove a stored email by its identifier.
|
|
66
|
+
|
|
67
|
+
#### Parameters
|
|
68
|
+
|
|
69
|
+
##### id
|
|
70
|
+
|
|
71
|
+
`string`
|
|
72
|
+
|
|
73
|
+
The identifier of the stored email to remove.
|
|
74
|
+
|
|
75
|
+
#### Returns
|
|
76
|
+
|
|
77
|
+
`Promise`\<`void`\>
|
|
78
|
+
|
|
79
|
+
A promise that resolves when the email has been removed.
|
|
80
|
+
|
|
81
|
+
***
|
|
82
|
+
|
|
83
|
+
### query() {#query}
|
|
84
|
+
|
|
85
|
+
> **query**(`sinceEpoch`, `mailboxId?`, `cursor?`, `limit?`): `Promise`\<\{ `emails`: [`IStoredEmail`](IStoredEmail.md)[]; `cursor?`: `string`; \}\>
|
|
86
|
+
|
|
87
|
+
Query stored emails received at or after a given epoch.
|
|
88
|
+
|
|
89
|
+
#### Parameters
|
|
90
|
+
|
|
91
|
+
##### sinceEpoch
|
|
92
|
+
|
|
93
|
+
`string`
|
|
94
|
+
|
|
95
|
+
The ISO 8601 timestamp to filter emails received at or after.
|
|
96
|
+
|
|
97
|
+
##### mailboxId?
|
|
98
|
+
|
|
99
|
+
`string`
|
|
100
|
+
|
|
101
|
+
An optional mailbox identifier to restrict results to.
|
|
102
|
+
|
|
103
|
+
##### cursor?
|
|
104
|
+
|
|
105
|
+
`string`
|
|
106
|
+
|
|
107
|
+
An optional cursor for paginated results.
|
|
108
|
+
|
|
109
|
+
##### limit?
|
|
110
|
+
|
|
111
|
+
`number`
|
|
112
|
+
|
|
113
|
+
An optional maximum number of results to return.
|
|
114
|
+
|
|
115
|
+
#### Returns
|
|
116
|
+
|
|
117
|
+
`Promise`\<\{ `emails`: [`IStoredEmail`](IStoredEmail.md)[]; `cursor?`: `string`; \}\>
|
|
118
|
+
|
|
119
|
+
A page of stored emails and an optional cursor for the next page.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Interface: IMailStorageGetRequest
|
|
2
|
+
|
|
3
|
+
Request to retrieve a stored email by ID.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
### pathParams {#pathparams}
|
|
8
|
+
|
|
9
|
+
> **pathParams**: `object`
|
|
10
|
+
|
|
11
|
+
The path parameters.
|
|
12
|
+
|
|
13
|
+
#### id
|
|
14
|
+
|
|
15
|
+
> **id**: `string`
|
|
16
|
+
|
|
17
|
+
The identifier of the stored email to retrieve.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Interface: IMailStorageListRequest
|
|
2
|
+
|
|
3
|
+
Request to query stored emails.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
### query {#query}
|
|
8
|
+
|
|
9
|
+
> **query**: `object`
|
|
10
|
+
|
|
11
|
+
The query parameters.
|
|
12
|
+
|
|
13
|
+
#### since
|
|
14
|
+
|
|
15
|
+
> **since**: `string`
|
|
16
|
+
|
|
17
|
+
Return only emails received at or after this ISO 8601 timestamp.
|
|
18
|
+
|
|
19
|
+
#### mailboxId?
|
|
20
|
+
|
|
21
|
+
> `optional` **mailboxId?**: `string`
|
|
22
|
+
|
|
23
|
+
Filter emails by mailbox identifier.
|
|
24
|
+
|
|
25
|
+
#### cursor?
|
|
26
|
+
|
|
27
|
+
> `optional` **cursor?**: `string`
|
|
28
|
+
|
|
29
|
+
The cursor for paginated results.
|
|
30
|
+
|
|
31
|
+
#### limit?
|
|
32
|
+
|
|
33
|
+
> `optional` **limit?**: `string`
|
|
34
|
+
|
|
35
|
+
The maximum number of results to return.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Interface: IMailStorageListResponse
|
|
2
|
+
|
|
3
|
+
Response from querying stored emails.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
### body {#body}
|
|
8
|
+
|
|
9
|
+
> **body**: `object`
|
|
10
|
+
|
|
11
|
+
The result body.
|
|
12
|
+
|
|
13
|
+
#### emails
|
|
14
|
+
|
|
15
|
+
> **emails**: [`IStoredEmail`](IStoredEmail.md)[]
|
|
16
|
+
|
|
17
|
+
The list of stored emails.
|
|
18
|
+
|
|
19
|
+
#### cursor?
|
|
20
|
+
|
|
21
|
+
> `optional` **cursor?**: `string`
|
|
22
|
+
|
|
23
|
+
The cursor for the next page of results.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Interface: IMailStorageRemoveRequest
|
|
2
|
+
|
|
3
|
+
Request to remove a stored email.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
### pathParams {#pathparams}
|
|
8
|
+
|
|
9
|
+
> **pathParams**: `object`
|
|
10
|
+
|
|
11
|
+
The path parameters.
|
|
12
|
+
|
|
13
|
+
#### id
|
|
14
|
+
|
|
15
|
+
> **id**: `string`
|
|
16
|
+
|
|
17
|
+
The identifier of the stored email to remove.
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# Interface: IMailbox\<TConfig, TState, TAuthState\>
|
|
2
|
+
|
|
3
|
+
Interface describing a mailbox configuration.
|
|
4
|
+
|
|
5
|
+
## Type Parameters
|
|
6
|
+
|
|
7
|
+
### TConfig
|
|
8
|
+
|
|
9
|
+
`TConfig` = `unknown`
|
|
10
|
+
|
|
11
|
+
### TState
|
|
12
|
+
|
|
13
|
+
`TState` = `unknown`
|
|
14
|
+
|
|
15
|
+
### TAuthState
|
|
16
|
+
|
|
17
|
+
`TAuthState` = `unknown`
|
|
18
|
+
|
|
19
|
+
## Properties
|
|
20
|
+
|
|
21
|
+
### id {#id}
|
|
22
|
+
|
|
23
|
+
> **id**: `string`
|
|
24
|
+
|
|
25
|
+
The unique identifier for the mailbox.
|
|
26
|
+
|
|
27
|
+
***
|
|
28
|
+
|
|
29
|
+
### name {#name}
|
|
30
|
+
|
|
31
|
+
> **name**: `string`
|
|
32
|
+
|
|
33
|
+
The display name for the mailbox.
|
|
34
|
+
|
|
35
|
+
***
|
|
36
|
+
|
|
37
|
+
### connectorType {#connectortype}
|
|
38
|
+
|
|
39
|
+
> **connectorType**: `string`
|
|
40
|
+
|
|
41
|
+
The connector type identifying which connector handles this mailbox.
|
|
42
|
+
|
|
43
|
+
***
|
|
44
|
+
|
|
45
|
+
### config? {#config}
|
|
46
|
+
|
|
47
|
+
> `optional` **config?**: `TConfig`
|
|
48
|
+
|
|
49
|
+
The connector-owned configuration for this mailbox.
|
|
50
|
+
|
|
51
|
+
***
|
|
52
|
+
|
|
53
|
+
### state? {#state}
|
|
54
|
+
|
|
55
|
+
> `optional` **state?**: `TState`
|
|
56
|
+
|
|
57
|
+
The connector-owned runtime state for this mailbox.
|
|
58
|
+
|
|
59
|
+
***
|
|
60
|
+
|
|
61
|
+
### enabled {#enabled}
|
|
62
|
+
|
|
63
|
+
> **enabled**: `boolean`
|
|
64
|
+
|
|
65
|
+
Whether this mailbox is active and should be polled.
|
|
66
|
+
|
|
67
|
+
***
|
|
68
|
+
|
|
69
|
+
### requiresAuth? {#requiresauth}
|
|
70
|
+
|
|
71
|
+
> `optional` **requiresAuth?**: `boolean`
|
|
72
|
+
|
|
73
|
+
Whether this mailbox is awaiting re-authentication.
|
|
74
|
+
|
|
75
|
+
***
|
|
76
|
+
|
|
77
|
+
### authState? {#authstate}
|
|
78
|
+
|
|
79
|
+
> `optional` **authState?**: `TAuthState`
|
|
80
|
+
|
|
81
|
+
Optional protocol-specific state produced during the auth flow, such as an OAuth URL or code.
|
|
82
|
+
|
|
83
|
+
***
|
|
84
|
+
|
|
85
|
+
### authError? {#autherror}
|
|
86
|
+
|
|
87
|
+
> `optional` **authError?**: `IError`
|
|
88
|
+
|
|
89
|
+
The last error returned by the authentication callback; cleared on successful authentication.
|
|
90
|
+
|
|
91
|
+
***
|
|
92
|
+
|
|
93
|
+
### retrievalError? {#retrievalerror}
|
|
94
|
+
|
|
95
|
+
> `optional` **retrievalError?**: `IError`
|
|
96
|
+
|
|
97
|
+
The last error returned by the retrieval callback; cleared on successful retrieval.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Interface: IMailboxCompleteAuthRequest
|
|
2
|
+
|
|
3
|
+
Request to complete an authentication flow, sent by the external provider redirecting the
|
|
4
|
+
browser to the fixed callback route.
|
|
5
|
+
|
|
6
|
+
## Properties
|
|
7
|
+
|
|
8
|
+
### query {#query}
|
|
9
|
+
|
|
10
|
+
> **query**: `object`
|
|
11
|
+
|
|
12
|
+
The query parameters the provider appends to the callback URI.
|
|
13
|
+
|
|
14
|
+
#### Index Signature
|
|
15
|
+
|
|
16
|
+
\[`propertyKey`: `string`\]: `string`
|
|
17
|
+
|
|
18
|
+
#### state
|
|
19
|
+
|
|
20
|
+
> **state**: `string`
|
|
21
|
+
|
|
22
|
+
The correlating state the connector placed in the external flow.
|