@3sixty/mailbox-models 0.20.0-next.0 → 0.20.0-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/factories/emailConsumerFactory.js.map +1 -1
- package/dist/es/factories/emailProtocolConnectorConfigSchemaFactory.js.map +1 -1
- package/dist/es/factories/emailProtocolConnectorFactory.js.map +1 -1
- package/dist/es/factories/emailProtocolConnectorStateSchemaFactory.js.map +1 -1
- package/dist/es/index.js.map +1 -1
- package/dist/es/models/IEmail.js.map +1 -1
- package/dist/es/models/IEmailAddress.js.map +1 -1
- package/dist/es/models/IEmailAttachment.js.map +1 -1
- package/dist/es/models/IEmailConsumer.js.map +1 -1
- package/dist/es/models/IEmailHeader.js.map +1 -1
- package/dist/es/models/IEmailProtocolConnector.js.map +1 -1
- package/dist/es/models/IEmailProtocolConnectorAuthCallback.js.map +1 -1
- package/dist/es/models/IEmailProtocolConnectorAuthState.js.map +1 -1
- package/dist/es/models/IEmailProtocolConnectorOptions.js.map +1 -1
- package/dist/es/models/IEmailProtocolConnectorRetrievalCallback.js.map +1 -1
- package/dist/es/models/IMailStorageComponent.js.map +1 -1
- package/dist/es/models/IMailbox.js.map +1 -1
- package/dist/es/models/IMailboxComponent.js.map +1 -1
- package/dist/es/models/IMailboxConfigField.js.map +1 -1
- package/dist/es/models/IMailboxCreateResult.js.map +1 -1
- package/dist/es/models/IMailboxUpdateResult.js.map +1 -1
- package/dist/es/models/IStoredEmail.js.map +1 -1
- package/dist/es/models/api/IMailStorageGetRequest.js.map +1 -1
- package/dist/es/models/api/IMailStorageGetResponse.js.map +1 -1
- package/dist/es/models/api/IMailStorageListRequest.js.map +1 -1
- package/dist/es/models/api/IMailStorageListResponse.js.map +1 -1
- package/dist/es/models/api/IMailStorageRemoveRequest.js.map +1 -1
- package/dist/es/models/api/IMailboxCompleteAuthRequest.js.map +1 -1
- package/dist/es/models/api/IMailboxConnectorSchemaRequest.js.map +1 -1
- package/dist/es/models/api/IMailboxConnectorSchemaResponse.js.map +1 -1
- package/dist/es/models/api/IMailboxCreateRequest.js.map +1 -1
- package/dist/es/models/api/IMailboxCreateResponse.js.map +1 -1
- package/dist/es/models/api/IMailboxGetRequest.js.map +1 -1
- package/dist/es/models/api/IMailboxGetResponse.js.map +1 -1
- package/dist/es/models/api/IMailboxListRequest.js.map +1 -1
- package/dist/es/models/api/IMailboxListResponse.js.map +1 -1
- package/dist/es/models/api/IMailboxRemoveRequest.js.map +1 -1
- package/dist/es/models/api/IMailboxUpdateRequest.js.map +1 -1
- package/dist/es/models/api/IMailboxUpdateResponse.js.map +1 -1
- package/dist/es/models/mailboxMetricIds.js.map +1 -1
- package/dist/es/models/mailboxMetrics.js.map +1 -1
- package/dist/es/utils/mailHelper.js.map +1 -1
- package/docs/changelog.md +9 -0
- package/docs/reference/interfaces/IEmailProtocolConnector.md +2 -2
- package/docs/reference/interfaces/IMailbox.md +3 -3
- package/docs/reference/type-aliases/IEmailProtocolConnectorAuthCallback.md +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emailConsumerFactory.js","
|
|
1
|
+
{"version":3,"file":"emailConsumerFactory.js","sources":["../../../src/factories/emailConsumerFactory.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAGvC;;GAEG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,oBAAoB,GAAG,OAAO,CAAC,aAAa,CAAiB,gBAAgB,CAAC,CAAC","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { Factory } from \"@3sixty/core\";\nimport type { IEmailConsumer } from \"../models/IEmailConsumer.js\";\n\n/**\n * Factory for creating email consumer instances.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const EmailConsumerFactory = Factory.createFactory<IEmailConsumer>(\"email-consumer\");\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emailProtocolConnectorConfigSchemaFactory.js","
|
|
1
|
+
{"version":3,"file":"emailProtocolConnectorConfigSchemaFactory.js","sources":["../../../src/factories/emailProtocolConnectorConfigSchemaFactory.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAGvC;;GAEG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,yCAAyC,GAAG,OAAO,CAAC,aAAa,CAE5E,8BAA8B,CAAC,CAAC","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { Factory } from \"@3sixty/core\";\nimport type { IMailboxConfigField } from \"../models/IMailboxConfigField.js\";\n\n/**\n * Factory for retrieving email protocol connector configuration field definitions.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const EmailProtocolConnectorConfigSchemaFactory = Factory.createFactory<\n\tIMailboxConfigField[]\n>(\"email-protocol-config-schema\");\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emailProtocolConnectorFactory.js","
|
|
1
|
+
{"version":3,"file":"emailProtocolConnectorFactory.js","sources":["../../../src/factories/emailProtocolConnectorFactory.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAGvC;;GAEG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,6BAA6B,GACzC,OAAO,CAAC,aAAa,CAA0B,gBAAgB,CAAC,CAAC","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { Factory } from \"@3sixty/core\";\nimport type { IEmailProtocolConnector } from \"../models/IEmailProtocolConnector.js\";\n\n/**\n * Factory for creating email protocol connectors.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const EmailProtocolConnectorFactory =\n\tFactory.createFactory<IEmailProtocolConnector>(\"email-protocol\");\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emailProtocolConnectorStateSchemaFactory.js","
|
|
1
|
+
{"version":3,"file":"emailProtocolConnectorStateSchemaFactory.js","sources":["../../../src/factories/emailProtocolConnectorStateSchemaFactory.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAGvC;;;;GAIG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,wCAAwC,GAAG,OAAO,CAAC,aAAa,CAE3E,6BAA6B,CAAC,CAAC","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { Factory } from \"@3sixty/core\";\nimport type { IMailboxConfigField } from \"../models/IMailboxConfigField.js\";\n\n/**\n * Factory for retrieving email protocol connector state field definitions.\n * Only the properties a connector holds in its runtime state need registering here, and the ones\n * marked secure are stored in the vault instead of alongside the rest of the state.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const EmailProtocolConnectorStateSchemaFactory = Factory.createFactory<\n\tIMailboxConfigField[]\n>(\"email-protocol-state-schema\");\n"]}
|
package/dist/es/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,cAAc,qCAAqC,CAAC;AACpD,cAAc,8CAA8C,CAAC;AAC7D,cAAc,0DAA0D,CAAC;AACzE,cAAc,yDAAyD,CAAC;AACxE,cAAc,6CAA6C,CAAC;AAC5D,cAAc,gDAAgD,CAAC;AAC/D,cAAc,iDAAiD,CAAC;AAChE,cAAc,uCAAuC,CAAC;AACtD,cAAc,wCAAwC,CAAC;AACvD,cAAc,oCAAoC,CAAC;AACnD,cAAc,qCAAqC,CAAC;AACpD,cAAc,qCAAqC,CAAC;AACpD,cAAc,sCAAsC,CAAC;AACrD,cAAc,uCAAuC,CAAC;AACtD,cAAc,uCAAuC,CAAC;AACtD,cAAc,wCAAwC,CAAC;AACvD,cAAc,wCAAwC,CAAC;AACvD,cAAc,yCAAyC,CAAC;AACxD,cAAc,yCAAyC,CAAC;AACxD,cAAc,0CAA0C,CAAC;AACzD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qCAAqC,CAAC;AACpD,cAAc,iDAAiD,CAAC;AAChE,cAAc,8CAA8C,CAAC;AAC7D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,sDAAsD,CAAC;AACrE,cAAc,sBAAsB,CAAC;AACrC,cAAc,kCAAkC,CAAC;AACjD,cAAc,kCAAkC,CAAC;AACjD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iCAAiC,CAAC;AAChD,cAAc,mCAAmC,CAAC;AAClD,cAAc,0BAA0B,CAAC;AACzC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nexport * from \"./factories/emailConsumerFactory.js\";\nexport * from \"./factories/emailProtocolConnectorFactory.js\";\nexport * from \"./factories/emailProtocolConnectorConfigSchemaFactory.js\";\nexport * from \"./factories/emailProtocolConnectorStateSchemaFactory.js\";\nexport * from \"./models/api/IMailboxCompleteAuthRequest.js\";\nexport * from \"./models/api/IMailboxConnectorSchemaRequest.js\";\nexport * from \"./models/api/IMailboxConnectorSchemaResponse.js\";\nexport * from \"./models/api/IMailboxCreateRequest.js\";\nexport * from \"./models/api/IMailboxCreateResponse.js\";\nexport * from \"./models/api/IMailboxGetRequest.js\";\nexport * from \"./models/api/IMailboxGetResponse.js\";\nexport * from \"./models/api/IMailboxListRequest.js\";\nexport * from \"./models/api/IMailboxListResponse.js\";\nexport * from \"./models/api/IMailboxRemoveRequest.js\";\nexport * from \"./models/api/IMailboxUpdateRequest.js\";\nexport * from \"./models/api/IMailboxUpdateResponse.js\";\nexport * from \"./models/api/IMailStorageGetRequest.js\";\nexport * from \"./models/api/IMailStorageGetResponse.js\";\nexport * from \"./models/api/IMailStorageListRequest.js\";\nexport * from \"./models/api/IMailStorageListResponse.js\";\nexport * from \"./models/api/IMailStorageRemoveRequest.js\";\nexport * from \"./models/IEmail.js\";\nexport * from \"./models/IEmailAddress.js\";\nexport * from \"./models/IEmailAttachment.js\";\nexport * from \"./models/IEmailHeader.js\";\nexport * from \"./models/IEmailConsumer.js\";\nexport * from \"./models/IEmailProtocolConnector.js\";\nexport * from \"./models/IEmailProtocolConnectorAuthCallback.js\";\nexport * from \"./models/IEmailProtocolConnectorAuthState.js\";\nexport * from \"./models/IEmailProtocolConnectorOptions.js\";\nexport * from \"./models/IEmailProtocolConnectorRetrievalCallback.js\";\nexport * from \"./models/IMailbox.js\";\nexport * from \"./models/IMailboxCreateResult.js\";\nexport * from \"./models/IMailboxUpdateResult.js\";\nexport * from \"./models/IMailboxComponent.js\";\nexport * from \"./models/IMailboxConfigField.js\";\nexport * from \"./models/IMailStorageComponent.js\";\nexport * from \"./models/IStoredEmail.js\";\nexport * from \"./models/mailboxMetricIds.js\";\nexport * from \"./models/mailboxMetrics.js\";\nexport * from \"./utils/mailHelper.js\";\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IEmail.js","
|
|
1
|
+
{"version":3,"file":"IEmail.js","sources":["../../../src/models/IEmail.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IEmailAddress } from \"./IEmailAddress.js\";\nimport type { IEmailAttachment } from \"./IEmailAttachment.js\";\nimport type { IEmailHeader } from \"./IEmailHeader.js\";\n\n/**\n * Interface describing a normalised email message at the connector boundary.\n */\nexport interface IEmail {\n\t/**\n\t * The parsed message headers.\n\t */\n\theaders?: IEmailHeader[];\n\n\t/**\n\t * The unique message identifier.\n\t */\n\tmessageId?: string;\n\n\t/**\n\t * The sender address (From header).\n\t */\n\tfrom?: IEmailAddress;\n\n\t/**\n\t * The Sender header address, when different from From.\n\t */\n\tsender?: IEmailAddress;\n\n\t/**\n\t * The primary recipient addresses.\n\t */\n\tto?: IEmailAddress[];\n\n\t/**\n\t * The carbon-copy recipient addresses.\n\t */\n\tcc?: IEmailAddress[];\n\n\t/**\n\t * The blind carbon-copy recipient addresses.\n\t */\n\tbcc?: IEmailAddress[];\n\n\t/**\n\t * The reply-to addresses.\n\t */\n\treplyTo?: IEmailAddress[];\n\n\t/**\n\t * The final delivery address from the Delivered-To header.\n\t */\n\tdeliveredTo?: string;\n\n\t/**\n\t * The Return-Path address.\n\t */\n\treturnPath?: string;\n\n\t/**\n\t * The Message-ID this message is a reply to.\n\t */\n\tinReplyTo?: string;\n\n\t/**\n\t * The space-separated list of related message identifiers.\n\t */\n\treferences?: string;\n\n\t/**\n\t * The message subject.\n\t */\n\tsubject?: string;\n\n\t/**\n\t * The message date as an ISO 8601 string.\n\t */\n\tdate?: string;\n\n\t/**\n\t * The plain-text body of the message.\n\t */\n\ttextContent?: string;\n\n\t/**\n\t * The HTML body of the message.\n\t */\n\thtmlContent?: string;\n\n\t/**\n\t * The attachments included with the message.\n\t */\n\tattachments?: IEmailAttachment[];\n\n\t/**\n\t * Protocol-level flags on the message, for example \\\\Seen.\n\t */\n\tflags?: string[];\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IEmailAddress.js","
|
|
1
|
+
{"version":3,"file":"IEmailAddress.js","sources":["../../../src/models/IEmailAddress.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Interface describing an email address with an optional display name.\n */\nexport interface IEmailAddress {\n\t/**\n\t * The display name for the address.\n\t */\n\tname?: string;\n\n\t/**\n\t * The email address.\n\t */\n\taddress: string;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IEmailAttachment.js","
|
|
1
|
+
{"version":3,"file":"IEmailAttachment.js","sources":["../../../src/models/IEmailAttachment.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Interface describing an email attachment.\n */\nexport interface IEmailAttachment {\n\t/**\n\t * The filename of the attachment.\n\t */\n\tfilename?: string;\n\n\t/**\n\t * The MIME content type of the attachment.\n\t */\n\tcontentType: string;\n\n\t/**\n\t * The attachment data encoded as a base64 string.\n\t */\n\tdata: string;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IEmailConsumer.js","
|
|
1
|
+
{"version":3,"file":"IEmailConsumer.js","sources":["../../../src/models/IEmailConsumer.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IComponent } from \"@3sixty/core\";\n\n/**\n * Interface describing a consumer that is notified when new emails are available.\n */\nexport interface IEmailConsumer extends IComponent {\n\t/**\n\t * Called when new emails have been stored, prompting the consumer to query for them.\n\t * @returns A promise that resolves when the consumer has processed the notification.\n\t */\n\tonNewMessages(): Promise<void>;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IEmailHeader.js","
|
|
1
|
+
{"version":3,"file":"IEmailHeader.js","sources":["../../../src/models/IEmailHeader.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Interface describing a single parsed email header.\n */\nexport interface IEmailHeader {\n\t/**\n\t * The lowercase header name.\n\t */\n\tkey: string;\n\n\t/**\n\t * The original header name preserving case.\n\t */\n\toriginalKey: string;\n\n\t/**\n\t * The header value.\n\t */\n\tvalue: string;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IEmailProtocolConnector.js","
|
|
1
|
+
{"version":3,"file":"IEmailProtocolConnector.js","sources":["../../../src/models/IEmailProtocolConnector.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IComponent } from \"@3sixty/core\";\nimport type { IEmailProtocolConnectorAuthCallback } from \"./IEmailProtocolConnectorAuthCallback.js\";\nimport type { IEmailProtocolConnectorAuthState } from \"./IEmailProtocolConnectorAuthState.js\";\nimport type { IEmailProtocolConnectorOptions } from \"./IEmailProtocolConnectorOptions.js\";\nimport type { IEmailProtocolConnectorRetrievalCallback } from \"./IEmailProtocolConnectorRetrievalCallback.js\";\n\n/**\n * Interface describing an email protocol connector that handles message retrieval.\n */\nexport interface IEmailProtocolConnector<\n\tTState = unknown,\n\tTAuthState extends IEmailProtocolConnectorAuthState = IEmailProtocolConnectorAuthState\n> extends IComponent {\n\t/**\n\t * Start the internal polling loop for the given instance.\n\t * @param instanceId The identifier of the mailbox instance being polled.\n\t * @param state The current connector state for the instance.\n\t * @param authCallback Callback invoked when authentication fails during a poll cycle.\n\t * @param retrievalCallback Callback invoked with retrieved messages after each poll cycle.\n\t * @param options Options supplied by the owning component.\n\t * @returns A promise that resolves when the polling loop has been started.\n\t */\n\tretrieve(\n\t\tinstanceId: string,\n\t\tstate: TState,\n\t\tauthCallback: IEmailProtocolConnectorAuthCallback<TAuthState>,\n\t\tretrievalCallback: IEmailProtocolConnectorRetrievalCallback,\n\t\toptions: IEmailProtocolConnectorOptions\n\t): Promise<void>;\n\n\t/**\n\t * Stop the internal polling loop.\n\t * @returns A promise that resolves when the polling loop has been stopped.\n\t */\n\tretrieveStop(): Promise<void>;\n\n\t/**\n\t * Start an authentication flow for a mailbox before it is polled for the first time.\n\t * Only implemented by connectors whose credentials are issued by an external flow, such as\n\t * an OAuth consent redirect, so the caller can hand the flow straight to the operator who\n\t * created the mailbox rather than waiting for the first poll to report it.\n\t * @param instanceId The identifier of the mailbox instance being authenticated.\n\t * @param state The current connector state for the instance, which may already hold credentials.\n\t * @param options Options supplied by the owning component, carrying the callback URI the flow\n\t * must return to and the state which correlates it back to the mailbox.\n\t * @returns The auth state carrying the URL to open for the user, or undefined when the\n\t * mailbox is already able to authenticate itself.\n\t */\n\tinitiateAuth?(\n\t\tinstanceId: string,\n\t\tstate: TState,\n\t\toptions: IEmailProtocolConnectorOptions\n\t): Promise<TAuthState | undefined>;\n\n\t/**\n\t * Complete an authentication flow the connector reported through its auth callback.\n\t * Only implemented by connectors whose credentials are issued by an external flow, such as\n\t * an OAuth consent redirect. The outcome is reported back through the auth callback the\n\t * connector was given by retrieve, so nothing is returned here.\n\t * @param instanceId The identifier of the mailbox instance being authenticated.\n\t * @param authPayload The protocol-specific data handed to the redirect, such as an OAuth code.\n\t * @param options Options supplied by the owning component, carrying the same callback URI the\n\t * flow was started with.\n\t * @returns A promise that resolves when the flow has been completed.\n\t */\n\tcompleteAuth?(\n\t\tinstanceId: string,\n\t\tauthPayload: unknown,\n\t\toptions: IEmailProtocolConnectorOptions\n\t): Promise<void>;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IEmailProtocolConnectorAuthCallback.js","
|
|
1
|
+
{"version":3,"file":"IEmailProtocolConnectorAuthCallback.js","sources":["../../../src/models/IEmailProtocolConnectorAuthCallback.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IError } from \"@3sixty/core\";\nimport type { IEmailProtocolConnectorAuthState } from \"./IEmailProtocolConnectorAuthState.js\";\n\n/**\n * Callback invoked by a protocol connector to report the outcome of an authentication attempt.\n * @param mailboxId The identifier of the mailbox this authentication attempt belongs to.\n * @param updatedState Optional connector state to persist on the mailbox entity, carrying any\n * credentials the flow issued in the properties the connector state schema marks as secure.\n * @param requiresAuth True if authentication failed due to invalid or expired credentials.\n * @param authState Optional state produced during the auth flow, carrying the URL to open.\n * @param authError Optional structured error covering all failure types (auth, connection, timeout, etc.).\n */\nexport type IEmailProtocolConnectorAuthCallback<\n\tTAuthState extends IEmailProtocolConnectorAuthState = IEmailProtocolConnectorAuthState\n> = (\n\tmailboxId: string,\n\tupdatedState: unknown | undefined,\n\trequiresAuth: boolean,\n\tauthState?: TAuthState,\n\tauthError?: IError\n) => Promise<void>;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IEmailProtocolConnectorAuthState.js","
|
|
1
|
+
{"version":3,"file":"IEmailProtocolConnectorAuthState.js","sources":["../../../src/models/IEmailProtocolConnectorAuthState.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * The state a protocol connector produces when a mailbox has to be authenticated by an\n * external flow. Connectors which carry more through the flow extend this with their own\n * properties, but the URL is named here so callers can open it without knowing the protocol.\n */\nexport interface IEmailProtocolConnectorAuthState {\n\t/**\n\t * The URL to open for the user to authenticate the mailbox, such as an OAuth consent URL.\n\t * Absent when the connector has no URL to send the user to.\n\t */\n\tauthUrl?: string;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IEmailProtocolConnectorOptions.js","
|
|
1
|
+
{"version":3,"file":"IEmailProtocolConnectorOptions.js","sources":["../../../src/models/IEmailProtocolConnectorOptions.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Options supplied to a protocol connector by the component which owns it.\n */\nexport interface IEmailProtocolConnectorOptions {\n\t/**\n\t * The fixed URI an external authentication flow returns to, which correlates the response\n\t * back to the mailbox it belongs to. Connectors which start such a flow must send the\n\t * external service to this URI rather than one of their own.\n\t * Absent when the owning component has no public origin recorded for the mailbox, which\n\t * leaves a connector able to poll with the credentials it has but unable to start a flow.\n\t */\n\tcallbackUri?: string;\n\n\t/**\n\t * The opaque value a connector must carry through an external authentication flow so the\n\t * response returns to the owning component identifying both the partition and the mailbox.\n\t * It is passed back verbatim, so the component needs no search to correlate the callback.\n\t */\n\tcorrelationState: string;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IEmailProtocolConnectorRetrievalCallback.js","
|
|
1
|
+
{"version":3,"file":"IEmailProtocolConnectorRetrievalCallback.js","sources":["../../../src/models/IEmailProtocolConnectorRetrievalCallback.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IError } from \"@3sixty/core\";\nimport type { IEmail } from \"./IEmail.js\";\n\n/**\n * Callback invoked by a protocol connector to persist a single retrieved message.\n * @param mailboxId The identifier of the mailbox this retrieval belongs to.\n * @param message The message to persist.\n * @param updatedState The connector state to persist on the mailbox entity after this message.\n * @returns True if the message was persisted successfully; false causes the connector to exit the polling loop.\n */\nexport type IEmailProtocolConnectorRetrievalCallback = (\n\tmailboxId: string,\n\tmessage: IEmail | undefined,\n\tupdatedState: unknown,\n\tretrievalError?: IError\n) => Promise<boolean>;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IMailStorageComponent.js","
|
|
1
|
+
{"version":3,"file":"IMailStorageComponent.js","sources":["../../../src/models/IMailStorageComponent.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IComponent } from \"@3sixty/core\";\nimport type { IEmail } from \"./IEmail.js\";\nimport type { IStoredEmail } from \"./IStoredEmail.js\";\n\n/**\n * Interface describing the mail storage component for persisting and querying received emails.\n */\nexport interface IMailStorageComponent extends IComponent {\n\t/**\n\t * Store an email received from a mailbox.\n\t * @param mailboxId The identifier of the mailbox that received the email.\n\t * @param email The email to store.\n\t * @returns The identifier assigned to the stored email.\n\t */\n\tstore(mailboxId: string, email: IEmail): Promise<string>;\n\n\t/**\n\t * Retrieve a stored email by its identifier.\n\t * @param id The identifier of the stored email.\n\t * @returns The stored email.\n\t */\n\tget(id: string): Promise<IStoredEmail>;\n\n\t/**\n\t * Remove a stored email by its identifier.\n\t * @param id The identifier of the stored email to remove.\n\t * @returns A promise that resolves when the email has been removed.\n\t */\n\tremove(id: string): Promise<void>;\n\n\t/**\n\t * Query stored emails received at or after a given epoch.\n\t * @param sinceEpoch The ISO 8601 timestamp to filter emails received at or after.\n\t * @param mailboxId An optional mailbox identifier to restrict results to.\n\t * @param cursor An optional cursor for paginated results.\n\t * @param limit An optional maximum number of results to return.\n\t * @returns A page of stored emails and an optional cursor for the next page.\n\t */\n\tquery(\n\t\tsinceEpoch: string,\n\t\tmailboxId?: string,\n\t\tcursor?: string,\n\t\tlimit?: number\n\t): Promise<{ emails: IStoredEmail[]; cursor?: string }>;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IMailbox.js","
|
|
1
|
+
{"version":3,"file":"IMailbox.js","sources":["../../../src/models/IMailbox.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IError } from \"@3sixty/core\";\n\n/**\n * Interface describing a mailbox configuration.\n */\nexport interface IMailbox<TConfig = unknown, TState = unknown, TAuthState = unknown> {\n\t/**\n\t * The unique identifier for the mailbox.\n\t */\n\tid: string;\n\n\t/**\n\t * The display name for the mailbox.\n\t */\n\tname: string;\n\n\t/**\n\t * The connector type identifying which connector handles this mailbox.\n\t */\n\tconnectorType: string;\n\n\t/**\n\t * The connector-owned configuration for this mailbox.\n\t */\n\tconfig?: TConfig;\n\n\t/**\n\t * The connector-owned runtime state for this mailbox.\n\t */\n\tstate?: TState;\n\n\t/**\n\t * Whether this mailbox is active and should be polled.\n\t */\n\tenabled: boolean;\n\n\t/**\n\t * Whether this mailbox is awaiting re-authentication.\n\t */\n\trequiresAuth?: boolean;\n\n\t/**\n\t * Optional protocol-specific state produced during the auth flow, such as an OAuth URL or code.\n\t */\n\tauthState?: TAuthState;\n\n\t/**\n\t * The last error returned by the authentication callback; cleared on successful authentication.\n\t */\n\tauthError?: IError;\n\n\t/**\n\t * The last error returned by the retrieval callback; cleared on successful retrieval.\n\t */\n\tretrievalError?: IError;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IMailboxComponent.js","
|
|
1
|
+
{"version":3,"file":"IMailboxComponent.js","sources":["../../../src/models/IMailboxComponent.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IComponent } from \"@3sixty/core\";\nimport type { IMailbox } from \"./IMailbox.js\";\nimport type { IMailboxConfigField } from \"./IMailboxConfigField.js\";\nimport type { IMailboxCreateResult } from \"./IMailboxCreateResult.js\";\nimport type { IMailboxUpdateResult } from \"./IMailboxUpdateResult.js\";\n\n/**\n * Interface describing the mailbox management component.\n */\nexport interface IMailboxComponent extends IComponent {\n\t/**\n\t * Create a new mailbox and begin polling for it.\n\t * Connectors whose credentials are issued by an external flow are asked to start it here, so\n\t * the URL the user has to open is returned to the caller which created the mailbox instead of\n\t * only surfacing once the first poll has run.\n\t * @param mailbox The mailbox configuration to create.\n\t * @returns The identifier assigned to the new mailbox, with the URL to open when the mailbox\n\t * must be authenticated before it can be polled.\n\t */\n\tcreateMailbox(\n\t\tmailbox: Pick<IMailbox, \"name\" | \"connectorType\" | \"config\" | \"enabled\">\n\t): Promise<IMailboxCreateResult>;\n\n\t/**\n\t * Update an existing mailbox.\n\t * An update replaces the credentials the mailbox authenticates with, so a connector whose\n\t * credentials are issued by an external flow is asked to start a new one, and the URL the\n\t * user has to open is returned the same way it is when the mailbox is created.\n\t * @param mailbox The updated mailbox configuration.\n\t * @returns The URL to open when the mailbox must be authenticated before it can be polled.\n\t */\n\tupdateMailbox(mailbox: IMailbox): Promise<IMailboxUpdateResult>;\n\n\t/**\n\t * Remove a mailbox and stop polling for it.\n\t * @param id The identifier of the mailbox to remove.\n\t * @returns A promise that resolves when the mailbox has been removed.\n\t */\n\tremoveMailbox(id: string): Promise<void>;\n\n\t/**\n\t * Retrieve a mailbox by its identifier.\n\t * @param id The identifier of the mailbox to retrieve.\n\t * @returns The mailbox.\n\t */\n\tgetMailbox(id: string): Promise<IMailbox>;\n\n\t/**\n\t * List all mailboxes with optional cursor-based pagination.\n\t * @param cursor An optional cursor for paginated results.\n\t * @param limit An optional maximum number of results to return.\n\t * @returns A page of mailboxes and an optional cursor for the next page.\n\t */\n\tlistMailboxes(\n\t\tcursor?: string,\n\t\tlimit?: number\n\t): Promise<{ mailboxes: IMailbox[]; cursor?: string }>;\n\n\t/**\n\t * Complete an authentication flow for a mailbox awaiting authentication.\n\t * The mailbox is correlated from the payload's state property, which the connector placed in\n\t * the external flow when it produced its auth state, and which names the partition as well as\n\t * the mailbox. The connector exchanges the payload for its credentials, which are stored on\n\t * the mailbox state, and polling restarts.\n\t * @param authPayload The data handed to the callback URI, carrying the correlating state.\n\t * @returns A promise that resolves when the mailbox has been authenticated.\n\t * @throws NotFoundError if the correlated mailbox does not exist.\n\t * @throws GeneralError if the mailbox is not awaiting authentication, or its connector has no\n\t * authentication flow.\n\t */\n\tcompleteAuth(authPayload: unknown): Promise<void>;\n\n\t/**\n\t * Get the configuration schema for a connector type.\n\t * @param connectorType The connector type to get the schema for.\n\t * @returns The configuration field definitions for the connector.\n\t * @throws NotFoundError if no schema is registered for the connector type.\n\t */\n\tgetSchema(connectorType: string): Promise<IMailboxConfigField[]>;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IMailboxConfigField.js","
|
|
1
|
+
{"version":3,"file":"IMailboxConfigField.js","sources":["../../../src/models/IMailboxConfigField.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { EntitySchemaPropertyType } from \"@3sixty/entity\";\n\n/**\n * Interface describing a single configuration field for a protocol connector.\n */\nexport interface IMailboxConfigField {\n\t/**\n\t * The i18n key for the field label shown in the UI.\n\t */\n\tlabelKey: string;\n\n\t/**\n\t * The key of the property within the connector config object.\n\t */\n\tpropertyKey: string;\n\n\t/**\n\t * The entity schema property type for this field.\n\t */\n\ttype: EntitySchemaPropertyType;\n\n\t/**\n\t * Whether this field holds a sensitive value that should be stored in the vault.\n\t */\n\tisSecure?: boolean;\n\n\t/**\n\t * The element type when `type` is `Array`.\n\t */\n\titemType?: EntitySchemaPropertyType;\n\n\t/**\n\t * An optional default value for the field.\n\t */\n\tdefaultValue?: unknown;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IMailboxCreateResult.js","
|
|
1
|
+
{"version":3,"file":"IMailboxCreateResult.js","sources":["../../../src/models/IMailboxCreateResult.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * The outcome of creating a mailbox.\n */\nexport interface IMailboxCreateResult {\n\t/**\n\t * The identifier assigned to the new mailbox.\n\t */\n\tid: string;\n\n\t/**\n\t * The URL to open for the user when the mailbox cannot be polled until an external\n\t * authentication flow has completed, such as an OAuth consent URL. Absent when the supplied\n\t * configuration is already sufficient to poll the mailbox.\n\t */\n\tauthUrl?: string;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IMailboxUpdateResult.js","
|
|
1
|
+
{"version":3,"file":"IMailboxUpdateResult.js","sources":["../../../src/models/IMailboxUpdateResult.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * The outcome of updating a mailbox.\n */\nexport interface IMailboxUpdateResult {\n\t/**\n\t * The URL to open for the user when the updated mailbox cannot be polled until an external\n\t * authentication flow has completed, such as an OAuth consent URL. Absent when the updated\n\t * configuration is already sufficient to poll the mailbox.\n\t */\n\tauthUrl?: string;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IStoredEmail.js","
|
|
1
|
+
{"version":3,"file":"IStoredEmail.js","sources":["../../../src/models/IStoredEmail.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IEmail } from \"./IEmail.js\";\n\n/**\n * Interface describing an email message persisted by the mail storage component.\n */\nexport interface IStoredEmail extends IEmail {\n\t/**\n\t * The storage entity identifier.\n\t */\n\tid: string;\n\n\t/**\n\t * The identifier of the mailbox that received the message.\n\t */\n\tmailboxId: string;\n\n\t/**\n\t * The ISO 8601 timestamp when the message was stored.\n\t */\n\treceivedAt: string;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IMailStorageGetRequest.js","
|
|
1
|
+
{"version":3,"file":"IMailStorageGetRequest.js","sources":["../../../../src/models/api/IMailStorageGetRequest.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Request to retrieve a stored email by ID.\n */\nexport interface IMailStorageGetRequest {\n\t/**\n\t * The path parameters.\n\t */\n\tpathParams: {\n\t\t/**\n\t\t * The identifier of the stored email to retrieve.\n\t\t */\n\t\tid: string;\n\t};\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IMailStorageGetResponse.js","
|
|
1
|
+
{"version":3,"file":"IMailStorageGetResponse.js","sources":["../../../../src/models/api/IMailStorageGetResponse.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IStoredEmail } from \"../IStoredEmail.js\";\n\n/**\n * Response from retrieving a stored email.\n */\nexport interface IMailStorageGetResponse {\n\t/**\n\t * The retrieved stored email.\n\t */\n\tbody: IStoredEmail;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IMailStorageListRequest.js","
|
|
1
|
+
{"version":3,"file":"IMailStorageListRequest.js","sources":["../../../../src/models/api/IMailStorageListRequest.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Request to query stored emails.\n */\nexport interface IMailStorageListRequest {\n\t/**\n\t * The query parameters.\n\t */\n\tquery: {\n\t\t/**\n\t\t * Return only emails received at or after this ISO 8601 timestamp.\n\t\t */\n\t\tsince: string;\n\n\t\t/**\n\t\t * Filter emails by mailbox identifier.\n\t\t */\n\t\tmailboxId?: string;\n\n\t\t/**\n\t\t * The cursor for paginated results.\n\t\t */\n\t\tcursor?: string;\n\n\t\t/**\n\t\t * The maximum number of results to return.\n\t\t */\n\t\tlimit?: string;\n\t};\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IMailStorageListResponse.js","
|
|
1
|
+
{"version":3,"file":"IMailStorageListResponse.js","sources":["../../../../src/models/api/IMailStorageListResponse.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IStoredEmail } from \"../IStoredEmail.js\";\n\n/**\n * Response from querying stored emails.\n */\nexport interface IMailStorageListResponse {\n\t/**\n\t * The result body.\n\t */\n\tbody: {\n\t\t/**\n\t\t * The list of stored emails.\n\t\t */\n\t\temails: IStoredEmail[];\n\n\t\t/**\n\t\t * The cursor for the next page of results.\n\t\t */\n\t\tcursor?: string;\n\t};\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IMailStorageRemoveRequest.js","
|
|
1
|
+
{"version":3,"file":"IMailStorageRemoveRequest.js","sources":["../../../../src/models/api/IMailStorageRemoveRequest.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Request to remove a stored email.\n */\nexport interface IMailStorageRemoveRequest {\n\t/**\n\t * The path parameters.\n\t */\n\tpathParams: {\n\t\t/**\n\t\t * The identifier of the stored email to remove.\n\t\t */\n\t\tid: string;\n\t};\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IMailboxCompleteAuthRequest.js","
|
|
1
|
+
{"version":3,"file":"IMailboxCompleteAuthRequest.js","sources":["../../../../src/models/api/IMailboxCompleteAuthRequest.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Request to complete an authentication flow, sent by the external provider redirecting the\n * browser to the fixed callback route.\n */\nexport interface IMailboxCompleteAuthRequest {\n\t/**\n\t * The query parameters the provider appends to the callback URI.\n\t */\n\tquery: {\n\t\t[propertyKey: string]: string;\n\n\t\t/**\n\t\t * The correlating state the connector placed in the external flow.\n\t\t */\n\t\tstate: string;\n\t};\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IMailboxConnectorSchemaRequest.js","
|
|
1
|
+
{"version":3,"file":"IMailboxConnectorSchemaRequest.js","sources":["../../../../src/models/api/IMailboxConnectorSchemaRequest.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Request to retrieve the configuration schema for a connector.\n */\nexport interface IMailboxConnectorSchemaRequest {\n\t/**\n\t * The path parameters.\n\t */\n\tpathParams: {\n\t\t/**\n\t\t * The connector type identifier.\n\t\t */\n\t\tconnectorType: string;\n\t};\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IMailboxConnectorSchemaResponse.js","
|
|
1
|
+
{"version":3,"file":"IMailboxConnectorSchemaResponse.js","sources":["../../../../src/models/api/IMailboxConnectorSchemaResponse.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IMailboxConfigField } from \"../IMailboxConfigField.js\";\n\n/**\n * Response from retrieving a connector configuration schema.\n */\nexport interface IMailboxConnectorSchemaResponse {\n\t/**\n\t * The schema fields for the connector.\n\t */\n\tbody: IMailboxConfigField[];\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IMailboxCreateRequest.js","
|
|
1
|
+
{"version":3,"file":"IMailboxCreateRequest.js","sources":["../../../../src/models/api/IMailboxCreateRequest.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IMailbox } from \"../IMailbox.js\";\n\n/**\n * Request to create a new mailbox.\n */\nexport interface IMailboxCreateRequest {\n\t/**\n\t * The mailbox to create.\n\t */\n\tbody: Pick<IMailbox, \"name\" | \"connectorType\" | \"config\" | \"enabled\">;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IMailboxCreateResponse.js","
|
|
1
|
+
{"version":3,"file":"IMailboxCreateResponse.js","sources":["../../../../src/models/api/IMailboxCreateResponse.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { HeaderTypes, HttpStatusCode } from \"@3sixty/web\";\n\n/**\n * Response to creating a new mailbox.\n */\nexport interface IMailboxCreateResponse {\n\t/**\n\t * Response status code.\n\t */\n\tstatusCode: typeof HttpStatusCode.created;\n\n\t/**\n\t * Additional response headers.\n\t */\n\theaders: {\n\t\t/**\n\t\t * The location where the mailbox was created.\n\t\t */\n\t\t[HeaderTypes.Location]: string;\n\t};\n\n\t/**\n\t * The body of the response.\n\t */\n\tbody: {\n\t\t/**\n\t\t * The URL to open for the user when the mailbox must complete an external authentication\n\t\t * flow, such as an OAuth consent URL, before it can be polled.\n\t\t */\n\t\tauthUrl?: string;\n\t};\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IMailboxGetRequest.js","
|
|
1
|
+
{"version":3,"file":"IMailboxGetRequest.js","sources":["../../../../src/models/api/IMailboxGetRequest.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Request to retrieve a mailbox by ID.\n */\nexport interface IMailboxGetRequest {\n\t/**\n\t * The path parameters.\n\t */\n\tpathParams: {\n\t\t/**\n\t\t * The identifier of the mailbox to retrieve.\n\t\t */\n\t\tid: string;\n\t};\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IMailboxGetResponse.js","
|
|
1
|
+
{"version":3,"file":"IMailboxGetResponse.js","sources":["../../../../src/models/api/IMailboxGetResponse.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IMailbox } from \"../IMailbox.js\";\n\n/**\n * Response from retrieving a mailbox.\n */\nexport interface IMailboxGetResponse {\n\t/**\n\t * The retrieved mailbox.\n\t */\n\tbody: IMailbox;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IMailboxListRequest.js","
|
|
1
|
+
{"version":3,"file":"IMailboxListRequest.js","sources":["../../../../src/models/api/IMailboxListRequest.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Request to list mailboxes with optional pagination.\n */\nexport interface IMailboxListRequest {\n\t/**\n\t * The query parameters.\n\t */\n\tquery?: {\n\t\t/**\n\t\t * The cursor for paginated results.\n\t\t */\n\t\tcursor?: string;\n\n\t\t/**\n\t\t * The maximum number of results to return.\n\t\t */\n\t\tlimit?: string;\n\t};\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IMailboxListResponse.js","
|
|
1
|
+
{"version":3,"file":"IMailboxListResponse.js","sources":["../../../../src/models/api/IMailboxListResponse.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IMailbox } from \"../IMailbox.js\";\n\n/**\n * Response from listing mailboxes.\n */\nexport interface IMailboxListResponse {\n\t/**\n\t * The result body.\n\t */\n\tbody: {\n\t\t/**\n\t\t * The list of mailboxes.\n\t\t */\n\t\tmailboxes: IMailbox[];\n\n\t\t/**\n\t\t * The cursor for the next page of results.\n\t\t */\n\t\tcursor?: string;\n\t};\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IMailboxRemoveRequest.js","
|
|
1
|
+
{"version":3,"file":"IMailboxRemoveRequest.js","sources":["../../../../src/models/api/IMailboxRemoveRequest.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Request to remove a mailbox.\n */\nexport interface IMailboxRemoveRequest {\n\t/**\n\t * The path parameters.\n\t */\n\tpathParams: {\n\t\t/**\n\t\t * The identifier of the mailbox to remove.\n\t\t */\n\t\tid: string;\n\t};\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IMailboxUpdateRequest.js","
|
|
1
|
+
{"version":3,"file":"IMailboxUpdateRequest.js","sources":["../../../../src/models/api/IMailboxUpdateRequest.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IMailbox } from \"../IMailbox.js\";\n\n/**\n * Request to update an existing mailbox.\n */\nexport interface IMailboxUpdateRequest {\n\t/**\n\t * The path parameters.\n\t */\n\tpathParams: {\n\t\t/**\n\t\t * The identifier of the mailbox to update.\n\t\t */\n\t\tid: string;\n\t};\n\n\t/**\n\t * The updated mailbox configuration.\n\t */\n\tbody: IMailbox;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IMailboxUpdateResponse.js","
|
|
1
|
+
{"version":3,"file":"IMailboxUpdateResponse.js","sources":["../../../../src/models/api/IMailboxUpdateResponse.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { HttpStatusCode } from \"@3sixty/web\";\n\n/**\n * Response to updating a mailbox.\n */\nexport interface IMailboxUpdateResponse {\n\t/**\n\t * Response status code.\n\t */\n\tstatusCode: typeof HttpStatusCode.ok;\n\n\t/**\n\t * The body of the response.\n\t */\n\tbody: {\n\t\t/**\n\t\t * The URL to open for the user when the updated mailbox must complete an external\n\t\t * authentication flow, such as an OAuth consent URL, before it can be polled.\n\t\t */\n\t\tauthUrl?: string;\n\t};\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mailboxMetricIds.js","
|
|
1
|
+
{"version":3,"file":"mailboxMetricIds.js","sources":["../../../src/models/mailboxMetricIds.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AAEvC;;GAEG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC/B;;OAEG;IACH,cAAc,EAAE,yBAAyB;CAChC,CAAC","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Metric IDs for the mailbox service.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const MailboxMetricIds = {\n\t/**\n\t * Number of emails received across all mailboxes.\n\t */\n\tEmailsReceived: \"mailbox_emails_received\"\n} as const;\n\n/**\n * Union type of all mailbox service metric ID string values.\n */\nexport type MailboxMetricIds = (typeof MailboxMetricIds)[keyof typeof MailboxMetricIds];\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mailboxMetrics.js","
|
|
1
|
+
{"version":3,"file":"mailboxMetrics.js","sources":["../../../src/models/mailboxMetrics.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAyB,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD;;GAEG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,cAAc,GAAuB;IACjD;QACC,EAAE,EAAE,gBAAgB,CAAC,cAAc;QACnC,KAAK,EAAE,iBAAiB;QACxB,IAAI,EAAE,UAAU,CAAC,OAAO;KACxB;CACD,CAAC","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { type ITelemetryMetric, MetricType } from \"@3sixty/telemetry-models\";\nimport { MailboxMetricIds } from \"./mailboxMetricIds.js\";\n\n/**\n * Metrics registered by the mailbox service.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const MailboxMetrics: ITelemetryMetric[] = [\n\t{\n\t\tid: MailboxMetricIds.EmailsReceived,\n\t\tlabel: \"Emails received\",\n\t\ttype: MetricType.Counter\n\t}\n];\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mailHelper.js","
|
|
1
|
+
{"version":3,"file":"mailHelper.js","sources":["../../../src/utils/mailHelper.ts"],"names":[],"mappings":"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","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { Converter, Is } from \"@3sixty/core\";\nimport PostalMime from \"postal-mime\";\nimport type { IEmail } from \"../models/IEmail.js\";\nimport type { IEmailAddress } from \"../models/IEmailAddress.js\";\n\n/**\n * Shared utilities for parsing raw RFC822 email messages and mapping postal-mime address objects.\n */\nexport class MailHelper {\n\t/**\n\t * Map a postal-mime address object to an IEmailAddress, or return undefined when no address is present.\n\t * @param address The postal-mime address to map.\n\t * @param address.name The display name of the email address.\n\t * @param address.address The email address string.\n\t * @returns The mapped address, or undefined.\n\t */\n\tpublic static mapAddress(\n\t\taddress?: { name: string; address?: string } | undefined\n\t): IEmailAddress | undefined {\n\t\tif (Is.stringValue(address?.address)) {\n\t\t\treturn { name: address?.name, address: address?.address };\n\t\t}\n\t\treturn undefined;\n\t}\n\n\t/**\n\t * Map an array of postal-mime address objects to IEmailAddress[], or return undefined when the input is empty.\n\t * @param addresses The postal-mime addresses to map.\n\t * @returns The mapped addresses, or undefined.\n\t */\n\tpublic static mapAddresses(\n\t\taddresses: { name: string; address?: string }[] | undefined\n\t): IEmailAddress[] | undefined {\n\t\tconst mapped = (addresses ?? [])\n\t\t\t.filter(addr => Is.stringValue(addr.address))\n\t\t\t.map(addr => ({ name: addr.name, address: addr.address as string }));\n\t\treturn mapped.length > 0 ? mapped : undefined;\n\t}\n\n\t/**\n\t * Parse a raw RFC822 email string into an IEmail object using postal-mime.\n\t * @param raw The raw email string.\n\t * @param flags Optional IMAP flags associated with the message.\n\t * @returns The parsed email, or undefined if the input is empty.\n\t */\n\tpublic static async parseEmail(raw: string, flags?: string[]): Promise<IEmail | undefined> {\n\t\tif (!Is.stringValue(raw)) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst parsed = await PostalMime.parse(raw);\n\n\t\tconst attachments =\n\t\t\tparsed.attachments.length > 0\n\t\t\t\t? parsed.attachments.map(a => ({\n\t\t\t\t\t\tfilename: a.filename ?? undefined,\n\t\t\t\t\t\tcontentType: a.mimeType,\n\t\t\t\t\t\tdata: MailHelper.attachmentToBase64(a.content)\n\t\t\t\t\t}))\n\t\t\t\t: undefined;\n\n\t\treturn {\n\t\t\theaders: parsed.headers.map(h => ({\n\t\t\t\tkey: h.key,\n\t\t\t\toriginalKey: h.originalKey,\n\t\t\t\tvalue: h.value\n\t\t\t})),\n\t\t\tmessageId: parsed.messageId,\n\t\t\tfrom: MailHelper.mapAddress(parsed.from),\n\t\t\tsender: MailHelper.mapAddress(parsed.sender),\n\t\t\tto: MailHelper.mapAddresses(parsed.to),\n\t\t\tcc: MailHelper.mapAddresses(parsed.cc),\n\t\t\tbcc: MailHelper.mapAddresses(parsed.bcc),\n\t\t\treplyTo: MailHelper.mapAddresses(parsed.replyTo),\n\t\t\tdeliveredTo: parsed.deliveredTo,\n\t\t\treturnPath: parsed.returnPath,\n\t\t\tinReplyTo: parsed.inReplyTo,\n\t\t\treferences: parsed.references,\n\t\t\tsubject: parsed.subject,\n\t\t\tdate: parsed.date,\n\t\t\ttextContent: parsed.text,\n\t\t\thtmlContent: parsed.html,\n\t\t\tattachments,\n\t\t\tflags\n\t\t};\n\t}\n\n\t/**\n\t * Convert postal-mime attachment content to a base64 string.\n\t * Handles string (text), Uint8Array, and ArrayBuffer inputs.\n\t * @param content The attachment content.\n\t * @returns The base64-encoded content.\n\t */\n\tpublic static attachmentToBase64(content: string | ArrayBuffer | Uint8Array): string {\n\t\tif (Is.stringValue(content)) {\n\t\t\treturn Converter.bytesToBase64(Converter.utf8ToBytes(content));\n\t\t}\n\t\tif (Is.uint8Array(content)) {\n\t\t\treturn Converter.bytesToBase64(content);\n\t\t}\n\t\treturn Converter.bytesToBase64(new Uint8Array(content));\n\t}\n}\n"]}
|
package/docs/changelog.md
CHANGED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [0.20.0-next.1](https://github.com/3sixtyglobal/messaging/compare/mailbox-models-v0.20.0-next.0...mailbox-models-v0.20.0-next.1) (2026-10-23)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* publish packages under the [@3sixty](https://github.com/3sixty) namespace ([8fd187c](https://github.com/3sixtyglobal/messaging/commit/8fd187cab6f54f164628d1d2a0129d4b7a1ba87d))
|
|
9
|
+
* updated ts compile ([293701e](https://github.com/3sixtyglobal/messaging/commit/293701e2acc20bb6bbcf2e2ff1a0d03f0b9a7a76))
|
|
@@ -8,11 +8,11 @@ Interface describing an email protocol connector that handles message retrieval.
|
|
|
8
8
|
|
|
9
9
|
## Type Parameters
|
|
10
10
|
|
|
11
|
-
### TState
|
|
11
|
+
### TState {#tstate}
|
|
12
12
|
|
|
13
13
|
`TState` = `unknown`
|
|
14
14
|
|
|
15
|
-
### TAuthState
|
|
15
|
+
### TAuthState {#tauthstate}
|
|
16
16
|
|
|
17
17
|
`TAuthState` *extends* [`IEmailProtocolConnectorAuthState`](IEmailProtocolConnectorAuthState.md) = [`IEmailProtocolConnectorAuthState`](IEmailProtocolConnectorAuthState.md)
|
|
18
18
|
|
|
@@ -4,15 +4,15 @@ Interface describing a mailbox configuration.
|
|
|
4
4
|
|
|
5
5
|
## Type Parameters
|
|
6
6
|
|
|
7
|
-
### TConfig
|
|
7
|
+
### TConfig {#tconfig}
|
|
8
8
|
|
|
9
9
|
`TConfig` = `unknown`
|
|
10
10
|
|
|
11
|
-
### TState
|
|
11
|
+
### TState {#tstate}
|
|
12
12
|
|
|
13
13
|
`TState` = `unknown`
|
|
14
14
|
|
|
15
|
-
### TAuthState
|
|
15
|
+
### TAuthState {#tauthstate}
|
|
16
16
|
|
|
17
17
|
`TAuthState` = `unknown`
|
|
18
18
|
|
|
@@ -6,7 +6,7 @@ Callback invoked by a protocol connector to report the outcome of an authenticat
|
|
|
6
6
|
|
|
7
7
|
## Type Parameters
|
|
8
8
|
|
|
9
|
-
### TAuthState
|
|
9
|
+
### TAuthState {#tauthstate}
|
|
10
10
|
|
|
11
11
|
`TAuthState` *extends* [`IEmailProtocolConnectorAuthState`](../interfaces/IEmailProtocolConnectorAuthState.md) = [`IEmailProtocolConnectorAuthState`](../interfaces/IEmailProtocolConnectorAuthState.md)
|
|
12
12
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@3sixty/mailbox-models",
|
|
3
|
-
"version": "0.20.0-next.
|
|
3
|
+
"version": "0.20.0-next.1",
|
|
4
4
|
"description": "Defines the shared models and factory helpers for email mailbox ingestion.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"@3sixty/nameof": "next",
|
|
20
20
|
"@3sixty/telemetry-models": "next",
|
|
21
21
|
"@3sixty/web": "next",
|
|
22
|
-
"postal-mime": "
|
|
22
|
+
"postal-mime": "4.0.11"
|
|
23
23
|
},
|
|
24
24
|
"main": "./dist/es/index.js",
|
|
25
25
|
"types": "./dist/types/index.d.ts",
|