n8n-nodes-base 1.91.1 → 1.93.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/dist/credentials/Aws.credentials.js +0 -2
- package/dist/credentials/Aws.credentials.js.map +1 -1
- package/dist/credentials/JinaAiApi.credentials.js +61 -0
- package/dist/credentials/JinaAiApi.credentials.js.map +1 -0
- package/dist/credentials/MicrosoftAzureCosmosDbSharedKeyApi.credentials.js +1 -1
- package/dist/credentials/MicrosoftAzureCosmosDbSharedKeyApi.credentials.js.map +1 -1
- package/dist/credentials/MicrosoftSharePointOAuth2Api.credentials.js +0 -9
- package/dist/credentials/MicrosoftSharePointOAuth2Api.credentials.js.map +1 -1
- package/dist/credentials/MicrosoftTeamsOAuth2Api.credentials.js +13 -0
- package/dist/credentials/MicrosoftTeamsOAuth2Api.credentials.js.map +1 -1
- package/dist/credentials/Snowflake.credentials.js +46 -2
- package/dist/credentials/Snowflake.credentials.js.map +1 -1
- package/dist/known/credentials.json +18 -1
- package/dist/known/nodes.json +28 -0
- package/dist/methods/defined.json +6 -0
- package/dist/methods/referenced.json +3 -0
- package/dist/nodes/Affinity/__schema__/v1.0.0/listEntry/getAll.json +1 -4
- package/dist/nodes/Airtop/__schema__/v1.0.0/extraction/query.json +47 -0
- package/dist/nodes/Aws/Cognito/AwsCognito.node.js +102 -0
- package/dist/nodes/Aws/Cognito/AwsCognito.node.js.map +1 -0
- package/dist/nodes/Aws/Cognito/AwsCognito.node.json +18 -0
- package/dist/nodes/Aws/Cognito/cognito.svg +1 -0
- package/dist/nodes/Aws/Cognito/descriptions/common.description.js +160 -0
- package/dist/nodes/Aws/Cognito/descriptions/common.description.js.map +1 -0
- package/dist/nodes/Aws/Cognito/descriptions/group/Group.resource.js +189 -0
- package/dist/nodes/Aws/Cognito/descriptions/group/Group.resource.js.map +1 -0
- package/dist/nodes/Aws/Cognito/descriptions/group/create.operation.js +126 -0
- package/dist/nodes/Aws/Cognito/descriptions/group/create.operation.js.map +1 -0
- package/dist/nodes/Aws/Cognito/descriptions/group/delete.operation.js +47 -0
- package/dist/nodes/Aws/Cognito/descriptions/group/delete.operation.js.map +1 -0
- package/dist/nodes/Aws/Cognito/descriptions/group/get.operation.js +54 -0
- package/dist/nodes/Aws/Cognito/descriptions/group/get.operation.js.map +1 -0
- package/dist/nodes/Aws/Cognito/descriptions/group/getAll.operation.js +95 -0
- package/dist/nodes/Aws/Cognito/descriptions/group/getAll.operation.js.map +1 -0
- package/dist/nodes/Aws/Cognito/descriptions/group/update.operation.js +120 -0
- package/dist/nodes/Aws/Cognito/descriptions/group/update.operation.js.map +1 -0
- package/dist/nodes/Aws/Cognito/descriptions/index.js +45 -0
- package/dist/nodes/Aws/Cognito/descriptions/index.js.map +1 -0
- package/dist/nodes/Aws/Cognito/descriptions/user/User.resource.js +263 -0
- package/dist/nodes/Aws/Cognito/descriptions/user/User.resource.js.map +1 -0
- package/dist/nodes/Aws/Cognito/descriptions/user/addToGroup.operation.js +51 -0
- package/dist/nodes/Aws/Cognito/descriptions/user/addToGroup.operation.js.map +1 -0
- package/dist/nodes/Aws/Cognito/descriptions/user/create.operation.js +299 -0
- package/dist/nodes/Aws/Cognito/descriptions/user/create.operation.js.map +1 -0
- package/dist/nodes/Aws/Cognito/descriptions/user/delete.operation.js +47 -0
- package/dist/nodes/Aws/Cognito/descriptions/user/delete.operation.js.map +1 -0
- package/dist/nodes/Aws/Cognito/descriptions/user/get.operation.js +54 -0
- package/dist/nodes/Aws/Cognito/descriptions/user/get.operation.js.map +1 -0
- package/dist/nodes/Aws/Cognito/descriptions/user/getAll.operation.js +187 -0
- package/dist/nodes/Aws/Cognito/descriptions/user/getAll.operation.js.map +1 -0
- package/dist/nodes/Aws/Cognito/descriptions/user/removeFromGroup.operation.js +60 -0
- package/dist/nodes/Aws/Cognito/descriptions/user/removeFromGroup.operation.js.map +1 -0
- package/dist/nodes/Aws/Cognito/descriptions/user/update.operation.js +189 -0
- package/dist/nodes/Aws/Cognito/descriptions/user/update.operation.js.map +1 -0
- package/dist/nodes/Aws/Cognito/descriptions/userPool/UserPool.resource.js +81 -0
- package/dist/nodes/Aws/Cognito/descriptions/userPool/UserPool.resource.js.map +1 -0
- package/dist/nodes/Aws/Cognito/descriptions/userPool/get.operation.js +50 -0
- package/dist/nodes/Aws/Cognito/descriptions/userPool/get.operation.js.map +1 -0
- package/dist/nodes/Aws/Cognito/helpers/constants.js +91 -0
- package/dist/nodes/Aws/Cognito/helpers/constants.js.map +1 -0
- package/dist/nodes/Aws/Cognito/helpers/errorHandler.js +109 -0
- package/dist/nodes/Aws/Cognito/helpers/errorHandler.js.map +1 -0
- package/dist/nodes/Aws/Cognito/helpers/interfaces.js +17 -0
- package/dist/nodes/Aws/Cognito/helpers/interfaces.js.map +1 -0
- package/dist/nodes/Aws/Cognito/helpers/utils.js +318 -0
- package/dist/nodes/Aws/Cognito/helpers/utils.js.map +1 -0
- package/dist/nodes/Aws/Cognito/methods/index.js +39 -0
- package/dist/nodes/Aws/Cognito/methods/index.js.map +1 -0
- package/dist/nodes/Aws/Cognito/methods/listSearch.js +157 -0
- package/dist/nodes/Aws/Cognito/methods/listSearch.js.map +1 -0
- package/dist/nodes/Aws/Cognito/transport/index.js +72 -0
- package/dist/nodes/Aws/Cognito/transport/index.js.map +1 -0
- package/dist/nodes/Aws/IAM/AwsIam.node.js +95 -0
- package/dist/nodes/Aws/IAM/AwsIam.node.js.map +1 -0
- package/dist/nodes/Aws/IAM/AwsIam.node.json +18 -0
- package/dist/nodes/Aws/IAM/AwsIam.svg +18 -0
- package/dist/nodes/Aws/IAM/descriptions/common.js +188 -0
- package/dist/nodes/Aws/IAM/descriptions/common.js.map +1 -0
- package/dist/nodes/Aws/IAM/descriptions/group/Group.resource.js +175 -0
- package/dist/nodes/Aws/IAM/descriptions/group/Group.resource.js.map +1 -0
- package/dist/nodes/Aws/IAM/descriptions/group/create.operation.js +66 -0
- package/dist/nodes/Aws/IAM/descriptions/group/create.operation.js.map +1 -0
- package/dist/nodes/Aws/IAM/descriptions/group/delete.operation.js +43 -0
- package/dist/nodes/Aws/IAM/descriptions/group/delete.operation.js.map +1 -0
- package/dist/nodes/Aws/IAM/descriptions/group/get.operation.js +50 -0
- package/dist/nodes/Aws/IAM/descriptions/group/get.operation.js.map +1 -0
- package/dist/nodes/Aws/IAM/descriptions/group/getAll.operation.js +47 -0
- package/dist/nodes/Aws/IAM/descriptions/group/getAll.operation.js.map +1 -0
- package/dist/nodes/Aws/IAM/descriptions/group/update.operation.js +70 -0
- package/dist/nodes/Aws/IAM/descriptions/group/update.operation.js.map +1 -0
- package/dist/nodes/Aws/IAM/descriptions/index.js +42 -0
- package/dist/nodes/Aws/IAM/descriptions/index.js.map +1 -0
- package/dist/nodes/Aws/IAM/descriptions/user/User.resource.js +231 -0
- package/dist/nodes/Aws/IAM/descriptions/user/User.resource.js.map +1 -0
- package/dist/nodes/Aws/IAM/descriptions/user/addToGroup.operation.js +47 -0
- package/dist/nodes/Aws/IAM/descriptions/user/addToGroup.operation.js.map +1 -0
- package/dist/nodes/Aws/IAM/descriptions/user/create.operation.js +118 -0
- package/dist/nodes/Aws/IAM/descriptions/user/create.operation.js.map +1 -0
- package/dist/nodes/Aws/IAM/descriptions/user/delete.operation.js +43 -0
- package/dist/nodes/Aws/IAM/descriptions/user/delete.operation.js.map +1 -0
- package/dist/nodes/Aws/IAM/descriptions/user/get.operation.js +43 -0
- package/dist/nodes/Aws/IAM/descriptions/user/get.operation.js.map +1 -0
- package/dist/nodes/Aws/IAM/descriptions/user/getAll.operation.js +66 -0
- package/dist/nodes/Aws/IAM/descriptions/user/getAll.operation.js.map +1 -0
- package/dist/nodes/Aws/IAM/descriptions/user/removeFromGroup.operation.js +74 -0
- package/dist/nodes/Aws/IAM/descriptions/user/removeFromGroup.operation.js.map +1 -0
- package/dist/nodes/Aws/IAM/descriptions/user/update.operation.js +68 -0
- package/dist/nodes/Aws/IAM/descriptions/user/update.operation.js.map +1 -0
- package/dist/nodes/Aws/IAM/helpers/constants.js +47 -0
- package/dist/nodes/Aws/IAM/helpers/constants.js.map +1 -0
- package/dist/nodes/Aws/IAM/helpers/errorHandler.js +90 -0
- package/dist/nodes/Aws/IAM/helpers/errorHandler.js.map +1 -0
- package/dist/nodes/Aws/IAM/helpers/types.js +17 -0
- package/dist/nodes/Aws/IAM/helpers/types.js.map +1 -0
- package/dist/nodes/Aws/IAM/helpers/utils.js +279 -0
- package/dist/nodes/Aws/IAM/helpers/utils.js.map +1 -0
- package/dist/nodes/Aws/IAM/methods/index.js +39 -0
- package/dist/nodes/Aws/IAM/methods/index.js.map +1 -0
- package/dist/nodes/Aws/IAM/methods/listSearch.js +132 -0
- package/dist/nodes/Aws/IAM/methods/listSearch.js.map +1 -0
- package/dist/nodes/Aws/IAM/transport/index.js +64 -0
- package/dist/nodes/Aws/IAM/transport/index.js.map +1 -0
- package/dist/nodes/Aws/S3/__schema__/v2.0.0/file/getAll.json +1 -7
- package/dist/nodes/BambooHr/__schema__/v1.0.0/employee/get.json +10 -1
- package/dist/nodes/Cron/Cron.node.js +1 -1
- package/dist/nodes/Cron/Cron.node.js.map +1 -1
- package/dist/nodes/Dropcontact/__schema__/v1.0.0/contact/enrich.json +7 -15
- package/dist/nodes/EmailReadImap/v1/EmailReadImapV1.node.js +2 -2
- package/dist/nodes/EmailReadImap/v1/EmailReadImapV1.node.js.map +1 -1
- package/dist/nodes/EmailReadImap/v2/EmailReadImapV2.node.js +2 -2
- package/dist/nodes/EmailReadImap/v2/EmailReadImapV2.node.js.map +1 -1
- package/dist/nodes/EmailSend/__schema__/v2.1.0/email/send.json +7 -1
- package/dist/nodes/Evaluation/Evaluation/Description.node.js +146 -0
- package/dist/nodes/Evaluation/Evaluation/Description.node.js.map +1 -0
- package/dist/nodes/Evaluation/Evaluation/Evaluation.node.ee.js +117 -0
- package/dist/nodes/Evaluation/Evaluation/Evaluation.node.ee.js.map +1 -0
- package/dist/nodes/Evaluation/EvaluationTrigger/EvaluationTrigger.node.ee.js +187 -0
- package/dist/nodes/Evaluation/EvaluationTrigger/EvaluationTrigger.node.ee.js.map +1 -0
- package/dist/nodes/Evaluation/methods/index.js +42 -0
- package/dist/nodes/Evaluation/methods/index.js.map +1 -0
- package/dist/nodes/Evaluation/methods/loadOptions.js +40 -0
- package/dist/nodes/Evaluation/methods/loadOptions.js.map +1 -0
- package/dist/nodes/Evaluation/utils/evaluationTriggerUtils.js +119 -0
- package/dist/nodes/Evaluation/utils/evaluationTriggerUtils.js.map +1 -0
- package/dist/nodes/Evaluation/utils/evaluationUtils.js +171 -0
- package/dist/nodes/Evaluation/utils/evaluationUtils.js.map +1 -0
- package/dist/nodes/ExecuteWorkflow/ExecuteWorkflowTrigger/ExecuteWorkflowTrigger.node.js +4 -3
- package/dist/nodes/ExecuteWorkflow/ExecuteWorkflowTrigger/ExecuteWorkflowTrigger.node.js.map +1 -1
- package/dist/nodes/Form/common.descriptions.js +2 -2
- package/dist/nodes/Form/common.descriptions.js.map +1 -1
- package/dist/nodes/Github/__schema__/v1.1.0/file/list.json +44 -0
- package/dist/nodes/Gitlab/__schema__/v1.0.0/file/get.json +1 -4
- package/dist/nodes/Google/BusinessProfile/__schema__/v1.0.0/review/getAll.json +1 -12
- package/dist/nodes/Google/Calendar/__schema__/v1.3.0/event/getAll.json +4 -7
- package/dist/nodes/Google/Contacts/__schema__/v1.0.0/contact/getAll.json +1 -12
- package/dist/nodes/Google/Drive/__schema__/v3.0.0/file/download.json +9 -0
- package/dist/nodes/Google/Firebase/CloudFirestore/__schema__/v1.1.0/document/query.json +7 -1
- package/dist/nodes/Google/Gmail/__schema__/v2.1.0/message/addLabels.json +1 -13
- package/dist/nodes/Google/Gmail/__schema__/v2.1.0/message/get.json +7 -1
- package/dist/nodes/Google/Gmail/__schema__/v2.1.0/message/getAll.json +29 -113
- package/dist/nodes/Google/Gmail/__schema__/v2.1.0/thread/get.json +1 -60
- package/dist/nodes/Google/Sheet/GoogleSheets.node.js +3 -2
- package/dist/nodes/Google/Sheet/GoogleSheets.node.js.map +1 -1
- package/dist/nodes/Google/Sheet/GoogleSheetsTrigger.node.js +113 -107
- package/dist/nodes/Google/Sheet/GoogleSheetsTrigger.node.js.map +1 -1
- package/dist/nodes/Google/Sheet/v2/actions/sheet/read.operation.js +52 -105
- package/dist/nodes/Google/Sheet/v2/actions/sheet/read.operation.js.map +1 -1
- package/dist/nodes/Google/Sheet/v2/actions/utils/readOperation.js +97 -0
- package/dist/nodes/Google/Sheet/v2/actions/utils/readOperation.js.map +1 -0
- package/dist/nodes/Google/Sheet/v2/actions/versionDescription.js +21 -18
- package/dist/nodes/Google/Sheet/v2/actions/versionDescription.js.map +1 -1
- package/dist/nodes/Google/Sheet/v2/helpers/GoogleSheet.js +4 -0
- package/dist/nodes/Google/Sheet/v2/helpers/GoogleSheet.js.map +1 -1
- package/dist/nodes/Google/Task/__schema__/v1.0.0/task/getAll.json +1 -4
- package/dist/nodes/Google/YouTube/YouTube.node.js +4 -2
- package/dist/nodes/Google/YouTube/YouTube.node.js.map +1 -1
- package/dist/nodes/Google/YouTube/__schema__/v1.0.0/video/get.json +35 -1
- package/dist/nodes/Hubspot/__schema__/v2.1.0/company/getAll.json +4 -1
- package/dist/nodes/Hubspot/__schema__/v2.1.0/contact/search.json +1 -4
- package/dist/nodes/Hubspot/__schema__/v2.1.0/deal/getAll.json +45 -11
- package/dist/nodes/Hubspot/__schema__/v2.1.0/deal/search.json +2 -5
- package/dist/nodes/Hubspot/__schema__/v2.1.0/ticket/get.json +4 -4
- package/dist/nodes/Interval/Interval.node.js +1 -1
- package/dist/nodes/Interval/Interval.node.js.map +1 -1
- package/dist/nodes/ItemLists/__schema__/v3.0.0/itemList/limit.json +4 -1
- package/dist/nodes/JinaAI/JinaAi.node.js +486 -0
- package/dist/nodes/JinaAI/JinaAi.node.js.map +1 -0
- package/dist/nodes/JinaAI/JinaAi.node.json +18 -0
- package/dist/nodes/JinaAI/jinaAi.dark.svg +6 -0
- package/dist/nodes/JinaAI/jinaAi.svg +6 -0
- package/dist/nodes/Jira/__schema__/v1.0.0/issue/get.json +259 -1
- package/dist/nodes/Jira/__schema__/v1.0.0/issue/getAll.json +57 -37
- package/dist/nodes/Linear/__schema__/v1.0.0/issue/getAll.json +1 -12
- package/dist/nodes/LocalFileTrigger/LocalFileTrigger.node.js +2 -2
- package/dist/nodes/LocalFileTrigger/LocalFileTrigger.node.js.map +1 -1
- package/dist/nodes/MQTT/MqttTrigger.node.js +2 -2
- package/dist/nodes/MQTT/MqttTrigger.node.js.map +1 -1
- package/dist/nodes/ManualTrigger/ManualTrigger.node.js +1 -1
- package/dist/nodes/ManualTrigger/ManualTrigger.node.js.map +1 -1
- package/dist/nodes/Microsoft/AzureCosmosDb/AzureCosmosDb.node.json +2 -2
- package/dist/nodes/Microsoft/Entra/MicrosoftEntra.node.js +2 -2
- package/dist/nodes/Microsoft/Entra/MicrosoftEntra.node.js.map +1 -1
- package/dist/nodes/Microsoft/Entra/__schema__/v1.0.0/user/getAll.json +1 -7
- package/dist/nodes/Microsoft/Outlook/__schema__/v2.0.0/event/getAll.json +4 -1
- package/dist/nodes/Microsoft/Outlook/__schema__/v2.0.0/folderMessage/getAll.json +8 -47
- package/dist/nodes/Microsoft/Outlook/__schema__/v2.0.0/message/get.json +124 -1
- package/dist/nodes/Microsoft/Outlook/__schema__/v2.0.0/message/getAll.json +40 -20
- package/dist/nodes/Microsoft/Outlook/__schema__/v2.0.0/message/sendAndWait.json +12 -11
- package/dist/nodes/Microsoft/Outlook/__schema__/v2.0.0/messageAttachment/get.json +13 -1
- package/dist/nodes/Microsoft/SharePoint/MicrosoftSharePoint.node.js +93 -0
- package/dist/nodes/Microsoft/SharePoint/MicrosoftSharePoint.node.js.map +1 -0
- package/dist/nodes/Microsoft/SharePoint/MicrosoftSharepoint.node.json +18 -0
- package/dist/nodes/Microsoft/SharePoint/descriptions/common.descriptions.js +190 -0
- package/dist/nodes/Microsoft/SharePoint/descriptions/common.descriptions.js.map +1 -0
- package/dist/nodes/Microsoft/SharePoint/descriptions/file/File.resource.js +108 -0
- package/dist/nodes/Microsoft/SharePoint/descriptions/file/File.resource.js.map +1 -0
- package/dist/nodes/Microsoft/SharePoint/descriptions/file/download.operation.js +62 -0
- package/dist/nodes/Microsoft/SharePoint/descriptions/file/download.operation.js.map +1 -0
- package/dist/nodes/Microsoft/SharePoint/descriptions/file/update.operation.js +129 -0
- package/dist/nodes/Microsoft/SharePoint/descriptions/file/update.operation.js.map +1 -0
- package/dist/nodes/Microsoft/SharePoint/descriptions/file/upload.operation.js +77 -0
- package/dist/nodes/Microsoft/SharePoint/descriptions/file/upload.operation.js.map +1 -0
- package/dist/nodes/Microsoft/SharePoint/descriptions/index.js +45 -0
- package/dist/nodes/Microsoft/SharePoint/descriptions/index.js.map +1 -0
- package/dist/nodes/Microsoft/SharePoint/descriptions/item/Item.resource.js +175 -0
- package/dist/nodes/Microsoft/SharePoint/descriptions/item/Item.resource.js.map +1 -0
- package/dist/nodes/Microsoft/SharePoint/descriptions/item/create.operation.js +100 -0
- package/dist/nodes/Microsoft/SharePoint/descriptions/item/create.operation.js.map +1 -0
- package/dist/nodes/Microsoft/SharePoint/descriptions/item/delete.operation.js +62 -0
- package/dist/nodes/Microsoft/SharePoint/descriptions/item/delete.operation.js.map +1 -0
- package/dist/nodes/Microsoft/SharePoint/descriptions/item/get.operation.js +83 -0
- package/dist/nodes/Microsoft/SharePoint/descriptions/item/get.operation.js.map +1 -0
- package/dist/nodes/Microsoft/SharePoint/descriptions/item/getAll.operation.js +203 -0
- package/dist/nodes/Microsoft/SharePoint/descriptions/item/getAll.operation.js.map +1 -0
- package/dist/nodes/Microsoft/SharePoint/descriptions/item/update.operation.js +100 -0
- package/dist/nodes/Microsoft/SharePoint/descriptions/item/update.operation.js.map +1 -0
- package/dist/nodes/Microsoft/SharePoint/descriptions/item/upsert.operation.js +100 -0
- package/dist/nodes/Microsoft/SharePoint/descriptions/item/upsert.operation.js.map +1 -0
- package/dist/nodes/Microsoft/SharePoint/descriptions/list/List.resource.js +99 -0
- package/dist/nodes/Microsoft/SharePoint/descriptions/list/List.resource.js.map +1 -0
- package/dist/nodes/Microsoft/SharePoint/descriptions/list/get.operation.js +65 -0
- package/dist/nodes/Microsoft/SharePoint/descriptions/list/get.operation.js.map +1 -0
- package/dist/nodes/Microsoft/SharePoint/descriptions/list/getAll.operation.js +105 -0
- package/dist/nodes/Microsoft/SharePoint/descriptions/list/getAll.operation.js.map +1 -0
- package/dist/nodes/Microsoft/SharePoint/helpers/interfaces.js +17 -0
- package/dist/nodes/Microsoft/SharePoint/helpers/interfaces.js.map +1 -0
- package/dist/nodes/Microsoft/SharePoint/helpers/utils.js +252 -0
- package/dist/nodes/Microsoft/SharePoint/helpers/utils.js.map +1 -0
- package/dist/nodes/Microsoft/SharePoint/methods/index.js +42 -0
- package/dist/nodes/Microsoft/SharePoint/methods/index.js.map +1 -0
- package/dist/nodes/Microsoft/SharePoint/methods/listSearch.js +222 -0
- package/dist/nodes/Microsoft/SharePoint/methods/listSearch.js.map +1 -0
- package/dist/nodes/Microsoft/SharePoint/methods/resourceMapping.js +104 -0
- package/dist/nodes/Microsoft/SharePoint/methods/resourceMapping.js.map +1 -0
- package/dist/nodes/Microsoft/SharePoint/test/credentials.js +54 -0
- package/dist/nodes/Microsoft/SharePoint/test/credentials.js.map +1 -0
- package/dist/nodes/Microsoft/SharePoint/transport/index.js +46 -0
- package/dist/nodes/Microsoft/SharePoint/transport/index.js.map +1 -0
- package/dist/nodes/Microsoft/Storage/__schema__/v1.0.0/blob/getAll.json +44 -0
- package/dist/nodes/Microsoft/Teams/MicrosoftTeamsTrigger.node.js +387 -0
- package/dist/nodes/Microsoft/Teams/MicrosoftTeamsTrigger.node.js.map +1 -0
- package/dist/nodes/Microsoft/Teams/MicrosoftTeamsTrigger.node.json +18 -0
- package/dist/nodes/Microsoft/Teams/__schema__/v2.0.0/channel/getAll.json +1 -4
- package/dist/nodes/Microsoft/Teams/v2/helpers/types.js +17 -0
- package/dist/nodes/Microsoft/Teams/v2/helpers/types.js.map +1 -0
- package/dist/nodes/Microsoft/Teams/v2/helpers/utils-trigger.js +147 -0
- package/dist/nodes/Microsoft/Teams/v2/helpers/utils-trigger.js.map +1 -0
- package/dist/nodes/Microsoft/Teams/v2/transport/index.js.map +1 -1
- package/dist/nodes/Microsoft/ToDo/__schema__/v1.0.0/task/getAll.json +21 -5
- package/dist/nodes/Notion/__schema__/v2.2.0/database/get.json +149 -2
- package/dist/nodes/Odoo/__schema__/v1.0.0/contact/getAll.json +10 -1
- package/dist/nodes/Odoo/__schema__/v1.0.0/custom/getAll.json +1 -4
- package/dist/nodes/Odoo/__schema__/v1.0.0/opportunity/getAll.json +49 -1
- package/dist/nodes/OpenAi/__schema__/v1.1.0/chat/complete.json +1 -29
- package/dist/nodes/Pipedrive/__schema__/v1.0.0/organization/search.json +20 -25
- package/dist/nodes/Pipedrive/__schema__/v1.0.0/person/search.json +1 -18
- package/dist/nodes/Plivo/__schema__/v1.0.0/call/make.json +15 -0
- package/dist/nodes/PostBin/BinDescription.js +1 -1
- package/dist/nodes/PostBin/BinDescription.js.map +1 -1
- package/dist/nodes/PostBin/GenericFunctions.js +5 -5
- package/dist/nodes/PostBin/GenericFunctions.js.map +1 -1
- package/dist/nodes/PostBin/PostBin.node.js +1 -1
- package/dist/nodes/PostBin/PostBin.node.js.map +1 -1
- package/dist/nodes/PostBin/RequestDescription.js +2 -2
- package/dist/nodes/PostBin/RequestDescription.js.map +1 -1
- package/dist/nodes/Postgres/PostgresTrigger.node.js +2 -2
- package/dist/nodes/Postgres/PostgresTrigger.node.js.map +1 -1
- package/dist/nodes/QuickBooks/__schema__/v1.0.0/transaction/getReport.json +1 -4
- package/dist/nodes/RabbitMQ/RabbitMQTrigger.node.js +2 -2
- package/dist/nodes/RabbitMQ/RabbitMQTrigger.node.js.map +1 -1
- package/dist/nodes/RespondToWebhook/RespondToWebhook.node.js +8 -3
- package/dist/nodes/RespondToWebhook/RespondToWebhook.node.js.map +1 -1
- package/dist/nodes/RespondToWebhook/utils.js +43 -0
- package/dist/nodes/RespondToWebhook/utils.js.map +1 -0
- package/dist/nodes/Salesforce/__schema__/v1.0.0/customObject/getAll.json +2 -2
- package/dist/nodes/Salesforce/__schema__/v1.0.0/opportunity/getAll.json +5 -2
- package/dist/nodes/Salesforce/__schema__/v1.0.0/task/getAll.json +4 -1
- package/dist/nodes/Schedule/ScheduleTrigger.node.js +1 -1
- package/dist/nodes/Schedule/ScheduleTrigger.node.js.map +1 -1
- package/dist/nodes/SeaTable/__schema__/v2.0.0/row/list.json +30 -0
- package/dist/nodes/ServiceNow/__schema__/v1.0.0/tableRecord/getAll.json +1 -4
- package/dist/nodes/Slack/__schema__/v2.3.0/channel/history.json +49 -3
- package/dist/nodes/Slack/__schema__/v2.3.0/message/post.json +4 -1
- package/dist/nodes/Snowflake/GenericFunctions.js +34 -2
- package/dist/nodes/Snowflake/GenericFunctions.js.map +1 -1
- package/dist/nodes/Snowflake/Snowflake.node.js +5 -7
- package/dist/nodes/Snowflake/Snowflake.node.js.map +1 -1
- package/dist/nodes/SseTrigger/SseTrigger.node.js +2 -2
- package/dist/nodes/SseTrigger/SseTrigger.node.js.map +1 -1
- package/dist/nodes/Ssh/__schema__/v1.0.0/command/execute.json +4 -1
- package/dist/nodes/Strapi/__schema__/v1.0.0/entry/get.json +32 -0
- package/dist/nodes/Strapi/__schema__/v1.0.0/entry/getAll.json +1 -4
- package/dist/nodes/Telegram/__schema__/v1.2.0/chat/get.json +27 -1
- package/dist/nodes/Telegram/__schema__/v1.2.0/chat/member.json +7 -1
- package/dist/nodes/Telegram/__schema__/v1.2.0/message/sendMessage.json +1 -4
- package/dist/nodes/Telegram/__schema__/v1.2.0/message/sendPhoto.json +4 -1
- package/dist/nodes/Trello/__schema__/v1.0.0/list/getAll.json +7 -1
- package/dist/nodes/Trello/__schema__/v1.0.0/list/getCards.json +13 -1
- package/dist/nodes/Wordpress/PageDescription.js +0 -17
- package/dist/nodes/Wordpress/PageDescription.js.map +1 -1
- package/dist/nodes/Wordpress/__schema__/v1.0.0/post/get.json +7 -1
- package/dist/nodes/Zoho/__schema__/v1.0.0/contact/getAll.json +15 -16
- package/dist/nodes/Zoho/__schema__/v1.0.0/lead/getAll.json +1 -122
- package/dist/nodes/Zoom/__schema__/v1.0.0/meeting/getAll.json +1 -4
- package/dist/types/credentials.json +8 -7
- package/dist/types/nodes.json +29 -22
- package/dist/utils/workflowInputsResourceMapping/GenericFunctions.js +12 -2
- package/dist/utils/workflowInputsResourceMapping/GenericFunctions.js.map +1 -1
- package/package.json +16 -9
- /package/dist/{credentials/icons/SharePoint.svg → nodes/Microsoft/SharePoint/microsoftSharePoint.svg} +0 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var methods_exports = {};
|
|
30
|
+
__export(methods_exports, {
|
|
31
|
+
listSearch: () => listSearch
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(methods_exports);
|
|
34
|
+
var listSearch = __toESM(require("./listSearch"));
|
|
35
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
36
|
+
0 && (module.exports = {
|
|
37
|
+
listSearch
|
|
38
|
+
});
|
|
39
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../nodes/Aws/IAM/methods/index.ts"],"sourcesContent":["export * as listSearch from './listSearch';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAA4B;","names":[]}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var listSearch_exports = {};
|
|
20
|
+
__export(listSearch_exports, {
|
|
21
|
+
searchGroups: () => searchGroups,
|
|
22
|
+
searchGroupsForUser: () => searchGroupsForUser,
|
|
23
|
+
searchUsers: () => searchUsers
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(listSearch_exports);
|
|
26
|
+
var import_n8n_workflow = require("n8n-workflow");
|
|
27
|
+
var import_constants = require("../helpers/constants");
|
|
28
|
+
var import_transport = require("../transport");
|
|
29
|
+
function formatSearchResults(items, propertyName, filter) {
|
|
30
|
+
return items.map((item) => ({
|
|
31
|
+
name: String(item[propertyName] ?? ""),
|
|
32
|
+
value: String(item[propertyName] ?? "")
|
|
33
|
+
})).filter(({ name }) => !filter || name.includes(filter)).sort((a, b) => a.name.localeCompare(b.name));
|
|
34
|
+
}
|
|
35
|
+
async function searchUsers(filter, paginationToken) {
|
|
36
|
+
const options = {
|
|
37
|
+
method: "POST",
|
|
38
|
+
url: "",
|
|
39
|
+
body: {
|
|
40
|
+
Action: "ListUsers",
|
|
41
|
+
Version: import_constants.CURRENT_VERSION,
|
|
42
|
+
...paginationToken ? { Marker: paginationToken } : {}
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
const responseData = await import_transport.awsApiRequest.call(this, options);
|
|
46
|
+
const users = responseData.ListUsersResponse.ListUsersResult.Users || [];
|
|
47
|
+
const nextMarker = responseData.ListUsersResponse.ListUsersResult.IsTruncated ? responseData.ListUsersResponse.ListUsersResult.Marker : void 0;
|
|
48
|
+
return {
|
|
49
|
+
results: formatSearchResults(users, "UserName", filter),
|
|
50
|
+
paginationToken: nextMarker
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
async function searchGroups(filter, paginationToken) {
|
|
54
|
+
const options = {
|
|
55
|
+
method: "POST",
|
|
56
|
+
url: "",
|
|
57
|
+
body: {
|
|
58
|
+
Action: "ListGroups",
|
|
59
|
+
Version: import_constants.CURRENT_VERSION,
|
|
60
|
+
...paginationToken ? { Marker: paginationToken } : {}
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
const responseData = await import_transport.awsApiRequest.call(this, options);
|
|
64
|
+
const groups = responseData.ListGroupsResponse.ListGroupsResult.Groups || [];
|
|
65
|
+
const nextMarker = responseData.ListGroupsResponse.ListGroupsResult.IsTruncated ? responseData.ListGroupsResponse.ListGroupsResult.Marker : void 0;
|
|
66
|
+
return {
|
|
67
|
+
results: formatSearchResults(groups, "GroupName", filter),
|
|
68
|
+
paginationToken: nextMarker
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
async function searchGroupsForUser(filter) {
|
|
72
|
+
const userName = this.getNodeParameter("user", void 0, { extractValue: true });
|
|
73
|
+
let allGroups = [];
|
|
74
|
+
let nextMarkerGroups;
|
|
75
|
+
do {
|
|
76
|
+
const options = {
|
|
77
|
+
method: "POST",
|
|
78
|
+
url: "",
|
|
79
|
+
body: {
|
|
80
|
+
Action: "ListGroups",
|
|
81
|
+
Version: import_constants.CURRENT_VERSION,
|
|
82
|
+
...nextMarkerGroups ? { Marker: nextMarkerGroups } : {}
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
const groupsData = await import_transport.awsApiRequest.call(this, options);
|
|
86
|
+
const groups = groupsData.ListGroupsResponse?.ListGroupsResult?.Groups || [];
|
|
87
|
+
nextMarkerGroups = groupsData.ListGroupsResponse?.ListGroupsResult?.IsTruncated ? groupsData.ListGroupsResponse?.ListGroupsResult?.Marker : void 0;
|
|
88
|
+
allGroups = [...allGroups, ...groups];
|
|
89
|
+
} while (nextMarkerGroups);
|
|
90
|
+
if (allGroups.length === 0) {
|
|
91
|
+
return { results: [] };
|
|
92
|
+
}
|
|
93
|
+
const groupCheckPromises = allGroups.map(async (group) => {
|
|
94
|
+
const groupName = group.GroupName;
|
|
95
|
+
if (!groupName) {
|
|
96
|
+
return null;
|
|
97
|
+
}
|
|
98
|
+
try {
|
|
99
|
+
const options = {
|
|
100
|
+
method: "POST",
|
|
101
|
+
url: "",
|
|
102
|
+
body: {
|
|
103
|
+
Action: "GetGroup",
|
|
104
|
+
Version: import_constants.CURRENT_VERSION,
|
|
105
|
+
GroupName: groupName
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
const getGroupResponse = await import_transport.awsApiRequest.call(this, options);
|
|
109
|
+
const groupResult = getGroupResponse?.GetGroupResponse?.GetGroupResult;
|
|
110
|
+
const userExists = groupResult?.Users?.some((user) => user.UserName === userName);
|
|
111
|
+
if (userExists) {
|
|
112
|
+
return { UserName: userName, GroupName: groupName };
|
|
113
|
+
}
|
|
114
|
+
} catch (error) {
|
|
115
|
+
throw new import_n8n_workflow.NodeApiError(this.getNode(), error, {
|
|
116
|
+
message: `Failed to get group ${groupName}: ${error?.message ?? "Unknown error"}`
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
return null;
|
|
120
|
+
});
|
|
121
|
+
const validUserGroups = (await Promise.all(groupCheckPromises)).filter(Boolean);
|
|
122
|
+
return {
|
|
123
|
+
results: formatSearchResults(validUserGroups, "GroupName", filter)
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
127
|
+
0 && (module.exports = {
|
|
128
|
+
searchGroups,
|
|
129
|
+
searchGroupsForUser,
|
|
130
|
+
searchUsers
|
|
131
|
+
});
|
|
132
|
+
//# sourceMappingURL=listSearch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../nodes/Aws/IAM/methods/listSearch.ts"],"sourcesContent":["import type {\n\tIDataObject,\n\tIExecuteSingleFunctions,\n\tIHttpRequestOptions,\n\tILoadOptionsFunctions,\n\tINodeListSearchItems,\n\tINodeListSearchResult,\n\tJsonObject,\n} from 'n8n-workflow';\nimport { NodeApiError } from 'n8n-workflow';\n\nimport { CURRENT_VERSION } from '../helpers/constants';\nimport type {\n\tGetAllGroupsResponseBody,\n\tGetAllUsersResponseBody,\n\tGetGroupResponseBody,\n} from '../helpers/types';\nimport { awsApiRequest } from '../transport';\n\nfunction formatSearchResults(\n\titems: IDataObject[],\n\tpropertyName: string,\n\tfilter?: string,\n): INodeListSearchItems[] {\n\treturn items\n\t\t.map((item) => ({\n\t\t\tname: String(item[propertyName] ?? ''),\n\t\t\tvalue: String(item[propertyName] ?? ''),\n\t\t}))\n\t\t.filter(({ name }) => !filter || name.includes(filter))\n\t\t.sort((a, b) => a.name.localeCompare(b.name));\n}\n\nexport async function searchUsers(\n\tthis: ILoadOptionsFunctions,\n\tfilter?: string,\n\tpaginationToken?: string,\n): Promise<INodeListSearchResult> {\n\tconst options: IHttpRequestOptions = {\n\t\tmethod: 'POST',\n\t\turl: '',\n\t\tbody: {\n\t\t\tAction: 'ListUsers',\n\t\t\tVersion: CURRENT_VERSION,\n\t\t\t...(paginationToken ? { Marker: paginationToken } : {}),\n\t\t},\n\t};\n\tconst responseData = (await awsApiRequest.call(this, options)) as GetAllUsersResponseBody;\n\n\tconst users = responseData.ListUsersResponse.ListUsersResult.Users || [];\n\tconst nextMarker = responseData.ListUsersResponse.ListUsersResult.IsTruncated\n\t\t? responseData.ListUsersResponse.ListUsersResult.Marker\n\t\t: undefined;\n\n\treturn {\n\t\tresults: formatSearchResults(users, 'UserName', filter),\n\t\tpaginationToken: nextMarker,\n\t};\n}\n\nexport async function searchGroups(\n\tthis: ILoadOptionsFunctions,\n\tfilter?: string,\n\tpaginationToken?: string,\n): Promise<INodeListSearchResult> {\n\tconst options: IHttpRequestOptions = {\n\t\tmethod: 'POST',\n\t\turl: '',\n\t\tbody: {\n\t\t\tAction: 'ListGroups',\n\t\t\tVersion: CURRENT_VERSION,\n\t\t\t...(paginationToken ? { Marker: paginationToken } : {}),\n\t\t},\n\t};\n\n\tconst responseData = (await awsApiRequest.call(this, options)) as GetAllGroupsResponseBody;\n\n\tconst groups = responseData.ListGroupsResponse.ListGroupsResult.Groups || [];\n\tconst nextMarker = responseData.ListGroupsResponse.ListGroupsResult.IsTruncated\n\t\t? responseData.ListGroupsResponse.ListGroupsResult.Marker\n\t\t: undefined;\n\n\treturn {\n\t\tresults: formatSearchResults(groups, 'GroupName', filter),\n\t\tpaginationToken: nextMarker,\n\t};\n}\n\nexport async function searchGroupsForUser(\n\tthis: ILoadOptionsFunctions | IExecuteSingleFunctions,\n\tfilter?: string,\n): Promise<INodeListSearchResult> {\n\tconst userName = this.getNodeParameter('user', undefined, { extractValue: true });\n\tlet allGroups: IDataObject[] = [];\n\tlet nextMarkerGroups: string | undefined;\n\tdo {\n\t\tconst options: IHttpRequestOptions = {\n\t\t\tmethod: 'POST',\n\t\t\turl: '',\n\t\t\tbody: {\n\t\t\t\tAction: 'ListGroups',\n\t\t\t\tVersion: CURRENT_VERSION,\n\t\t\t\t...(nextMarkerGroups ? { Marker: nextMarkerGroups } : {}),\n\t\t\t},\n\t\t};\n\n\t\tconst groupsData = (await awsApiRequest.call(this, options)) as GetAllGroupsResponseBody;\n\n\t\tconst groups = groupsData.ListGroupsResponse?.ListGroupsResult?.Groups || [];\n\t\tnextMarkerGroups = groupsData.ListGroupsResponse?.ListGroupsResult?.IsTruncated\n\t\t\t? groupsData.ListGroupsResponse?.ListGroupsResult?.Marker\n\t\t\t: undefined;\n\n\t\tallGroups = [...allGroups, ...groups];\n\t} while (nextMarkerGroups);\n\n\tif (allGroups.length === 0) {\n\t\treturn { results: [] };\n\t}\n\n\tconst groupCheckPromises = allGroups.map(async (group) => {\n\t\tconst groupName = group.GroupName as string;\n\t\tif (!groupName) {\n\t\t\treturn null;\n\t\t}\n\n\t\ttry {\n\t\t\tconst options: IHttpRequestOptions = {\n\t\t\t\tmethod: 'POST',\n\t\t\t\turl: '',\n\t\t\t\tbody: {\n\t\t\t\t\tAction: 'GetGroup',\n\t\t\t\t\tVersion: CURRENT_VERSION,\n\t\t\t\t\tGroupName: groupName,\n\t\t\t\t},\n\t\t\t};\n\n\t\t\tconst getGroupResponse = (await awsApiRequest.call(this, options)) as GetGroupResponseBody;\n\t\t\tconst groupResult = getGroupResponse?.GetGroupResponse?.GetGroupResult;\n\t\t\tconst userExists = groupResult?.Users?.some((user) => user.UserName === userName);\n\n\t\t\tif (userExists) {\n\t\t\t\treturn { UserName: userName, GroupName: groupName };\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tthrow new NodeApiError(this.getNode(), error as JsonObject, {\n\t\t\t\tmessage: `Failed to get group ${groupName}: ${error?.message ?? 'Unknown error'}`,\n\t\t\t});\n\t\t}\n\n\t\treturn null;\n\t});\n\n\tconst validUserGroups = (await Promise.all(groupCheckPromises)).filter(Boolean) as IDataObject[];\n\n\treturn {\n\t\tresults: formatSearchResults(validUserGroups, 'GroupName', filter),\n\t};\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,0BAA6B;AAE7B,uBAAgC;AAMhC,uBAA8B;AAE9B,SAAS,oBACR,OACA,cACA,QACyB;AACzB,SAAO,MACL,IAAI,CAAC,UAAU;AAAA,IACf,MAAM,OAAO,KAAK,YAAY,KAAK,EAAE;AAAA,IACrC,OAAO,OAAO,KAAK,YAAY,KAAK,EAAE;AAAA,EACvC,EAAE,EACD,OAAO,CAAC,EAAE,KAAK,MAAM,CAAC,UAAU,KAAK,SAAS,MAAM,CAAC,EACrD,KAAK,CAAC,GAAG,MAAM,EAAE,KAAK,cAAc,EAAE,IAAI,CAAC;AAC9C;AAEA,eAAsB,YAErB,QACA,iBACiC;AACjC,QAAM,UAA+B;AAAA,IACpC,QAAQ;AAAA,IACR,KAAK;AAAA,IACL,MAAM;AAAA,MACL,QAAQ;AAAA,MACR,SAAS;AAAA,MACT,GAAI,kBAAkB,EAAE,QAAQ,gB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AkB,UAAU,CAAC;AAC3E,uBAAmB,WAAW,oBAAoB,kBAAkB,cACjE,WAAW,oBAAoB,kBAAkB,SACjD;AAEH,gBAAY,CAAC,GAAG,WAAW,GAAG,MAAM;AAAA,EACrC,SAAS;AAET,MAAI,UAAU,WAAW,GAAG;AAC3B,WAAO,EAAE,SAAS,CAAC,EAAE;AAAA,EACtB;AAEA,QAAM,qBAAqB,UAAU,IAAI,OAAO,UAAU;AACzD,UAAM,YAAY,MAAM;AACxB,QAAI,CAAC,WAAW;AACf,aAAO;AAAA,IACR;AAEA,QAAI;AACH,YAAM,UAA+B;AAAA,QACpC,QAAQ;AAAA,QACR,KAAK;AAAA,QACL,MAAM;AAAA,UACL,QAAQ;AAAA,UACR,SAAS;AAAA,UACT,WAAW;AAAA,QACZ;AAAA,MACD;AAEA,YAAM,mBAAoB,MAAM,+BAAc,KAAK,MAAM,OAAO;AAChE,YAAM,cAAc,kBAAkB,kBAAkB;AACxD,YAAM,aAAa,aAAa,OAAO,KAAK,CAAC,SAAS,KAAK,aAAa,QAAQ;AAEhF,UAAI,YAAY;AACf,eAAO,EAAE,UAAU,UAAU,WAAW,UAAU;AAAA,MACnD;AAAA,IACD,SAAS,OAAO;AACf,YAAM,IAAI,iCAAa,KAAK,QAAQ,GAAG,OAAqB;AAAA,QAC3D,SAAS,uBAAuB,SAAS,KAAK,OAAO,WAAW,eAAe;AAAA,MAChF,CAAC;AAAA,IACF;AAEA,WAAO;AAAA,EACR,CAAC;AAED,QAAM,mBAAmB,MAAM,QAAQ,IAAI,kBAAkB,GAAG,OAAO,OAAO;AAE9E,SAAO;AAAA,IACN,SAAS,oBAAoB,iBAAiB,aAAa,MAAM;AAAA,EAClE;AACD;","names":[]}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var transport_exports = {};
|
|
20
|
+
__export(transport_exports, {
|
|
21
|
+
awsApiRequest: () => awsApiRequest
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(transport_exports);
|
|
24
|
+
var import_n8n_workflow = require("n8n-workflow");
|
|
25
|
+
var import_constants = require("../helpers/constants");
|
|
26
|
+
const errorMapping = {
|
|
27
|
+
403: "The AWS credentials are not valid!"
|
|
28
|
+
};
|
|
29
|
+
async function awsApiRequest(opts) {
|
|
30
|
+
const requestOptions = {
|
|
31
|
+
baseURL: import_constants.BASE_URL,
|
|
32
|
+
json: true,
|
|
33
|
+
...opts,
|
|
34
|
+
headers: {
|
|
35
|
+
"Content-Type": "application/x-www-form-urlencoded",
|
|
36
|
+
...opts.headers ?? {}
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
if (opts.body) {
|
|
40
|
+
requestOptions.body = new URLSearchParams(opts.body).toString();
|
|
41
|
+
}
|
|
42
|
+
try {
|
|
43
|
+
const response = await this.helpers.requestWithAuthentication.call(
|
|
44
|
+
this,
|
|
45
|
+
"aws",
|
|
46
|
+
requestOptions
|
|
47
|
+
);
|
|
48
|
+
return response;
|
|
49
|
+
} catch (error) {
|
|
50
|
+
const statusCode = error?.statusCode || error?.cause?.statusCode;
|
|
51
|
+
if (statusCode && errorMapping[statusCode]) {
|
|
52
|
+
throw new import_n8n_workflow.NodeApiError(this.getNode(), {
|
|
53
|
+
message: `AWS error response [${statusCode}]: ${errorMapping[statusCode]}`
|
|
54
|
+
});
|
|
55
|
+
} else {
|
|
56
|
+
throw new import_n8n_workflow.NodeApiError(this.getNode(), error);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
61
|
+
0 && (module.exports = {
|
|
62
|
+
awsApiRequest
|
|
63
|
+
});
|
|
64
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../nodes/Aws/IAM/transport/index.ts"],"sourcesContent":["import type {\n\tIExecuteSingleFunctions,\n\tIDataObject,\n\tIHttpRequestOptions,\n\tILoadOptionsFunctions,\n\tIPollFunctions,\n\tJsonObject,\n} from 'n8n-workflow';\nimport { NodeApiError } from 'n8n-workflow';\n\nimport { BASE_URL } from '../helpers/constants';\n\nconst errorMapping: IDataObject = {\n\t403: 'The AWS credentials are not valid!',\n};\n\nexport async function awsApiRequest(\n\tthis: ILoadOptionsFunctions | IPollFunctions | IExecuteSingleFunctions,\n\topts: IHttpRequestOptions,\n): Promise<IDataObject> {\n\tconst requestOptions: IHttpRequestOptions = {\n\t\tbaseURL: BASE_URL,\n\t\tjson: true,\n\t\t...opts,\n\t\theaders: {\n\t\t\t'Content-Type': 'application/x-www-form-urlencoded',\n\t\t\t...(opts.headers ?? {}),\n\t\t},\n\t};\n\n\tif (opts.body) {\n\t\trequestOptions.body = new URLSearchParams(opts.body as Record<string, string>).toString();\n\t}\n\n\ttry {\n\t\tconst response = (await this.helpers.requestWithAuthentication.call(\n\t\t\tthis,\n\t\t\t'aws',\n\t\t\trequestOptions,\n\t\t)) as IDataObject;\n\n\t\treturn response;\n\t} catch (error) {\n\t\tconst statusCode = (error?.statusCode || error?.cause?.statusCode) as string;\n\n\t\tif (statusCode && errorMapping[statusCode]) {\n\t\t\tthrow new NodeApiError(this.getNode(), {\n\t\t\t\tmessage: `AWS error response [${statusCode}]: ${errorMapping[statusCode] as string}`,\n\t\t\t});\n\t\t} else {\n\t\t\tthrow new NodeApiError(this.getNode(), error as JsonObject);\n\t\t}\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA,0BAA6B;AAE7B,uBAAyB;AAEzB,MAAM,eAA4B;AAAA,EACjC,KAAK;AACN;AAEA,eAAsB,cAErB,MACuB;AACvB,QAAM,iBAAsC;AAAA,IAC3C,SAAS;AAAA,IACT,MAAM;AAAA,IACN,GAAG;AAAA,IACH,SAAS;AAAA,MACR,gBAAgB;AAAA,MAChB,GAAI,KAAK,WAAW,CAAC;AAAA,IACtB;AAAA,EACD;AAEA,MAAI,KAAK,MAAM;AACd,mBAAe,OAAO,IAAI,gBAAgB,KAAK,IAA8B,EAAE,SAAS;AAAA,EACzF;AAEA,MAAI;AACH,UAAM,WAAY,MAAM,KAAK,QAAQ,0BAA0B;AAAA,MAC9D;AAAA,MACA;AAAA,MACA;AAAA,IACD;AAEA,WAAO;AAAA,EACR,SAAS,OAAO;AACf,UAAM,aAAc,OAAO,cAAc,OAAO,OAAO;AAEvD,QAAI,cAAc,aAAa,UAAU,GAAG;AAC3C,YAAM,IAAI,iCAAa,KAAK,QAAQ,GAAG;AAAA,QACtC,SAAS,uBAAuB,UAAU,MAAM,aAAa,UAAU,CAAW;AAAA,MACnF,CAAC;AAAA,IACF,OAAO;AACN,YAAM,IAAI,iCAAa,KAAK,QAAQ,GAAG,KAAmB;AAAA,IAC3D;AAAA,EACD;AACD;","names":[]}
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "object",
|
|
3
3
|
"properties": {
|
|
4
|
-
"ChecksumAlgorithm": {
|
|
5
|
-
"type": "string"
|
|
6
|
-
},
|
|
7
|
-
"ChecksumType": {
|
|
8
|
-
"type": "string"
|
|
9
|
-
},
|
|
10
4
|
"ETag": {
|
|
11
5
|
"type": "string"
|
|
12
6
|
},
|
|
@@ -23,5 +17,5 @@
|
|
|
23
17
|
"type": "string"
|
|
24
18
|
}
|
|
25
19
|
},
|
|
26
|
-
"version":
|
|
20
|
+
"version": 2
|
|
27
21
|
}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "object",
|
|
3
3
|
"properties": {
|
|
4
|
+
"canUploadPhoto": {
|
|
5
|
+
"type": "boolean"
|
|
6
|
+
},
|
|
4
7
|
"displayName": {
|
|
5
8
|
"type": "string"
|
|
6
9
|
},
|
|
@@ -12,7 +15,13 @@
|
|
|
12
15
|
},
|
|
13
16
|
"lastName": {
|
|
14
17
|
"type": "string"
|
|
18
|
+
},
|
|
19
|
+
"photoUploaded": {
|
|
20
|
+
"type": "boolean"
|
|
21
|
+
},
|
|
22
|
+
"photoUrl": {
|
|
23
|
+
"type": "string"
|
|
15
24
|
}
|
|
16
25
|
},
|
|
17
|
-
"version":
|
|
26
|
+
"version": 2
|
|
18
27
|
}
|
|
@@ -42,7 +42,7 @@ class Cron {
|
|
|
42
42
|
outputs: [import_n8n_workflow.NodeConnectionTypes.Main],
|
|
43
43
|
properties: [
|
|
44
44
|
{
|
|
45
|
-
displayName: `This workflow will run on the schedule you define here once you <a data-key="activate">activate</a> it.<br><br>For testing, you can also trigger it manually: by going back to the canvas and clicking '
|
|
45
|
+
displayName: `This workflow will run on the schedule you define here once you <a data-key="activate">activate</a> it.<br><br>For testing, you can also trigger it manually: by going back to the canvas and clicking 'execute workflow'`,
|
|
46
46
|
name: "notice",
|
|
47
47
|
type: "notice",
|
|
48
48
|
default: ""
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../nodes/Cron/Cron.node.ts"],"sourcesContent":["import type {\n\tITriggerFunctions,\n\tINodeType,\n\tINodeTypeDescription,\n\tITriggerResponse,\n\tTriggerTime,\n} from 'n8n-workflow';\nimport { NodeConnectionTypes, NodeHelpers, toCronExpression } from 'n8n-workflow';\n\nexport class Cron implements INodeType {\n\tdescription: INodeTypeDescription = {\n\t\tdisplayName: 'Cron',\n\t\tname: 'cron',\n\t\ticon: 'fa:clock',\n\t\tgroup: ['trigger', 'schedule'],\n\t\tversion: 1,\n\t\thidden: true,\n\t\tdescription: 'Triggers the workflow at a specific time',\n\t\teventTriggerDescription: '',\n\t\tactivationMessage:\n\t\t\t'Your cron trigger will now trigger executions on the schedule you have defined.',\n\t\tdefaults: {\n\t\t\tname: 'Cron',\n\t\t\tcolor: '#29a568',\n\t\t},\n\n\t\tinputs: [],\n\t\toutputs: [NodeConnectionTypes.Main],\n\t\tproperties: [\n\t\t\t{\n\t\t\t\tdisplayName:\n\t\t\t\t\t'This workflow will run on the schedule you define here once you <a data-key=\"activate\">activate</a> it.<br><br>For testing, you can also trigger it manually: by going back to the canvas and clicking \\'
|
|
1
|
+
{"version":3,"sources":["../../../nodes/Cron/Cron.node.ts"],"sourcesContent":["import type {\n\tITriggerFunctions,\n\tINodeType,\n\tINodeTypeDescription,\n\tITriggerResponse,\n\tTriggerTime,\n} from 'n8n-workflow';\nimport { NodeConnectionTypes, NodeHelpers, toCronExpression } from 'n8n-workflow';\n\nexport class Cron implements INodeType {\n\tdescription: INodeTypeDescription = {\n\t\tdisplayName: 'Cron',\n\t\tname: 'cron',\n\t\ticon: 'fa:clock',\n\t\tgroup: ['trigger', 'schedule'],\n\t\tversion: 1,\n\t\thidden: true,\n\t\tdescription: 'Triggers the workflow at a specific time',\n\t\teventTriggerDescription: '',\n\t\tactivationMessage:\n\t\t\t'Your cron trigger will now trigger executions on the schedule you have defined.',\n\t\tdefaults: {\n\t\t\tname: 'Cron',\n\t\t\tcolor: '#29a568',\n\t\t},\n\n\t\tinputs: [],\n\t\toutputs: [NodeConnectionTypes.Main],\n\t\tproperties: [\n\t\t\t{\n\t\t\t\tdisplayName:\n\t\t\t\t\t'This workflow will run on the schedule you define here once you <a data-key=\"activate\">activate</a> it.<br><br>For testing, you can also trigger it manually: by going back to the canvas and clicking \\'execute workflow\\'',\n\t\t\t\tname: 'notice',\n\t\t\t\ttype: 'notice',\n\t\t\t\tdefault: '',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Trigger Times',\n\t\t\t\tname: 'triggerTimes',\n\t\t\t\ttype: 'fixedCollection',\n\t\t\t\ttypeOptions: {\n\t\t\t\t\tmultipleValues: true,\n\t\t\t\t\tmultipleValueButtonText: 'Add Time',\n\t\t\t\t},\n\t\t\t\tdefault: {},\n\t\t\t\tdescription: 'Triggers for the workflow',\n\t\t\t\tplaceholder: 'Add Cron Time',\n\t\t\t\toptions: NodeHelpers.cronNodeOptions,\n\t\t\t},\n\t\t],\n\t};\n\n\tasync trigger(this: ITriggerFunctions): Promise<ITriggerResponse> {\n\t\tconst triggerTimes = this.getNodeParameter('triggerTimes') as unknown as {\n\t\t\titem: TriggerTime[];\n\t\t};\n\n\t\t// Get all the trigger times\n\t\tconst cronTimes = (triggerTimes.item || []).map(toCronExpression);\n\n\t\t// The trigger function to execute when the cron-time got reached\n\t\t// or when manually triggered\n\t\tconst executeTrigger = () => {\n\t\t\tthis.emit([this.helpers.returnJsonArray([{}])]);\n\t\t};\n\n\t\t// Register the cron-jobs\n\t\tcronTimes.forEach((cronTime) => this.helpers.registerCron(cronTime, executeTrigger));\n\n\t\treturn {\n\t\t\tmanualTriggerFunction: async () => executeTrigger(),\n\t\t};\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA,0BAAmE;AAE5D,MAAM,KAA0B;AAAA,EAAhC;AACN,uBAAoC;AAAA,MACnC,aAAa;AAAA,MACb,MAAM;AAAA,MACN,MAAM;AAAA,MACN,OAAO,CAAC,WAAW,UAAU;AAAA,MAC7B,SAAS;AAAA,MACT,QAAQ;AAAA,MACR,aAAa;AAAA,MACb,yBAAyB;AAAA,MACzB,mBACC;AAAA,MACD,UAAU;AAAA,QACT,MAAM;AAAA,QACN,OAAO;AAAA,MACR;AAAA,MAEA,QAAQ,CAAC;AAAA,MACT,SAAS,CAAC,wCAAoB,IAAI;AAAA,MAClC,YAAY;AAAA,QACX;AAAA,UACC,aACC;AAAA,UACD,MAAM;AAAA,UACN,MAAM;AAAA,UACN,SAAS;AAAA,QACV;AAAA,QACA;AAAA,UACC,aAAa;AAAA,UACb,MAAM;AAAA,UACN,MAAM;AAAA,UACN,aAAa;AAAA,YACZ,gBAAgB;AAAA,YAChB,yBAAyB;AAAA,UAC1B;AAAA,UACA,SAAS,CAAC;AAAA,UACV,aAAa;AAAA,UACb,aAAa;AAAA,UACb,SAAS,gCAAY;AAAA,QACtB;AAAA,MACD;AAAA,IACD;AAAA;AAAA,EAEA,MAAM,UAA4D;AACjE,UAAM,eAAe,KAAK,iBAAiB,cAAc;AAKzD,UAAM,aAAa,aAAa,QAAQ,CAAC,GAAG,IAAI,oCAAgB;AAIhE,UAAM,iBAAiB,MAAM;AAC5B,WAAK,KAAK,CAAC,KAAK,QAAQ,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAAA,IAC/C;AAGA,cAAU,QAAQ,CAAC,aAAa,KAAK,QAAQ,aAAa,UAAU,cAAc,CAAC;AAEnF,WAAO;AAAA,MACN,uBAAuB,YAAY,eAAe;AAAA,IACnD;AAAA,EACD;AACD;","names":[]}
|
|
@@ -13,20 +13,6 @@
|
|
|
13
13
|
"country": {
|
|
14
14
|
"type": "string"
|
|
15
15
|
},
|
|
16
|
-
"email": {
|
|
17
|
-
"type": "array",
|
|
18
|
-
"items": {
|
|
19
|
-
"type": "object",
|
|
20
|
-
"properties": {
|
|
21
|
-
"email": {
|
|
22
|
-
"type": "string"
|
|
23
|
-
},
|
|
24
|
-
"qualification": {
|
|
25
|
-
"type": "string"
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
16
|
"first_name": {
|
|
31
17
|
"type": "string"
|
|
32
18
|
},
|
|
@@ -54,6 +40,12 @@
|
|
|
54
40
|
"siren": {
|
|
55
41
|
"type": "string"
|
|
56
42
|
},
|
|
43
|
+
"siret": {
|
|
44
|
+
"type": "string"
|
|
45
|
+
},
|
|
46
|
+
"siret_address": {
|
|
47
|
+
"type": "string"
|
|
48
|
+
},
|
|
57
49
|
"vat": {
|
|
58
50
|
"type": "string"
|
|
59
51
|
},
|
|
@@ -61,5 +53,5 @@
|
|
|
61
53
|
"type": "string"
|
|
62
54
|
}
|
|
63
55
|
},
|
|
64
|
-
"version":
|
|
56
|
+
"version": 2
|
|
65
57
|
}
|
|
@@ -77,8 +77,8 @@ const versionDescription = {
|
|
|
77
77
|
triggerPanel: {
|
|
78
78
|
header: "",
|
|
79
79
|
executionsHelp: {
|
|
80
|
-
inactive: "<b>While building your workflow</b>, click the '
|
|
81
|
-
active: "<b>While building your workflow</b>, click the '
|
|
80
|
+
inactive: "<b>While building your workflow</b>, click the 'execute step' button, then send an email to make an event happen. This will trigger an execution, which will show up in this editor.<br /> <br /><b>Once you're happy with your workflow</b>, <a data-key='activate'>activate</a> it. Then every time an email is received, the workflow will execute. These executions will show up in the <a data-key='executions'>executions list</a>, but not in the editor.",
|
|
81
|
+
active: "<b>While building your workflow</b>, click the 'execute step' button, then send an email to make an event happen. This will trigger an execution, which will show up in this editor.<br /> <br /><b>Your workflow will also execute automatically</b>, since it's activated. Every time an email is received, this node will trigger an execution. These executions will show up in the <a data-key='executions'>executions list</a>, but not in the editor."
|
|
82
82
|
},
|
|
83
83
|
activationHint: "Once you\u2019ve finished building your workflow, <a data-key='activate'>activate</a> it to have it also listen continuously (you just won\u2019t see those executions here)."
|
|
84
84
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../nodes/EmailReadImap/v1/EmailReadImapV1.node.ts"],"sourcesContent":["import type { ImapSimple, ImapSimpleOptions, Message } from '@n8n/imap';\nimport { connect as imapConnect, getParts } from '@n8n/imap';\nimport find from 'lodash/find';\nimport isEmpty from 'lodash/isEmpty';\nimport type { Source as ParserSource } from 'mailparser';\nimport { simpleParser } from 'mailparser';\nimport { NodeConnectionTypes, NodeOperationError } from 'n8n-workflow';\nimport type {\n\tITriggerFunctions,\n\tIBinaryData,\n\tIBinaryKeyData,\n\tICredentialDataDecryptedObject,\n\tICredentialsDecrypted,\n\tICredentialTestFunctions,\n\tIDataObject,\n\tINodeCredentialTestResult,\n\tINodeExecutionData,\n\tINodeType,\n\tINodeTypeBaseDescription,\n\tINodeTypeDescription,\n\tITriggerResponse,\n} from 'n8n-workflow';\n\nexport async function parseRawEmail(\n\tthis: ITriggerFunctions,\n\tmessageEncoded: ParserSource,\n\tdataPropertyNameDownload: string,\n): Promise<INodeExecutionData> {\n\tconst responseData = await simpleParser(messageEncoded);\n\tconst headers: IDataObject = {};\n\tfor (const header of responseData.headerLines) {\n\t\theaders[header.key] = header.line;\n\t}\n\n\t// @ts-ignore\n\tresponseData.headers = headers;\n\t// @ts-ignore\n\tresponseData.headerLines = undefined;\n\n\tconst binaryData: IBinaryKeyData = {};\n\tif (responseData.attachments) {\n\t\tfor (let i = 0; i < responseData.attachments.length; i++) {\n\t\t\tconst attachment = responseData.attachments[i];\n\t\t\tbinaryData[`${dataPropertyNameDownload}${i}`] = await this.helpers.prepareBinaryData(\n\t\t\t\tattachment.content,\n\t\t\t\tattachment.filename,\n\t\t\t\tattachment.contentType,\n\t\t\t);\n\t\t}\n\t\t// @ts-ignore\n\t\tresponseData.attachments = undefined;\n\t}\n\n\treturn {\n\t\tjson: responseData as unknown as IDataObject,\n\t\tbinary: Object.keys(binaryData).length ? binaryData : undefined,\n\t} as INodeExecutionData;\n}\n\nconst versionDescription: INodeTypeDescription = {\n\tdisplayName: 'Email Trigger (IMAP)',\n\tname: 'emailReadImap',\n\ticon: 'fa:inbox',\n\tgroup: ['trigger'],\n\tversion: 1,\n\tdescription: 'Triggers the workflow when a new email is received',\n\teventTriggerDescription: 'Waiting for you to receive an email',\n\tdefaults: {\n\t\tname: 'Email Trigger (IMAP)',\n\t\tcolor: '#44AA22',\n\t},\n\ttriggerPanel: {\n\t\theader: '',\n\t\texecutionsHelp: {\n\t\t\tinactive:\n\t\t\t\t\"<b>While building your workflow</b>, click the 'test step' button, then send an email to make an event happen. This will trigger an execution, which will show up in this editor.<br /> <br /><b>Once you're happy with your workflow</b>, <a data-key='activate'>activate</a> it. Then every time an email is received, the workflow will execute. These executions will show up in the <a data-key='executions'>executions list</a>, but not in the editor.\",\n\t\t\tactive:\n\t\t\t\t\"<b>While building your workflow</b>, click the 'test step' button, then send an email to make an event happen. This will trigger an execution, which will show up in this editor.<br /> <br /><b>Your workflow will also execute automatically</b>, since it's activated. Every time an email is received, this node will trigger an execution. These executions will show up in the <a data-key='executions'>executions list</a>, but not in the editor.\",\n\t\t},\n\t\tactivationHint:\n\t\t\t\"Once you’ve finished building your workflow, <a data-key='activate'>activate</a> it to have it also listen continuously (you just won’t see those executions here).\",\n\t},\n\n\tinputs: [],\n\toutputs: [NodeConnectionTypes.Main],\n\tcredentials: [\n\t\t{\n\t\t\tname: 'imap',\n\t\t\trequired: true,\n\t\t\ttestedBy: 'imapConnectionTest',\n\t\t},\n\t],\n\tproperties: [\n\t\t{\n\t\t\tdisplayName: 'Mailbox Name',\n\t\t\tname: 'mailbox',\n\t\t\ttype: 'string',\n\t\t\tdefault: 'INBOX',\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Action',\n\t\t\tname: 'postProcessAction',\n\t\t\ttype: 'options',\n\t\t\toptions: [\n\t\t\t\t{\n\t\t\t\t\tname: 'Mark as Read',\n\t\t\t\t\tvalue: 'read',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'Nothing',\n\t\t\t\t\tvalue: 'nothing',\n\t\t\t\t},\n\t\t\t],\n\t\t\tdefault: 'read',\n\t\t\tdescription:\n\t\t\t\t'What to do after the email has been received. If \"nothing\" gets selected it will be processed multiple times.',\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Download Attachments',\n\t\t\tname: 'downloadAttachments',\n\t\t\ttype: 'boolean',\n\t\t\tdefault: false,\n\t\t\tdisplayOptions: {\n\t\t\t\tshow: {\n\t\t\t\t\tformat: ['simple'],\n\t\t\t\t},\n\t\t\t},\n\t\t\tdescription:\n\t\t\t\t'Whether attachments of emails should be downloaded. Only set if needed as it increases processing.',\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Format',\n\t\t\tname: 'format',\n\t\t\ttype: 'options',\n\t\t\toptions: [\n\t\t\t\t{\n\t\t\t\t\tname: 'RAW',\n\t\t\t\t\tvalue: 'raw',\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t'Returns the full email message data with body content in the raw field as a base64url encoded string; the payload field is not used',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'Resolved',\n\t\t\t\t\tvalue: 'resolved',\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t'Returns the full email with all data resolved and attachments saved as binary data',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'Simple',\n\t\t\t\t\tvalue: 'simple',\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t'Returns the full email; do not use if you wish to gather inline attachments',\n\t\t\t\t},\n\t\t\t],\n\t\t\tdefault: 'simple',\n\t\t\tdescription: 'The format to return the message in',\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Property Prefix Name',\n\t\t\tname: 'dataPropertyAttachmentsPrefixName',\n\t\t\ttype: 'string',\n\t\t\tdefault: 'attachment_',\n\t\t\tdisplayOptions: {\n\t\t\t\tshow: {\n\t\t\t\t\tformat: ['resolved'],\n\t\t\t\t},\n\t\t\t},\n\t\t\tdescription:\n\t\t\t\t'Prefix for name of the binary property to which to write the attachments. An index starting with 0 will be added. So if name is \"attachment_\" the first attachment is saved to \"attachment_0\"',\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Property Prefix Name',\n\t\t\tname: 'dataPropertyAttachmentsPrefixName',\n\t\t\ttype: 'string',\n\t\t\tdefault: 'attachment_',\n\t\t\tdisplayOptions: {\n\t\t\t\tshow: {\n\t\t\t\t\tformat: ['simple'],\n\t\t\t\t\tdownloadAttachments: [true],\n\t\t\t\t},\n\t\t\t},\n\t\t\tdescription:\n\t\t\t\t'Prefix for name of the binary property to which to write the attachments. An index starting with 0 will be added. So if name is \"attachment_\" the first attachment is saved to \"attachment_0\"',\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Options',\n\t\t\tname: 'options',\n\t\t\ttype: 'collection',\n\t\t\tplaceholder: 'Add option',\n\t\t\tdefault: {},\n\t\t\toptions: [\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Custom Email Rules',\n\t\t\t\t\tname: 'customEmailConfig',\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tdefault: '[\"UNSEEN\"]',\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t'Custom email fetching rules. See <a href=\"https://github.com/mscdex/node-imap\">node-imap</a>\\'s search function for more details.',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Ignore SSL Issues (Insecure)',\n\t\t\t\t\tname: 'allowUnauthorizedCerts',\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: false,\n\t\t\t\t\tdescription: 'Whether to connect even if SSL certificate validation is not possible',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Force Reconnect',\n\t\t\t\t\tname: 'forceReconnect',\n\t\t\t\t\ttype: 'number',\n\t\t\t\t\tdefault: 60,\n\t\t\t\t\tdescription: 'Sets an interval (in minutes) to force a reconnection',\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t],\n};\n\nexport class EmailReadImapV1 implements INodeType {\n\tdescription: INodeTypeDescription;\n\n\tconstructor(baseDescription: INodeTypeBaseDescription) {\n\t\tthis.description = {\n\t\t\t...baseDescription,\n\t\t\t...versionDescription,\n\t\t};\n\t}\n\n\tmethods = {\n\t\tcredentialTest: {\n\t\t\tasync imapConnectionTest(\n\t\t\t\tthis: ICredentialTestFunctions,\n\t\t\t\tcredential: ICredentialsDecrypted,\n\t\t\t): Promise<INodeCredentialTestResult> {\n\t\t\t\tconst credentials = credential.data as ICredentialDataDecryptedObject;\n\t\t\t\ttry {\n\t\t\t\t\tconst config: ImapSimpleOptions = {\n\t\t\t\t\t\timap: {\n\t\t\t\t\t\t\tuser: credentials.user as string,\n\t\t\t\t\t\t\tpassword: credentials.password as string,\n\t\t\t\t\t\t\thost: (credentials.host as string).trim(),\n\t\t\t\t\t\t\tport: credentials.port as number,\n\t\t\t\t\t\t\ttls: credentials.secure as boolean,\n\t\t\t\t\t\t\tauthTimeout: 20000,\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\t\tconst tlsOptions: IDataObject = {};\n\n\t\t\t\t\tif (credentials.secure) {\n\t\t\t\t\t\ttlsOptions.servername = (credentials.host as string).trim();\n\t\t\t\t\t}\n\t\t\t\t\tif (!isEmpty(tlsOptions)) {\n\t\t\t\t\t\tconfig.imap.tlsOptions = tlsOptions;\n\t\t\t\t\t}\n\t\t\t\t\tconst connection = await imapConnect(config);\n\t\t\t\t\tawait connection.getBoxes();\n\t\t\t\t} catch (error) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tstatus: 'Error',\n\t\t\t\t\t\tmessage: error.message,\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\tstatus: 'OK',\n\t\t\t\t\tmessage: 'Connection successful!',\n\t\t\t\t};\n\t\t\t},\n\t\t},\n\t};\n\n\tasync trigger(this: ITriggerFunctions): Promise<ITriggerResponse> {\n\t\tconst credentials = await this.getCredentials('imap');\n\n\t\tconst mailbox = this.getNodeParameter('mailbox') as string;\n\t\tconst postProcessAction = this.getNodeParameter('postProcessAction') as string;\n\t\tconst options = this.getNodeParameter('options', {}) as IDataObject;\n\n\t\tconst staticData = this.getWorkflowStaticData('node');\n\t\tthis.logger.debug('Loaded static data for node \"EmailReadImap\"', { staticData });\n\n\t\tlet connection: ImapSimple;\n\n\t\t// Returns the email text\n\n\t\tconst getText = async (parts: any[], message: Message, subtype: string): Promise<string> => {\n\t\t\tif (!message.attributes.struct) {\n\t\t\t\treturn '';\n\t\t\t}\n\n\t\t\tconst textParts = parts.filter((part) => {\n\t\t\t\treturn (\n\t\t\t\t\tpart.type.toUpperCase() === 'TEXT' && part.subtype.toUpperCase() === subtype.toUpperCase()\n\t\t\t\t);\n\t\t\t});\n\n\t\t\tconst part = textParts[0];\n\t\t\tif (!part) {\n\t\t\t\treturn '';\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tconst partData = await connection.getPartData(message, part);\n\t\t\t\treturn partData.toString();\n\t\t\t} catch {\n\t\t\t\treturn '';\n\t\t\t}\n\t\t};\n\n\t\t// Returns the email attachments\n\t\tconst getAttachment = async (\n\t\t\timapConnection: ImapSimple,\n\t\t\tparts: any[],\n\t\t\tmessage: Message,\n\t\t): Promise<IBinaryData[]> => {\n\t\t\tif (!message.attributes.struct) {\n\t\t\t\treturn [];\n\t\t\t}\n\n\t\t\t// Check if the message has attachments and if so get them\n\t\t\tconst attachmentParts = parts.filter((part) => {\n\t\t\t\treturn part.disposition && part.disposition.type.toUpperCase() === 'ATTACHMENT';\n\t\t\t});\n\n\t\t\tconst attachmentPromises = [];\n\t\t\tlet attachmentPromise;\n\t\t\tfor (const attachmentPart of attachmentParts) {\n\t\t\t\tattachmentPromise = imapConnection\n\t\t\t\t\t.getPartData(message, attachmentPart)\n\t\t\t\t\t.then(async (partData) => {\n\t\t\t\t\t\t// Return it in the format n8n expects\n\t\t\t\t\t\treturn await this.helpers.prepareBinaryData(\n\t\t\t\t\t\t\tpartData.buffer,\n\t\t\t\t\t\t\tattachmentPart.disposition.params.filename as string,\n\t\t\t\t\t\t);\n\t\t\t\t\t});\n\n\t\t\t\tattachmentPromises.push(attachmentPromise);\n\t\t\t}\n\n\t\t\treturn await Promise.all(attachmentPromises);\n\t\t};\n\n\t\t// Returns all the new unseen messages\n\t\tconst getNewEmails = async (\n\t\t\timapConnection: ImapSimple,\n\t\t\tsearchCriteria: Array<string | string[]>,\n\t\t): Promise<INodeExecutionData[]> => {\n\t\t\tconst format = this.getNodeParameter('format', 0) as string;\n\n\t\t\tlet fetchOptions = {};\n\n\t\t\tif (format === 'simple' || format === 'raw') {\n\t\t\t\tfetchOptions = {\n\t\t\t\t\tbodies: ['TEXT', 'HEADER'],\n\t\t\t\t\tmarkSeen: false,\n\t\t\t\t\tstruct: true,\n\t\t\t\t};\n\t\t\t} else if (format === 'resolved') {\n\t\t\t\tfetchOptions = {\n\t\t\t\t\tbodies: [''],\n\t\t\t\t\tmarkSeen: false,\n\t\t\t\t\tstruct: true,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tconst results = await imapConnection.search(searchCriteria, fetchOptions);\n\n\t\t\tconst newEmails: INodeExecutionData[] = [];\n\t\t\tlet newEmail: INodeExecutionData;\n\t\t\tlet attachments: IBinaryData[];\n\t\t\tlet propertyName: string;\n\n\t\t\t// All properties get by default moved to metadata except the ones\n\t\t\t// which are defined here which get set on the top level.\n\t\t\tconst topLevelProperties = ['cc', 'date', 'from', 'subject', 'to'];\n\n\t\t\tif (format === 'resolved') {\n\t\t\t\tconst dataPropertyAttachmentsPrefixName = this.getNodeParameter(\n\t\t\t\t\t'dataPropertyAttachmentsPrefixName',\n\t\t\t\t) as string;\n\n\t\t\t\tfor (const message of results) {\n\t\t\t\t\tif (\n\t\t\t\t\t\tstaticData.lastMessageUid !== undefined &&\n\t\t\t\t\t\tmessage.attributes.uid <= (staticData.lastMessageUid as number)\n\t\t\t\t\t) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif (\n\t\t\t\t\t\tstaticData.lastMessageUid === undefined ||\n\t\t\t\t\t\t(staticData.lastMessageUid as number) < message.attributes.uid\n\t\t\t\t\t) {\n\t\t\t\t\t\tstaticData.lastMessageUid = message.attributes.uid;\n\t\t\t\t\t}\n\t\t\t\t\tconst part = find(message.parts, { which: '' });\n\n\t\t\t\t\tif (part === undefined) {\n\t\t\t\t\t\tthrow new NodeOperationError(this.getNode(), 'Email part could not be parsed.');\n\t\t\t\t\t}\n\t\t\t\t\tconst parsedEmail = await parseRawEmail.call(\n\t\t\t\t\t\tthis,\n\t\t\t\t\t\tpart.body as Buffer,\n\t\t\t\t\t\tdataPropertyAttachmentsPrefixName,\n\t\t\t\t\t);\n\n\t\t\t\t\tnewEmails.push(parsedEmail);\n\t\t\t\t}\n\t\t\t} else if (format === 'simple') {\n\t\t\t\tconst downloadAttachments = this.getNodeParameter('downloadAttachments') as boolean;\n\n\t\t\t\tlet dataPropertyAttachmentsPrefixName = '';\n\t\t\t\tif (downloadAttachments) {\n\t\t\t\t\tdataPropertyAttachmentsPrefixName = this.getNodeParameter(\n\t\t\t\t\t\t'dataPropertyAttachmentsPrefixName',\n\t\t\t\t\t) as string;\n\t\t\t\t}\n\n\t\t\t\tfor (const message of results) {\n\t\t\t\t\tif (\n\t\t\t\t\t\tstaticData.lastMessageUid !== undefined &&\n\t\t\t\t\t\tmessage.attributes.uid <= (staticData.lastMessageUid as number)\n\t\t\t\t\t) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif (\n\t\t\t\t\t\tstaticData.lastMessageUid === undefined ||\n\t\t\t\t\t\t(staticData.lastMessageUid as number) < message.attributes.uid\n\t\t\t\t\t) {\n\t\t\t\t\t\tstaticData.lastMessageUid = message.attributes.uid;\n\t\t\t\t\t}\n\t\t\t\t\tconst parts = getParts(message.attributes.struct!);\n\n\t\t\t\t\tnewEmail = {\n\t\t\t\t\t\tjson: {\n\t\t\t\t\t\t\ttextHtml: await getText(parts, message, 'html'),\n\t\t\t\t\t\t\ttextPlain: await getText(parts, message, 'plain'),\n\t\t\t\t\t\t\tmetadata: {} as IDataObject,\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\n\t\t\t\t\tconst messageHeader = message.parts.filter((part) => part.which === 'HEADER');\n\n\t\t\t\t\tconst messageBody = messageHeader[0].body as Record<string, string[]>;\n\t\t\t\t\tfor (propertyName of Object.keys(messageBody as IDataObject)) {\n\t\t\t\t\t\tif (messageBody[propertyName].length) {\n\t\t\t\t\t\t\tif (topLevelProperties.includes(propertyName)) {\n\t\t\t\t\t\t\t\tnewEmail.json[propertyName] = messageBody[propertyName][0];\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t(newEmail.json.metadata as IDataObject)[propertyName] =\n\t\t\t\t\t\t\t\t\tmessageBody[propertyName][0];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (downloadAttachments) {\n\t\t\t\t\t\t// Get attachments and add them if any get found\n\t\t\t\t\t\tattachments = await getAttachment(imapConnection, parts, message);\n\t\t\t\t\t\tif (attachments.length) {\n\t\t\t\t\t\t\tnewEmail.binary = {};\n\t\t\t\t\t\t\tfor (let i = 0; i < attachments.length; i++) {\n\t\t\t\t\t\t\t\tnewEmail.binary[`${dataPropertyAttachmentsPrefixName}${i}`] = attachments[i];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tnewEmails.push(newEmail);\n\t\t\t\t}\n\t\t\t} else if (format === 'raw') {\n\t\t\t\tfor (const message of results) {\n\t\t\t\t\tif (\n\t\t\t\t\t\tstaticData.lastMessageUid !== undefined &&\n\t\t\t\t\t\tmessage.attributes.uid <= (staticData.lastMessageUid as number)\n\t\t\t\t\t) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif (\n\t\t\t\t\t\tstaticData.lastMessageUid === undefined ||\n\t\t\t\t\t\t(staticData.lastMessageUid as number) < message.attributes.uid\n\t\t\t\t\t) {\n\t\t\t\t\t\tstaticData.lastMessageUid = message.attributes.uid;\n\t\t\t\t\t}\n\t\t\t\t\tconst part = find(message.parts, { which: 'TEXT' });\n\n\t\t\t\t\tif (part === undefined) {\n\t\t\t\t\t\tthrow new NodeOperationError(this.getNode(), 'Email part could not be parsed.');\n\t\t\t\t\t}\n\t\t\t\t\t// Return base64 string\n\t\t\t\t\tnewEmail = {\n\t\t\t\t\t\tjson: {\n\t\t\t\t\t\t\traw: part.body,\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\n\t\t\t\t\tnewEmails.push(newEmail);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// only mark messages as seen once processing has finished\n\t\t\tif (postProcessAction === 'read') {\n\t\t\t\tconst uidList = results.map((e) => e.attributes.uid);\n\t\t\t\tif (uidList.length > 0) {\n\t\t\t\t\tawait imapConnection.addFlags(uidList, '\\\\SEEN');\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn newEmails;\n\t\t};\n\n\t\tconst returnedPromise = this.helpers.createDeferredPromise();\n\n\t\tconst establishConnection = async (): Promise<ImapSimple> => {\n\t\t\tlet searchCriteria = ['UNSEEN'] as Array<string | string[]>;\n\t\t\tif (options.customEmailConfig !== undefined) {\n\t\t\t\ttry {\n\t\t\t\t\tsearchCriteria = JSON.parse(options.customEmailConfig as string);\n\t\t\t\t} catch (error) {\n\t\t\t\t\tthrow new NodeOperationError(this.getNode(), 'Custom email config is not valid JSON.');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst config: ImapSimpleOptions = {\n\t\t\t\timap: {\n\t\t\t\t\tuser: credentials.user as string,\n\t\t\t\t\tpassword: credentials.password as string,\n\t\t\t\t\thost: (credentials.host as string).trim(),\n\t\t\t\t\tport: credentials.port as number,\n\t\t\t\t\ttls: credentials.secure as boolean,\n\t\t\t\t\tauthTimeout: 20000,\n\t\t\t\t},\n\t\t\t\tonMail: async () => {\n\t\t\t\t\tif (connection) {\n\t\t\t\t\t\tif (staticData.lastMessageUid !== undefined) {\n\t\t\t\t\t\t\tsearchCriteria.push(['UID', `${staticData.lastMessageUid as number}:*`]);\n\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t * A short explanation about UIDs and how they work\n\t\t\t\t\t\t\t * can be found here: https://dev.to/kehers/imap-new-messages-since-last-check-44gm\n\t\t\t\t\t\t\t * TL;DR:\n\t\t\t\t\t\t\t * - You cannot filter using ['UID', 'CURRENT ID + 1:*'] because IMAP\n\t\t\t\t\t\t\t * won't return correct results if current id + 1 does not yet exist.\n\t\t\t\t\t\t\t * - UIDs can change but this is not being treated here.\n\t\t\t\t\t\t\t * If the mailbox is recreated (lets say you remove all emails, remove\n\t\t\t\t\t\t\t * the mail box and create another with same name, UIDs will change)\n\t\t\t\t\t\t\t * - You can check if UIDs changed in the above example\n\t\t\t\t\t\t\t * by checking UIDValidity.\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\tthis.logger.debug('Querying for new messages on node \"EmailReadImap\"', {\n\t\t\t\t\t\t\t\tsearchCriteria,\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tconst returnData = await getNewEmails(connection, searchCriteria);\n\t\t\t\t\t\t\tif (returnData.length) {\n\t\t\t\t\t\t\t\tthis.emit([returnData]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t\tthis.logger.error('Email Read Imap node encountered an error fetching new emails', {\n\t\t\t\t\t\t\t\terror,\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t// Wait with resolving till the returnedPromise got resolved, else n8n will be unhappy\n\t\t\t\t\t\t\t// if it receives an error before the workflow got activated\n\t\t\t\t\t\t\tawait returnedPromise.promise.then(() => {\n\t\t\t\t\t\t\t\tthis.emitError(error as Error);\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t};\n\n\t\t\tconst tlsOptions: IDataObject = {};\n\n\t\t\tif (options.allowUnauthorizedCerts === true) {\n\t\t\t\ttlsOptions.rejectUnauthorized = false;\n\t\t\t}\n\n\t\t\tif (credentials.secure) {\n\t\t\t\ttlsOptions.servername = (credentials.host as string).trim();\n\t\t\t}\n\n\t\t\tif (!isEmpty(tlsOptions)) {\n\t\t\t\tconfig.imap.tlsOptions = tlsOptions;\n\t\t\t}\n\n\t\t\t// Connect to the IMAP server and open the mailbox\n\t\t\t// that we get informed whenever a new email arrives\n\t\t\treturn await imapConnect(config).then(async (conn) => {\n\t\t\t\tconn.on('error', async (error) => {\n\t\t\t\t\tconst errorCode = error.code.toUpperCase();\n\t\t\t\t\tif (['ECONNRESET', 'EPIPE'].includes(errorCode as string)) {\n\t\t\t\t\t\tthis.logger.debug(`IMAP connection was reset (${errorCode}) - reconnecting.`, {\n\t\t\t\t\t\t\terror,\n\t\t\t\t\t\t});\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tconnection = await establishConnection();\n\t\t\t\t\t\t\tawait connection.openBox(mailbox);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t\tthis.logger.error('IMAP reconnect did fail', { error: e });\n\t\t\t\t\t\t\t// If something goes wrong we want to run emitError\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.logger.error('Email Read Imap node encountered a connection error', { error });\n\t\t\t\t\t\tthis.emitError(error as Error);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\treturn conn;\n\t\t\t});\n\t\t};\n\n\t\tconnection = await establishConnection();\n\n\t\tawait connection.openBox(mailbox);\n\n\t\tlet reconnectionInterval: NodeJS.Timeout | undefined;\n\n\t\tif (options.forceReconnect !== undefined) {\n\t\t\treconnectionInterval = setInterval(\n\t\t\t\tasync () => {\n\t\t\t\t\tthis.logger.debug('Forcing reconnection of IMAP node.');\n\t\t\t\t\tconnection.end();\n\t\t\t\t\tconnection = await establishConnection();\n\t\t\t\t\tawait connection.openBox(mailbox);\n\t\t\t\t},\n\t\t\t\t(options.forceReconnect as number) * 1000 * 60,\n\t\t\t);\n\t\t}\n\n\t\t// When workflow and so node gets set to inactive close the connectoin\n\t\tasync function closeFunction() {\n\t\t\tif (reconnectionInterval) {\n\t\t\t\tclearInterval(reconnectionInterval);\n\t\t\t}\n\t\t\tconnection.end();\n\t\t}\n\n\t\t// Resolve returned-promise so that waiting errors can be emitted\n\t\treturnedPromise.resolve();\n\n\t\treturn {\n\t\t\tcloseFunction,\n\t\t};\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,kBAAiD;AACjD,kBAAiB;AACjB,qBAAoB;AAEpB,wBAA6B;AAC7B,0BAAwD;AAiBxD,eAAsB,cAErB,gBACA,0BAC8B;AAC9B,QAAM,eAAe,UAAM,gCAAa,cAAc;AACtD,QAAM,UAAuB,CAAC;AAC9B,aAAW,UAAU,aAAa,aAAa;AAC9C,YAAQ,OAAO,GAAG,IAAI,OAAO;AAAA,EAC9B;AAGA,eAAa,UAAU;AAEvB,eAAa,cAAc;AAE3B,QAAM,aAA6B,CAAC;AACpC,MAAI,aAAa,aAAa;AAC7B,aAAS,IAAI,GAAG,IAAI,aAAa,YAAY,QAAQ,KAAK;AACzD,YAAM,aAAa,aAAa,YAAY,CAAC;AAC7C,iBAAW,GAAG,wBAAwB,GAAG,CAAC,EAAE,IAAI,MAAM,KAAK,QAAQ;AAAA,QAClE,WAAW;AAAA,QACX,WAAW;AAAA,QACX,WAAW;AAAA,MACZ;AAAA,IACD;AAEA,iBAAa,cAAc;AAAA,EAC5B;AAEA,SAAO;AAAA,IACN,MAAM;AAAA,IACN,QAAQ,OAAO,KAAK,UAAU,EAAE,SAAS,aAAa;AAAA,EACvD;AACD;AAEA,MAAM,qBAA2C;AAAA,EAChD,aAAa;AAAA,EACb,MAAM;AAAA,EACN,MAAM;AAAA,EACN,OAAO,CAAC,SAAS;AAAA,EACjB,SAAS;AAAA,EACT,aAAa;AAAA,EACb,yBAAyB;AAAA,EACzB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MACnC;AACA,iBAAW,IAAI;AAAA,IAChB;AAGA,oBAAgB,QAAQ;AAExB,WAAO;AAAA,MACN;AAAA,IACD;AAAA,EACD;AACD;","names":["isEmpty","imapConnect","part","find"]}
|
|
1
|
+
{"version":3,"sources":["../../../../nodes/EmailReadImap/v1/EmailReadImapV1.node.ts"],"sourcesContent":["import type { ImapSimple, ImapSimpleOptions, Message } from '@n8n/imap';\nimport { connect as imapConnect, getParts } from '@n8n/imap';\nimport find from 'lodash/find';\nimport isEmpty from 'lodash/isEmpty';\nimport type { Source as ParserSource } from 'mailparser';\nimport { simpleParser } from 'mailparser';\nimport { NodeConnectionTypes, NodeOperationError } from 'n8n-workflow';\nimport type {\n\tITriggerFunctions,\n\tIBinaryData,\n\tIBinaryKeyData,\n\tICredentialDataDecryptedObject,\n\tICredentialsDecrypted,\n\tICredentialTestFunctions,\n\tIDataObject,\n\tINodeCredentialTestResult,\n\tINodeExecutionData,\n\tINodeType,\n\tINodeTypeBaseDescription,\n\tINodeTypeDescription,\n\tITriggerResponse,\n} from 'n8n-workflow';\n\nexport async function parseRawEmail(\n\tthis: ITriggerFunctions,\n\tmessageEncoded: ParserSource,\n\tdataPropertyNameDownload: string,\n): Promise<INodeExecutionData> {\n\tconst responseData = await simpleParser(messageEncoded);\n\tconst headers: IDataObject = {};\n\tfor (const header of responseData.headerLines) {\n\t\theaders[header.key] = header.line;\n\t}\n\n\t// @ts-ignore\n\tresponseData.headers = headers;\n\t// @ts-ignore\n\tresponseData.headerLines = undefined;\n\n\tconst binaryData: IBinaryKeyData = {};\n\tif (responseData.attachments) {\n\t\tfor (let i = 0; i < responseData.attachments.length; i++) {\n\t\t\tconst attachment = responseData.attachments[i];\n\t\t\tbinaryData[`${dataPropertyNameDownload}${i}`] = await this.helpers.prepareBinaryData(\n\t\t\t\tattachment.content,\n\t\t\t\tattachment.filename,\n\t\t\t\tattachment.contentType,\n\t\t\t);\n\t\t}\n\t\t// @ts-ignore\n\t\tresponseData.attachments = undefined;\n\t}\n\n\treturn {\n\t\tjson: responseData as unknown as IDataObject,\n\t\tbinary: Object.keys(binaryData).length ? binaryData : undefined,\n\t} as INodeExecutionData;\n}\n\nconst versionDescription: INodeTypeDescription = {\n\tdisplayName: 'Email Trigger (IMAP)',\n\tname: 'emailReadImap',\n\ticon: 'fa:inbox',\n\tgroup: ['trigger'],\n\tversion: 1,\n\tdescription: 'Triggers the workflow when a new email is received',\n\teventTriggerDescription: 'Waiting for you to receive an email',\n\tdefaults: {\n\t\tname: 'Email Trigger (IMAP)',\n\t\tcolor: '#44AA22',\n\t},\n\ttriggerPanel: {\n\t\theader: '',\n\t\texecutionsHelp: {\n\t\t\tinactive:\n\t\t\t\t\"<b>While building your workflow</b>, click the 'execute step' button, then send an email to make an event happen. This will trigger an execution, which will show up in this editor.<br /> <br /><b>Once you're happy with your workflow</b>, <a data-key='activate'>activate</a> it. Then every time an email is received, the workflow will execute. These executions will show up in the <a data-key='executions'>executions list</a>, but not in the editor.\",\n\t\t\tactive:\n\t\t\t\t\"<b>While building your workflow</b>, click the 'execute step' button, then send an email to make an event happen. This will trigger an execution, which will show up in this editor.<br /> <br /><b>Your workflow will also execute automatically</b>, since it's activated. Every time an email is received, this node will trigger an execution. These executions will show up in the <a data-key='executions'>executions list</a>, but not in the editor.\",\n\t\t},\n\t\tactivationHint:\n\t\t\t\"Once you’ve finished building your workflow, <a data-key='activate'>activate</a> it to have it also listen continuously (you just won’t see those executions here).\",\n\t},\n\n\tinputs: [],\n\toutputs: [NodeConnectionTypes.Main],\n\tcredentials: [\n\t\t{\n\t\t\tname: 'imap',\n\t\t\trequired: true,\n\t\t\ttestedBy: 'imapConnectionTest',\n\t\t},\n\t],\n\tproperties: [\n\t\t{\n\t\t\tdisplayName: 'Mailbox Name',\n\t\t\tname: 'mailbox',\n\t\t\ttype: 'string',\n\t\t\tdefault: 'INBOX',\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Action',\n\t\t\tname: 'postProcessAction',\n\t\t\ttype: 'options',\n\t\t\toptions: [\n\t\t\t\t{\n\t\t\t\t\tname: 'Mark as Read',\n\t\t\t\t\tvalue: 'read',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'Nothing',\n\t\t\t\t\tvalue: 'nothing',\n\t\t\t\t},\n\t\t\t],\n\t\t\tdefault: 'read',\n\t\t\tdescription:\n\t\t\t\t'What to do after the email has been received. If \"nothing\" gets selected it will be processed multiple times.',\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Download Attachments',\n\t\t\tname: 'downloadAttachments',\n\t\t\ttype: 'boolean',\n\t\t\tdefault: false,\n\t\t\tdisplayOptions: {\n\t\t\t\tshow: {\n\t\t\t\t\tformat: ['simple'],\n\t\t\t\t},\n\t\t\t},\n\t\t\tdescription:\n\t\t\t\t'Whether attachments of emails should be downloaded. Only set if needed as it increases processing.',\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Format',\n\t\t\tname: 'format',\n\t\t\ttype: 'options',\n\t\t\toptions: [\n\t\t\t\t{\n\t\t\t\t\tname: 'RAW',\n\t\t\t\t\tvalue: 'raw',\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t'Returns the full email message data with body content in the raw field as a base64url encoded string; the payload field is not used',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'Resolved',\n\t\t\t\t\tvalue: 'resolved',\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t'Returns the full email with all data resolved and attachments saved as binary data',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'Simple',\n\t\t\t\t\tvalue: 'simple',\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t'Returns the full email; do not use if you wish to gather inline attachments',\n\t\t\t\t},\n\t\t\t],\n\t\t\tdefault: 'simple',\n\t\t\tdescription: 'The format to return the message in',\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Property Prefix Name',\n\t\t\tname: 'dataPropertyAttachmentsPrefixName',\n\t\t\ttype: 'string',\n\t\t\tdefault: 'attachment_',\n\t\t\tdisplayOptions: {\n\t\t\t\tshow: {\n\t\t\t\t\tformat: ['resolved'],\n\t\t\t\t},\n\t\t\t},\n\t\t\tdescription:\n\t\t\t\t'Prefix for name of the binary property to which to write the attachments. An index starting with 0 will be added. So if name is \"attachment_\" the first attachment is saved to \"attachment_0\"',\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Property Prefix Name',\n\t\t\tname: 'dataPropertyAttachmentsPrefixName',\n\t\t\ttype: 'string',\n\t\t\tdefault: 'attachment_',\n\t\t\tdisplayOptions: {\n\t\t\t\tshow: {\n\t\t\t\t\tformat: ['simple'],\n\t\t\t\t\tdownloadAttachments: [true],\n\t\t\t\t},\n\t\t\t},\n\t\t\tdescription:\n\t\t\t\t'Prefix for name of the binary property to which to write the attachments. An index starting with 0 will be added. So if name is \"attachment_\" the first attachment is saved to \"attachment_0\"',\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Options',\n\t\t\tname: 'options',\n\t\t\ttype: 'collection',\n\t\t\tplaceholder: 'Add option',\n\t\t\tdefault: {},\n\t\t\toptions: [\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Custom Email Rules',\n\t\t\t\t\tname: 'customEmailConfig',\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tdefault: '[\"UNSEEN\"]',\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t'Custom email fetching rules. See <a href=\"https://github.com/mscdex/node-imap\">node-imap</a>\\'s search function for more details.',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Ignore SSL Issues (Insecure)',\n\t\t\t\t\tname: 'allowUnauthorizedCerts',\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: false,\n\t\t\t\t\tdescription: 'Whether to connect even if SSL certificate validation is not possible',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Force Reconnect',\n\t\t\t\t\tname: 'forceReconnect',\n\t\t\t\t\ttype: 'number',\n\t\t\t\t\tdefault: 60,\n\t\t\t\t\tdescription: 'Sets an interval (in minutes) to force a reconnection',\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t],\n};\n\nexport class EmailReadImapV1 implements INodeType {\n\tdescription: INodeTypeDescription;\n\n\tconstructor(baseDescription: INodeTypeBaseDescription) {\n\t\tthis.description = {\n\t\t\t...baseDescription,\n\t\t\t...versionDescription,\n\t\t};\n\t}\n\n\tmethods = {\n\t\tcredentialTest: {\n\t\t\tasync imapConnectionTest(\n\t\t\t\tthis: ICredentialTestFunctions,\n\t\t\t\tcredential: ICredentialsDecrypted,\n\t\t\t): Promise<INodeCredentialTestResult> {\n\t\t\t\tconst credentials = credential.data as ICredentialDataDecryptedObject;\n\t\t\t\ttry {\n\t\t\t\t\tconst config: ImapSimpleOptions = {\n\t\t\t\t\t\timap: {\n\t\t\t\t\t\t\tuser: credentials.user as string,\n\t\t\t\t\t\t\tpassword: credentials.password as string,\n\t\t\t\t\t\t\thost: (credentials.host as string).trim(),\n\t\t\t\t\t\t\tport: credentials.port as number,\n\t\t\t\t\t\t\ttls: credentials.secure as boolean,\n\t\t\t\t\t\t\tauthTimeout: 20000,\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\t\tconst tlsOptions: IDataObject = {};\n\n\t\t\t\t\tif (credentials.secure) {\n\t\t\t\t\t\ttlsOptions.servername = (credentials.host as string).trim();\n\t\t\t\t\t}\n\t\t\t\t\tif (!isEmpty(tlsOptions)) {\n\t\t\t\t\t\tconfig.imap.tlsOptions = tlsOptions;\n\t\t\t\t\t}\n\t\t\t\t\tconst connection = await imapConnect(config);\n\t\t\t\t\tawait connection.getBoxes();\n\t\t\t\t} catch (error) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tstatus: 'Error',\n\t\t\t\t\t\tmessage: error.message,\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\tstatus: 'OK',\n\t\t\t\t\tmessage: 'Connection successful!',\n\t\t\t\t};\n\t\t\t},\n\t\t},\n\t};\n\n\tasync trigger(this: ITriggerFunctions): Promise<ITriggerResponse> {\n\t\tconst credentials = await this.getCredentials('imap');\n\n\t\tconst mailbox = this.getNodeParameter('mailbox') as string;\n\t\tconst postProcessAction = this.getNodeParameter('postProcessAction') as string;\n\t\tconst options = this.getNodeParameter('options', {}) as IDataObject;\n\n\t\tconst staticData = this.getWorkflowStaticData('node');\n\t\tthis.logger.debug('Loaded static data for node \"EmailReadImap\"', { staticData });\n\n\t\tlet connection: ImapSimple;\n\n\t\t// Returns the email text\n\n\t\tconst getText = async (parts: any[], message: Message, subtype: string): Promise<string> => {\n\t\t\tif (!message.attributes.struct) {\n\t\t\t\treturn '';\n\t\t\t}\n\n\t\t\tconst textParts = parts.filter((part) => {\n\t\t\t\treturn (\n\t\t\t\t\tpart.type.toUpperCase() === 'TEXT' && part.subtype.toUpperCase() === subtype.toUpperCase()\n\t\t\t\t);\n\t\t\t});\n\n\t\t\tconst part = textParts[0];\n\t\t\tif (!part) {\n\t\t\t\treturn '';\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tconst partData = await connection.getPartData(message, part);\n\t\t\t\treturn partData.toString();\n\t\t\t} catch {\n\t\t\t\treturn '';\n\t\t\t}\n\t\t};\n\n\t\t// Returns the email attachments\n\t\tconst getAttachment = async (\n\t\t\timapConnection: ImapSimple,\n\t\t\tparts: any[],\n\t\t\tmessage: Message,\n\t\t): Promise<IBinaryData[]> => {\n\t\t\tif (!message.attributes.struct) {\n\t\t\t\treturn [];\n\t\t\t}\n\n\t\t\t// Check if the message has attachments and if so get them\n\t\t\tconst attachmentParts = parts.filter((part) => {\n\t\t\t\treturn part.disposition && part.disposition.type.toUpperCase() === 'ATTACHMENT';\n\t\t\t});\n\n\t\t\tconst attachmentPromises = [];\n\t\t\tlet attachmentPromise;\n\t\t\tfor (const attachmentPart of attachmentParts) {\n\t\t\t\tattachmentPromise = imapConnection\n\t\t\t\t\t.getPartData(message, attachmentPart)\n\t\t\t\t\t.then(async (partData) => {\n\t\t\t\t\t\t// Return it in the format n8n expects\n\t\t\t\t\t\treturn await this.helpers.prepareBinaryData(\n\t\t\t\t\t\t\tpartData.buffer,\n\t\t\t\t\t\t\tattachmentPart.disposition.params.filename as string,\n\t\t\t\t\t\t);\n\t\t\t\t\t});\n\n\t\t\t\tattachmentPromises.push(attachmentPromise);\n\t\t\t}\n\n\t\t\treturn await Promise.all(attachmentPromises);\n\t\t};\n\n\t\t// Returns all the new unseen messages\n\t\tconst getNewEmails = async (\n\t\t\timapConnection: ImapSimple,\n\t\t\tsearchCriteria: Array<string | string[]>,\n\t\t): Promise<INodeExecutionData[]> => {\n\t\t\tconst format = this.getNodeParameter('format', 0) as string;\n\n\t\t\tlet fetchOptions = {};\n\n\t\t\tif (format === 'simple' || format === 'raw') {\n\t\t\t\tfetchOptions = {\n\t\t\t\t\tbodies: ['TEXT', 'HEADER'],\n\t\t\t\t\tmarkSeen: false,\n\t\t\t\t\tstruct: true,\n\t\t\t\t};\n\t\t\t} else if (format === 'resolved') {\n\t\t\t\tfetchOptions = {\n\t\t\t\t\tbodies: [''],\n\t\t\t\t\tmarkSeen: false,\n\t\t\t\t\tstruct: true,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tconst results = await imapConnection.search(searchCriteria, fetchOptions);\n\n\t\t\tconst newEmails: INodeExecutionData[] = [];\n\t\t\tlet newEmail: INodeExecutionData;\n\t\t\tlet attachments: IBinaryData[];\n\t\t\tlet propertyName: string;\n\n\t\t\t// All properties get by default moved to metadata except the ones\n\t\t\t// which are defined here which get set on the top level.\n\t\t\tconst topLevelProperties = ['cc', 'date', 'from', 'subject', 'to'];\n\n\t\t\tif (format === 'resolved') {\n\t\t\t\tconst dataPropertyAttachmentsPrefixName = this.getNodeParameter(\n\t\t\t\t\t'dataPropertyAttachmentsPrefixName',\n\t\t\t\t) as string;\n\n\t\t\t\tfor (const message of results) {\n\t\t\t\t\tif (\n\t\t\t\t\t\tstaticData.lastMessageUid !== undefined &&\n\t\t\t\t\t\tmessage.attributes.uid <= (staticData.lastMessageUid as number)\n\t\t\t\t\t) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif (\n\t\t\t\t\t\tstaticData.lastMessageUid === undefined ||\n\t\t\t\t\t\t(staticData.lastMessageUid as number) < message.attributes.uid\n\t\t\t\t\t) {\n\t\t\t\t\t\tstaticData.lastMessageUid = message.attributes.uid;\n\t\t\t\t\t}\n\t\t\t\t\tconst part = find(message.parts, { which: '' });\n\n\t\t\t\t\tif (part === undefined) {\n\t\t\t\t\t\tthrow new NodeOperationError(this.getNode(), 'Email part could not be parsed.');\n\t\t\t\t\t}\n\t\t\t\t\tconst parsedEmail = await parseRawEmail.call(\n\t\t\t\t\t\tthis,\n\t\t\t\t\t\tpart.body as Buffer,\n\t\t\t\t\t\tdataPropertyAttachmentsPrefixName,\n\t\t\t\t\t);\n\n\t\t\t\t\tnewEmails.push(parsedEmail);\n\t\t\t\t}\n\t\t\t} else if (format === 'simple') {\n\t\t\t\tconst downloadAttachments = this.getNodeParameter('downloadAttachments') as boolean;\n\n\t\t\t\tlet dataPropertyAttachmentsPrefixName = '';\n\t\t\t\tif (downloadAttachments) {\n\t\t\t\t\tdataPropertyAttachmentsPrefixName = this.getNodeParameter(\n\t\t\t\t\t\t'dataPropertyAttachmentsPrefixName',\n\t\t\t\t\t) as string;\n\t\t\t\t}\n\n\t\t\t\tfor (const message of results) {\n\t\t\t\t\tif (\n\t\t\t\t\t\tstaticData.lastMessageUid !== undefined &&\n\t\t\t\t\t\tmessage.attributes.uid <= (staticData.lastMessageUid as number)\n\t\t\t\t\t) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif (\n\t\t\t\t\t\tstaticData.lastMessageUid === undefined ||\n\t\t\t\t\t\t(staticData.lastMessageUid as number) < message.attributes.uid\n\t\t\t\t\t) {\n\t\t\t\t\t\tstaticData.lastMessageUid = message.attributes.uid;\n\t\t\t\t\t}\n\t\t\t\t\tconst parts = getParts(message.attributes.struct!);\n\n\t\t\t\t\tnewEmail = {\n\t\t\t\t\t\tjson: {\n\t\t\t\t\t\t\ttextHtml: await getText(parts, message, 'html'),\n\t\t\t\t\t\t\ttextPlain: await getText(parts, message, 'plain'),\n\t\t\t\t\t\t\tmetadata: {} as IDataObject,\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\n\t\t\t\t\tconst messageHeader = message.parts.filter((part) => part.which === 'HEADER');\n\n\t\t\t\t\tconst messageBody = messageHeader[0].body as Record<string, string[]>;\n\t\t\t\t\tfor (propertyName of Object.keys(messageBody as IDataObject)) {\n\t\t\t\t\t\tif (messageBody[propertyName].length) {\n\t\t\t\t\t\t\tif (topLevelProperties.includes(propertyName)) {\n\t\t\t\t\t\t\t\tnewEmail.json[propertyName] = messageBody[propertyName][0];\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t(newEmail.json.metadata as IDataObject)[propertyName] =\n\t\t\t\t\t\t\t\t\tmessageBody[propertyName][0];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (downloadAttachments) {\n\t\t\t\t\t\t// Get attachments and add them if any get found\n\t\t\t\t\t\tattachments = await getAttachment(imapConnection, parts, message);\n\t\t\t\t\t\tif (attachments.length) {\n\t\t\t\t\t\t\tnewEmail.binary = {};\n\t\t\t\t\t\t\tfor (let i = 0; i < attachments.length; i++) {\n\t\t\t\t\t\t\t\tnewEmail.binary[`${dataPropertyAttachmentsPrefixName}${i}`] = attachments[i];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tnewEmails.push(newEmail);\n\t\t\t\t}\n\t\t\t} else if (format === 'raw') {\n\t\t\t\tfor (const message of results) {\n\t\t\t\t\tif (\n\t\t\t\t\t\tstaticData.lastMessageUid !== undefined &&\n\t\t\t\t\t\tmessage.attributes.uid <= (staticData.lastMessageUid as number)\n\t\t\t\t\t) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif (\n\t\t\t\t\t\tstaticData.lastMessageUid === undefined ||\n\t\t\t\t\t\t(staticData.lastMessageUid as number) < message.attributes.uid\n\t\t\t\t\t) {\n\t\t\t\t\t\tstaticData.lastMessageUid = message.attributes.uid;\n\t\t\t\t\t}\n\t\t\t\t\tconst part = find(message.parts, { which: 'TEXT' });\n\n\t\t\t\t\tif (part === undefined) {\n\t\t\t\t\t\tthrow new NodeOperationError(this.getNode(), 'Email part could not be parsed.');\n\t\t\t\t\t}\n\t\t\t\t\t// Return base64 string\n\t\t\t\t\tnewEmail = {\n\t\t\t\t\t\tjson: {\n\t\t\t\t\t\t\traw: part.body,\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\n\t\t\t\t\tnewEmails.push(newEmail);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// only mark messages as seen once processing has finished\n\t\t\tif (postProcessAction === 'read') {\n\t\t\t\tconst uidList = results.map((e) => e.attributes.uid);\n\t\t\t\tif (uidList.length > 0) {\n\t\t\t\t\tawait imapConnection.addFlags(uidList, '\\\\SEEN');\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn newEmails;\n\t\t};\n\n\t\tconst returnedPromise = this.helpers.createDeferredPromise();\n\n\t\tconst establishConnection = async (): Promise<ImapSimple> => {\n\t\t\tlet searchCriteria = ['UNSEEN'] as Array<string | string[]>;\n\t\t\tif (options.customEmailConfig !== undefined) {\n\t\t\t\ttry {\n\t\t\t\t\tsearchCriteria = JSON.parse(options.customEmailConfig as string);\n\t\t\t\t} catch (error) {\n\t\t\t\t\tthrow new NodeOperationError(this.getNode(), 'Custom email config is not valid JSON.');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst config: ImapSimpleOptions = {\n\t\t\t\timap: {\n\t\t\t\t\tuser: credentials.user as string,\n\t\t\t\t\tpassword: credentials.password as string,\n\t\t\t\t\thost: (credentials.host as string).trim(),\n\t\t\t\t\tport: credentials.port as number,\n\t\t\t\t\ttls: credentials.secure as boolean,\n\t\t\t\t\tauthTimeout: 20000,\n\t\t\t\t},\n\t\t\t\tonMail: async () => {\n\t\t\t\t\tif (connection) {\n\t\t\t\t\t\tif (staticData.lastMessageUid !== undefined) {\n\t\t\t\t\t\t\tsearchCriteria.push(['UID', `${staticData.lastMessageUid as number}:*`]);\n\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t * A short explanation about UIDs and how they work\n\t\t\t\t\t\t\t * can be found here: https://dev.to/kehers/imap-new-messages-since-last-check-44gm\n\t\t\t\t\t\t\t * TL;DR:\n\t\t\t\t\t\t\t * - You cannot filter using ['UID', 'CURRENT ID + 1:*'] because IMAP\n\t\t\t\t\t\t\t * won't return correct results if current id + 1 does not yet exist.\n\t\t\t\t\t\t\t * - UIDs can change but this is not being treated here.\n\t\t\t\t\t\t\t * If the mailbox is recreated (lets say you remove all emails, remove\n\t\t\t\t\t\t\t * the mail box and create another with same name, UIDs will change)\n\t\t\t\t\t\t\t * - You can check if UIDs changed in the above example\n\t\t\t\t\t\t\t * by checking UIDValidity.\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\tthis.logger.debug('Querying for new messages on node \"EmailReadImap\"', {\n\t\t\t\t\t\t\t\tsearchCriteria,\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tconst returnData = await getNewEmails(connection, searchCriteria);\n\t\t\t\t\t\t\tif (returnData.length) {\n\t\t\t\t\t\t\t\tthis.emit([returnData]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t\tthis.logger.error('Email Read Imap node encountered an error fetching new emails', {\n\t\t\t\t\t\t\t\terror,\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t// Wait with resolving till the returnedPromise got resolved, else n8n will be unhappy\n\t\t\t\t\t\t\t// if it receives an error before the workflow got activated\n\t\t\t\t\t\t\tawait returnedPromise.promise.then(() => {\n\t\t\t\t\t\t\t\tthis.emitError(error as Error);\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t};\n\n\t\t\tconst tlsOptions: IDataObject = {};\n\n\t\t\tif (options.allowUnauthorizedCerts === true) {\n\t\t\t\ttlsOptions.rejectUnauthorized = false;\n\t\t\t}\n\n\t\t\tif (credentials.secure) {\n\t\t\t\ttlsOptions.servername = (credentials.host as string).trim();\n\t\t\t}\n\n\t\t\tif (!isEmpty(tlsOptions)) {\n\t\t\t\tconfig.imap.tlsOptions = tlsOptions;\n\t\t\t}\n\n\t\t\t// Connect to the IMAP server and open the mailbox\n\t\t\t// that we get informed whenever a new email arrives\n\t\t\treturn await imapConnect(config).then(async (conn) => {\n\t\t\t\tconn.on('error', async (error) => {\n\t\t\t\t\tconst errorCode = error.code.toUpperCase();\n\t\t\t\t\tif (['ECONNRESET', 'EPIPE'].includes(errorCode as string)) {\n\t\t\t\t\t\tthis.logger.debug(`IMAP connection was reset (${errorCode}) - reconnecting.`, {\n\t\t\t\t\t\t\terror,\n\t\t\t\t\t\t});\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tconnection = await establishConnection();\n\t\t\t\t\t\t\tawait connection.openBox(mailbox);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t\tthis.logger.error('IMAP reconnect did fail', { error: e });\n\t\t\t\t\t\t\t// If something goes wrong we want to run emitError\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.logger.error('Email Read Imap node encountered a connection error', { error });\n\t\t\t\t\t\tthis.emitError(error as Error);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\treturn conn;\n\t\t\t});\n\t\t};\n\n\t\tconnection = await establishConnection();\n\n\t\tawait connection.openBox(mailbox);\n\n\t\tlet reconnectionInterval: NodeJS.Timeout | undefined;\n\n\t\tif (options.forceReconnect !== undefined) {\n\t\t\treconnectionInterval = setInterval(\n\t\t\t\tasync () => {\n\t\t\t\t\tthis.logger.debug('Forcing reconnection of IMAP node.');\n\t\t\t\t\tconnection.end();\n\t\t\t\t\tconnection = await establishConnection();\n\t\t\t\t\tawait connection.openBox(mailbox);\n\t\t\t\t},\n\t\t\t\t(options.forceReconnect as number) * 1000 * 60,\n\t\t\t);\n\t\t}\n\n\t\t// When workflow and so node gets set to inactive close the connectoin\n\t\tasync function closeFunction() {\n\t\t\tif (reconnectionInterval) {\n\t\t\t\tclearInterval(reconnectionInterval);\n\t\t\t}\n\t\t\tconnection.end();\n\t\t}\n\n\t\t// Resolve returned-promise so that waiting errors can be emitted\n\t\treturnedPromise.resolve();\n\n\t\treturn {\n\t\t\tcloseFunction,\n\t\t};\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,kBAAiD;AACjD,kBAAiB;AACjB,qBAAoB;AAEpB,wBAA6B;AAC7B,0BAAwD;AAiBxD,eAAsB,cAErB,gBACA,0BAC8B;AAC9B,QAAM,eAAe,UAAM,gCAAa,cAAc;AACtD,QAAM,UAAuB,CAAC;AAC9B,aAAW,UAAU,aAAa,aAAa;AAC9C,YAAQ,OAAO,GAAG,IAAI,OAAO;AAAA,EAC9B;AAGA,eAAa,UAAU;AAEvB,eAAa,cAAc;AAE3B,QAAM,aAA6B,CAAC;AACpC,MAAI,aAAa,aAAa;AAC7B,aAAS,IAAI,GAAG,IAAI,aAAa,YAAY,QAAQ,KAAK;AACzD,YAAM,aAAa,aAAa,YAAY,CAAC;AAC7C,iBAAW,GAAG,wBAAwB,GAAG,CAAC,EAAE,IAAI,MAAM,KAAK,QAAQ;AAAA,QAClE,WAAW;AAAA,QACX,WAAW;AAAA,QACX,WAAW;AAAA,MACZ;AAAA,IACD;AAEA,iBAAa,cAAc;AAAA,EAC5B;AAEA,SAAO;AAAA,IACN,MAAM;AAAA,IACN,QAAQ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oC;AACtD,qBAAW,IAAI;AACf,uBAAa,MAAM,oBAAoB;AACvC,gBAAM,WAAW,QAAQ,OAAO;AAAA,QACjC;AAAA,QACC,QAAQ,iBAA4B,MAAO;AAAA,MAC7C;AAAA,IACD;AAGA,mBAAe,gBAAgB;AAC9B,UAAI,sBAAsB;AACzB,sBAAc,oBAAoB;AAAA,MACnC;AACA,iBAAW,IAAI;AAAA,IAChB;AAGA,oBAAgB,QAAQ;AAExB,WAAO;AAAA,MACN;AAAA,IACD;AAAA,EACD;AACD;","names":["isEmpty","imapConnect","part","find"]}
|
|
@@ -53,8 +53,8 @@ const versionDescription = {
|
|
|
53
53
|
triggerPanel: {
|
|
54
54
|
header: "",
|
|
55
55
|
executionsHelp: {
|
|
56
|
-
inactive: "<b>While building your workflow</b>, click the '
|
|
57
|
-
active: "<b>While building your workflow</b>, click the '
|
|
56
|
+
inactive: "<b>While building your workflow</b>, click the 'execute step' button, then send an email to make an event happen. This will trigger an execution, which will show up in this editor.<br /> <br /><b>Once you're happy with your workflow</b>, <a data-key='activate'>activate</a> it. Then every time an email is received, the workflow will execute. These executions will show up in the <a data-key='executions'>executions list</a>, but not in the editor.",
|
|
57
|
+
active: "<b>While building your workflow</b>, click the 'execute step' button, then send an email to make an event happen. This will trigger an execution, which will show up in this editor.<br /> <br /><b>Your workflow will also execute automatically</b>, since it's activated. Every time an email is received, this node will trigger an execution. These executions will show up in the <a data-key='executions'>executions list</a>, but not in the editor."
|
|
58
58
|
},
|
|
59
59
|
activationHint: "Once you\u2019ve finished building your workflow, <a data-key='activate'>activate</a> it to have it also listen continuously (you just won\u2019t see those executions here)."
|
|
60
60
|
},
|