n8n-nodes-base 1.92.0 → 1.94.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/AirtopApi.credentials.js +2 -1
- package/dist/credentials/AirtopApi.credentials.js.map +1 -1
- package/dist/credentials/JinaAiApi.credentials.js +1 -1
- package/dist/credentials/JinaAiApi.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 +10 -1
- package/dist/known/nodes.json +20 -4
- package/dist/methods/defined.json +6 -0
- package/dist/methods/referenced.json +3 -0
- package/dist/nodes/Airtop/Airtop.node.js +14 -8
- package/dist/nodes/Airtop/Airtop.node.js.map +1 -1
- package/dist/nodes/Airtop/GenericFunctions.js +87 -15
- package/dist/nodes/Airtop/GenericFunctions.js.map +1 -1
- package/dist/nodes/Airtop/actions/common/fields.js +9 -0
- package/dist/nodes/Airtop/actions/common/fields.js.map +1 -1
- package/dist/nodes/Airtop/actions/common/output.utils.js +79 -0
- package/dist/nodes/Airtop/actions/common/output.utils.js.map +1 -0
- package/dist/nodes/Airtop/actions/common/session.utils.js +2 -2
- package/dist/nodes/Airtop/actions/common/session.utils.js.map +1 -1
- package/dist/nodes/Airtop/actions/extraction/getPaginated.operation.js +13 -4
- package/dist/nodes/Airtop/actions/extraction/getPaginated.operation.js.map +1 -1
- package/dist/nodes/Airtop/actions/extraction/query.operation.js +21 -3
- package/dist/nodes/Airtop/actions/extraction/query.operation.js.map +1 -1
- package/dist/nodes/Airtop/actions/extraction/scrape.operation.js +2 -1
- package/dist/nodes/Airtop/actions/extraction/scrape.operation.js.map +1 -1
- package/dist/nodes/Airtop/actions/file/File.resource.js +104 -0
- package/dist/nodes/Airtop/actions/file/File.resource.js.map +1 -0
- package/dist/nodes/Airtop/actions/file/delete.operation.js +60 -0
- package/dist/nodes/Airtop/actions/file/delete.operation.js.map +1 -0
- package/dist/nodes/Airtop/actions/file/get.operation.js +91 -0
- package/dist/nodes/Airtop/actions/file/get.operation.js.map +1 -0
- package/dist/nodes/Airtop/actions/file/getMany.operation.js +100 -0
- package/dist/nodes/Airtop/actions/file/getMany.operation.js.map +1 -0
- package/dist/nodes/Airtop/actions/file/helpers.js +199 -0
- package/dist/nodes/Airtop/actions/file/helpers.js.map +1 -0
- package/dist/nodes/Airtop/actions/file/load.operation.js +85 -0
- package/dist/nodes/Airtop/actions/file/load.operation.js.map +1 -0
- package/dist/nodes/Airtop/actions/file/upload.operation.js +186 -0
- package/dist/nodes/Airtop/actions/file/upload.operation.js.map +1 -0
- package/dist/nodes/Airtop/actions/interaction/Interaction.resource.js +22 -1
- package/dist/nodes/Airtop/actions/interaction/Interaction.resource.js.map +1 -1
- package/dist/nodes/Airtop/actions/interaction/fill.operation.js +89 -0
- package/dist/nodes/Airtop/actions/interaction/fill.operation.js.map +1 -0
- package/dist/nodes/Airtop/actions/interaction/scroll.operation.js +219 -0
- package/dist/nodes/Airtop/actions/interaction/scroll.operation.js.map +1 -0
- package/dist/nodes/Airtop/actions/node.type.js.map +1 -1
- package/dist/nodes/Airtop/actions/router.js +13 -4
- package/dist/nodes/Airtop/actions/router.js.map +1 -1
- package/dist/nodes/Airtop/actions/session/create.operation.js +85 -32
- package/dist/nodes/Airtop/actions/session/create.operation.js.map +1 -1
- package/dist/nodes/Airtop/actions/window/Window.resource.js +2 -1
- package/dist/nodes/Airtop/actions/window/Window.resource.js.map +1 -1
- package/dist/nodes/Airtop/actions/window/create.operation.js +1 -1
- package/dist/nodes/Airtop/actions/window/create.operation.js.map +1 -1
- package/dist/nodes/Airtop/actions/window/takeScreenshot.operation.js +26 -3
- package/dist/nodes/Airtop/actions/window/takeScreenshot.operation.js.map +1 -1
- package/dist/nodes/Airtop/constants.js +38 -5
- package/dist/nodes/Airtop/constants.js.map +1 -1
- package/dist/nodes/Airtop/countries.js +1026 -0
- package/dist/nodes/Airtop/countries.js.map +1 -0
- package/dist/nodes/Airtop/transport/index.js +6 -3
- package/dist/nodes/Airtop/transport/index.js.map +1 -1
- package/dist/nodes/Airtop/transport/types.js.map +1 -1
- 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/Cron/Cron.node.js +1 -1
- package/dist/nodes/Cron/Cron.node.js.map +1 -1
- 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/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/Google/Drive/v2/actions/file/upload.operation.js +4 -1
- package/dist/nodes/Google/Drive/v2/actions/file/upload.operation.js.map +1 -1
- package/dist/nodes/Google/Firebase/CloudFirestore/GenericFunctions.js +1 -2
- package/dist/nodes/Google/Firebase/CloudFirestore/GenericFunctions.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 -106
- 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 +20 -17
- package/dist/nodes/Google/Sheet/v2/actions/versionDescription.js.map +1 -1
- package/dist/nodes/Google/YouTube/YouTube.node.js +4 -2
- package/dist/nodes/Google/YouTube/YouTube.node.js.map +1 -1
- package/dist/nodes/HttpRequest/GenericFunctions.js +1 -1
- package/dist/nodes/HttpRequest/GenericFunctions.js.map +1 -1
- package/dist/nodes/Interval/Interval.node.js +1 -1
- package/dist/nodes/Interval/Interval.node.js.map +1 -1
- package/dist/nodes/Jira/Jira.node.js +34 -15
- package/dist/nodes/Jira/Jira.node.js.map +1 -1
- 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/Merge/Merge.node.js +3 -2
- package/dist/nodes/Merge/Merge.node.js.map +1 -1
- package/dist/nodes/Merge/v3/actions/mode/combineBySql.js +42 -4
- package/dist/nodes/Merge/v3/actions/mode/combineBySql.js.map +1 -1
- package/dist/nodes/Merge/v3/actions/versionDescription.js +1 -1
- package/dist/nodes/Merge/v3/actions/versionDescription.js.map +1 -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/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/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/MongoDb/GenericFunctions.js +9 -2
- package/dist/nodes/MongoDb/GenericFunctions.js.map +1 -1
- package/dist/nodes/MongoDb/MongoDb.node.js +25 -5
- package/dist/nodes/MongoDb/MongoDb.node.js.map +1 -1
- 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/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/Schedule/ScheduleTrigger.node.js +1 -1
- package/dist/nodes/Schedule/ScheduleTrigger.node.js.map +1 -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/Telegram/Telegram.node.js +5 -1
- package/dist/nodes/Telegram/Telegram.node.js.map +1 -1
- package/dist/nodes/Transform/Summarize/utils.js +2 -1
- package/dist/nodes/Transform/Summarize/utils.js.map +1 -1
- package/dist/test/setup.js +1 -0
- package/dist/test/setup.js.map +1 -1
- package/dist/types/credentials.json +7 -7
- package/dist/types/nodes.json +27 -23
- package/dist/utils/workflowInputsResourceMapping/GenericFunctions.js +12 -2
- package/dist/utils/workflowInputsResourceMapping/GenericFunctions.js.map +1 -1
- package/package.json +15 -12
- package/dist/nodes/EvaluationMetrics/EvaluationMetrics.node.js +0 -119
- package/dist/nodes/EvaluationMetrics/EvaluationMetrics.node.js.map +0 -1
- package/dist/nodes/EvaluationMetrics/EvaluationMetrics.node.json +0 -14
- /package/dist/{credentials/icons/SharePoint.svg → nodes/Microsoft/SharePoint/microsoftSharePoint.svg} +0 -0
|
@@ -22,6 +22,7 @@ __export(fields_exports, {
|
|
|
22
22
|
elementDescriptionField: () => elementDescriptionField,
|
|
23
23
|
getSessionModeFields: () => getSessionModeFields,
|
|
24
24
|
outputSchemaField: () => outputSchemaField,
|
|
25
|
+
parseJsonOutputField: () => parseJsonOutputField,
|
|
25
26
|
profileNameField: () => profileNameField,
|
|
26
27
|
sessionIdField: () => sessionIdField,
|
|
27
28
|
urlField: () => urlField,
|
|
@@ -73,6 +74,13 @@ const outputSchemaField = {
|
|
|
73
74
|
type: "json",
|
|
74
75
|
default: ""
|
|
75
76
|
};
|
|
77
|
+
const parseJsonOutputField = {
|
|
78
|
+
displayName: "Parse JSON Output",
|
|
79
|
+
name: "parseJsonOutput",
|
|
80
|
+
type: "boolean",
|
|
81
|
+
default: true,
|
|
82
|
+
description: "Whether to parse the model's response to JSON in the output. Requires the 'JSON Output Schema' parameter to be set."
|
|
83
|
+
};
|
|
76
84
|
const elementDescriptionField = {
|
|
77
85
|
displayName: "Element Description",
|
|
78
86
|
name: "elementDescription",
|
|
@@ -166,6 +174,7 @@ function getSessionModeFields(resource, operations) {
|
|
|
166
174
|
elementDescriptionField,
|
|
167
175
|
getSessionModeFields,
|
|
168
176
|
outputSchemaField,
|
|
177
|
+
parseJsonOutputField,
|
|
169
178
|
profileNameField,
|
|
170
179
|
sessionIdField,
|
|
171
180
|
urlField,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../nodes/Airtop/actions/common/fields.ts"],"sourcesContent":["import type { INodeProperties } from 'n8n-workflow';\n\nexport const SESSION_MODE = {\n\tNEW: 'new',\n\tEXISTING: 'existing',\n} as const;\n\n/**\n * Session related fields\n */\n\nexport const sessionIdField: INodeProperties = {\n\tdisplayName: 'Session ID',\n\tname: 'sessionId',\n\ttype: 'string',\n\trequired: true,\n\tdefault: '={{ $json[\"sessionId\"] }}',\n\tdescription:\n\t\t'The ID of the <a href=\"https://docs.airtop.ai/guides/how-to/creating-a-session\" target=\"_blank\">Session</a> to use',\n};\n\nexport const windowIdField: INodeProperties = {\n\tdisplayName: 'Window ID',\n\tname: 'windowId',\n\ttype: 'string',\n\trequired: true,\n\tdefault: '={{ $json[\"windowId\"] }}',\n\tdescription:\n\t\t'The ID of the <a href=\"https://docs.airtop.ai/guides/how-to/creating-a-session#windows\" target=\"_blank\">Window</a> to use',\n};\n\nexport const profileNameField: INodeProperties = {\n\tdisplayName: 'Profile Name',\n\tname: 'profileName',\n\ttype: 'string',\n\tdefault: '',\n\tdescription: 'The name of the Airtop profile to load or create',\n\thint: '<a href=\"https://docs.airtop.ai/guides/how-to/saving-a-profile\" target=\"_blank\">Learn more</a> about Airtop profiles',\n\tplaceholder: 'e.g. my-x-profile',\n};\n\nexport const urlField: INodeProperties = {\n\tdisplayName: 'URL',\n\tname: 'url',\n\ttype: 'string',\n\tdefault: '',\n\tplaceholder: 'e.g. https://google.com',\n\tdescription: 'URL to load in the window',\n};\n\n/**\n * Extraction related fields\n */\n\nexport const outputSchemaField: INodeProperties = {\n\tdisplayName: 'JSON Output Schema',\n\tname: 'outputSchema',\n\tdescription: 'JSON schema defining the structure of the output',\n\thint: 'If you want to force your output to be JSON, provide a valid JSON schema describing the output. You can generate one automatically in the <a href=\"https://portal.airtop.ai/\" target=\"_blank\">Airtop API Playground</a>.',\n\ttype: 'json',\n\tdefault: '',\n};\n\n/**\n * Interaction related fields\n */\n\nexport const elementDescriptionField: INodeProperties = {\n\tdisplayName: 'Element Description',\n\tname: 'elementDescription',\n\ttype: 'string',\n\tdefault: '',\n\tdescription: 'A specific description of the element to execute the interaction on',\n\tplaceholder: 'e.g. the search box at the top of the page',\n};\n\nexport function getSessionModeFields(resource: string, operations: string[]): INodeProperties[] {\n\treturn [\n\t\t{\n\t\t\tdisplayName: 'Session Mode',\n\t\t\tname: 'sessionMode',\n\t\t\ttype: 'options',\n\t\t\tdefault: 'existing',\n\t\t\tdescription: 'Choose between creating a new session or using an existing one',\n\t\t\toptions: [\n\t\t\t\t{\n\t\t\t\t\tname: 'Automatically Create Session',\n\t\t\t\t\tdescription: 'Automatically create a new session and window for this operation',\n\t\t\t\t\tvalue: SESSION_MODE.NEW,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'Use Existing Session',\n\t\t\t\t\tdescription: 'Use an existing session and window for this operation',\n\t\t\t\t\tvalue: SESSION_MODE.EXISTING,\n\t\t\t\t},\n\t\t\t],\n\t\t\tdisplayOptions: {\n\t\t\t\tshow: {\n\t\t\t\t\tresource: [resource],\n\t\t\t\t\toperation: operations,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\t...sessionIdField,\n\t\t\tdisplayOptions: {\n\t\t\t\tshow: {\n\t\t\t\t\tresource: [resource],\n\t\t\t\t\tsessionMode: [SESSION_MODE.EXISTING],\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\t...windowIdField,\n\t\t\tdisplayOptions: {\n\t\t\t\tshow: {\n\t\t\t\t\tresource: [resource],\n\t\t\t\t\tsessionMode: [SESSION_MODE.EXISTING],\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\t...urlField,\n\t\t\trequired: true,\n\t\t\tdisplayOptions: {\n\t\t\t\tshow: {\n\t\t\t\t\tresource: [resource],\n\t\t\t\t\tsessionMode: [SESSION_MODE.NEW],\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\t...profileNameField,\n\t\t\tdisplayOptions: {\n\t\t\t\tshow: {\n\t\t\t\t\tresource: [resource],\n\t\t\t\t\tsessionMode: [SESSION_MODE.NEW],\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Auto-Terminate Session',\n\t\t\tname: 'autoTerminateSession',\n\t\t\ttype: 'boolean',\n\t\t\tdefault: true,\n\t\t\tdescription:\n\t\t\t\t'Whether to terminate the session after the operation is complete. When disabled, you must manually terminate the session. By default, idle sessions timeout after 10 minutes',\n\t\t\tdisplayOptions: {\n\t\t\t\tshow: {\n\t\t\t\t\tresource: [resource],\n\t\t\t\t\tsessionMode: [SESSION_MODE.NEW],\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t];\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEO,MAAM,eAAe;AAAA,EAC3B,KAAK;AAAA,EACL,UAAU;AACX;AAMO,MAAM,iBAAkC;AAAA,EAC9C,aAAa;AAAA,EACb,MAAM;AAAA,EACN,MAAM;AAAA,EACN,UAAU;AAAA,EACV,SAAS;AAAA,EACT,aACC;AACF;AAEO,MAAM,gBAAiC;AAAA,EAC7C,aAAa;AAAA,EACb,MAAM;AAAA,EACN,MAAM;AAAA,EACN,UAAU;AAAA,EACV,SAAS;AAAA,EACT,aACC;AACF;AAEO,MAAM,mBAAoC;AAAA,EAChD,aAAa;AAAA,EACb,MAAM;AAAA,EACN,MAAM;AAAA,EACN,SAAS;AAAA,EACT,aAAa;AAAA,EACb,MAAM;AAAA,EACN,aAAa;AACd;AAEO,MAAM,WAA4B;AAAA,EACxC,aAAa;AAAA,EACb,MAAM;AAAA,EACN,MAAM;AAAA,EACN,SAAS;AAAA,EACT,aAAa;AAAA,EACb,aAAa;AACd;AAMO,MAAM,oBAAqC;AAAA,EACjD,aAAa;AAAA,EACb,MAAM;AAAA,EACN,aAAa;AAAA,EACb,MAAM;AAAA,EACN,MAAM;AAAA,EACN,SAAS;AACV;AAMO,MAAM,0BAA2C;AAAA,EACvD,aAAa;AAAA,EACb,MAAM;AAAA,EACN,MAAM;AAAA,EACN,SAAS;AAAA,EACT,aAAa;AAAA,EACb,aAAa;AACd;AAEO,SAAS,qBAAqB,UAAkB,YAAyC;AAC/F,SAAO;AAAA,IACN;AAAA,MACC,aAAa;AAAA,MACb,MAAM;AAAA,MACN,MAAM;AAAA,MACN,SAAS;AAAA,MACT,aAAa;AAAA,MACb,SAAS;AAAA,QACR;AAAA,UACC,MAAM;AAAA,UACN,aAAa;AAAA,UACb,OAAO,aAAa;AAAA,QACrB;AAAA,QACA;AAAA,UACC,MAAM;AAAA,UACN,aAAa;AAAA,UACb,OAAO,aAAa;AAAA,QACrB;AAAA,MACD;AAAA,MACA,gBAAgB;AAAA,QACf,MAAM;AAAA,UACL,UAAU,CAAC,QAAQ;AAAA,UACnB,WAAW;AAAA,QACZ;AAAA,MACD;AAAA,IACD;AAAA,IACA;AAAA,MACC,GAAG;AAAA,MACH,gBAAgB;AAAA,QACf,MAAM;AAAA,UACL,UAAU,CAAC,QAAQ;AAAA,UACnB,aAAa,CAAC,aAAa,QAAQ;AAAA,QACpC;AAAA,MACD;AAAA,IACD;AAAA,IACA;AAAA,MACC,GAAG;AAAA,MACH,gBAAgB;AAAA,QACf,MAAM;AAAA,UACL,UAAU,CAAC,QAAQ;AAAA,UACnB,aAAa,CAAC,aAAa,QAAQ;AAAA,QACpC;AAAA,MACD;AAAA,IACD;AAAA,IACA;AAAA,MACC,GAAG;AAAA,MACH,UAAU;AAAA,MACV,gBAAgB;AAAA,QACf,MAAM;AAAA,UACL,UAAU,CAAC,QAAQ;AAAA,UACnB,aAAa,CAAC,aAAa,GAAG;AAAA,QAC/B;AAAA,MACD;AAAA,IACD;AAAA,IACA;AAAA,MACC,GAAG;AAAA,MACH,gBAAgB;AAAA,QACf,MAAM;AAAA,UACL,UAAU,CAAC,QAAQ;AAAA,UACnB,aAAa,CAAC,aAAa,GAAG;AAAA,QAC/B;AAAA,MACD;AAAA,IACD;AAAA,IACA;AAAA,MACC,aAAa;AAAA,MACb,MAAM;AAAA,MACN,MAAM;AAAA,MACN,SAAS;AAAA,MACT,aACC;AAAA,MACD,gBAAgB;AAAA,QACf,MAAM;AAAA,UACL,UAAU,CAAC,QAAQ;AAAA,UACnB,aAAa,CAAC,aAAa,GAAG;AAAA,QAC/B;AAAA,MACD;AAAA,IACD;AAAA,EACD;AACD;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../../../nodes/Airtop/actions/common/fields.ts"],"sourcesContent":["import type { INodeProperties } from 'n8n-workflow';\n\nexport const SESSION_MODE = {\n\tNEW: 'new',\n\tEXISTING: 'existing',\n} as const;\n\n/**\n * Session related fields\n */\n\nexport const sessionIdField: INodeProperties = {\n\tdisplayName: 'Session ID',\n\tname: 'sessionId',\n\ttype: 'string',\n\trequired: true,\n\tdefault: '={{ $json[\"sessionId\"] }}',\n\tdescription:\n\t\t'The ID of the <a href=\"https://docs.airtop.ai/guides/how-to/creating-a-session\" target=\"_blank\">Session</a> to use',\n};\n\nexport const windowIdField: INodeProperties = {\n\tdisplayName: 'Window ID',\n\tname: 'windowId',\n\ttype: 'string',\n\trequired: true,\n\tdefault: '={{ $json[\"windowId\"] }}',\n\tdescription:\n\t\t'The ID of the <a href=\"https://docs.airtop.ai/guides/how-to/creating-a-session#windows\" target=\"_blank\">Window</a> to use',\n};\n\nexport const profileNameField: INodeProperties = {\n\tdisplayName: 'Profile Name',\n\tname: 'profileName',\n\ttype: 'string',\n\tdefault: '',\n\tdescription: 'The name of the Airtop profile to load or create',\n\thint: '<a href=\"https://docs.airtop.ai/guides/how-to/saving-a-profile\" target=\"_blank\">Learn more</a> about Airtop profiles',\n\tplaceholder: 'e.g. my-x-profile',\n};\n\nexport const urlField: INodeProperties = {\n\tdisplayName: 'URL',\n\tname: 'url',\n\ttype: 'string',\n\tdefault: '',\n\tplaceholder: 'e.g. https://google.com',\n\tdescription: 'URL to load in the window',\n};\n\n/**\n * Extraction related fields\n */\n\nexport const outputSchemaField: INodeProperties = {\n\tdisplayName: 'JSON Output Schema',\n\tname: 'outputSchema',\n\tdescription: 'JSON schema defining the structure of the output',\n\thint: 'If you want to force your output to be JSON, provide a valid JSON schema describing the output. You can generate one automatically in the <a href=\"https://portal.airtop.ai/\" target=\"_blank\">Airtop API Playground</a>.',\n\ttype: 'json',\n\tdefault: '',\n};\n\nexport const parseJsonOutputField: INodeProperties = {\n\tdisplayName: 'Parse JSON Output',\n\tname: 'parseJsonOutput',\n\ttype: 'boolean',\n\tdefault: true,\n\tdescription:\n\t\t\"Whether to parse the model's response to JSON in the output. Requires the 'JSON Output Schema' parameter to be set.\",\n};\n\n/**\n * Interaction related fields\n */\n\nexport const elementDescriptionField: INodeProperties = {\n\tdisplayName: 'Element Description',\n\tname: 'elementDescription',\n\ttype: 'string',\n\tdefault: '',\n\tdescription: 'A specific description of the element to execute the interaction on',\n\tplaceholder: 'e.g. the search box at the top of the page',\n};\n\nexport function getSessionModeFields(resource: string, operations: string[]): INodeProperties[] {\n\treturn [\n\t\t{\n\t\t\tdisplayName: 'Session Mode',\n\t\t\tname: 'sessionMode',\n\t\t\ttype: 'options',\n\t\t\tdefault: 'existing',\n\t\t\tdescription: 'Choose between creating a new session or using an existing one',\n\t\t\toptions: [\n\t\t\t\t{\n\t\t\t\t\tname: 'Automatically Create Session',\n\t\t\t\t\tdescription: 'Automatically create a new session and window for this operation',\n\t\t\t\t\tvalue: SESSION_MODE.NEW,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'Use Existing Session',\n\t\t\t\t\tdescription: 'Use an existing session and window for this operation',\n\t\t\t\t\tvalue: SESSION_MODE.EXISTING,\n\t\t\t\t},\n\t\t\t],\n\t\t\tdisplayOptions: {\n\t\t\t\tshow: {\n\t\t\t\t\tresource: [resource],\n\t\t\t\t\toperation: operations,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\t...sessionIdField,\n\t\t\tdisplayOptions: {\n\t\t\t\tshow: {\n\t\t\t\t\tresource: [resource],\n\t\t\t\t\tsessionMode: [SESSION_MODE.EXISTING],\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\t...windowIdField,\n\t\t\tdisplayOptions: {\n\t\t\t\tshow: {\n\t\t\t\t\tresource: [resource],\n\t\t\t\t\tsessionMode: [SESSION_MODE.EXISTING],\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\t...urlField,\n\t\t\trequired: true,\n\t\t\tdisplayOptions: {\n\t\t\t\tshow: {\n\t\t\t\t\tresource: [resource],\n\t\t\t\t\tsessionMode: [SESSION_MODE.NEW],\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\t...profileNameField,\n\t\t\tdisplayOptions: {\n\t\t\t\tshow: {\n\t\t\t\t\tresource: [resource],\n\t\t\t\t\tsessionMode: [SESSION_MODE.NEW],\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Auto-Terminate Session',\n\t\t\tname: 'autoTerminateSession',\n\t\t\ttype: 'boolean',\n\t\t\tdefault: true,\n\t\t\tdescription:\n\t\t\t\t'Whether to terminate the session after the operation is complete. When disabled, you must manually terminate the session. By default, idle sessions timeout after 10 minutes',\n\t\t\tdisplayOptions: {\n\t\t\t\tshow: {\n\t\t\t\t\tresource: [resource],\n\t\t\t\t\tsessionMode: [SESSION_MODE.NEW],\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t];\n}\n"],"mappings":"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","names":[]}
|
|
@@ -0,0 +1,79 @@
|
|
|
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 output_utils_exports = {};
|
|
20
|
+
__export(output_utils_exports, {
|
|
21
|
+
cleanOutputForToolUse: () => cleanOutputForToolUse,
|
|
22
|
+
parseJsonIfPresent: () => parseJsonIfPresent
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(output_utils_exports);
|
|
25
|
+
var import_n8n_workflow = require("n8n-workflow");
|
|
26
|
+
function parseJsonIfPresent(index, response) {
|
|
27
|
+
const parseJsonOutput = this.getNodeParameter("additionalFields.parseJsonOutput", index, false);
|
|
28
|
+
const outputJsonSchema = this.getNodeParameter(
|
|
29
|
+
"additionalFields.outputSchema",
|
|
30
|
+
index,
|
|
31
|
+
""
|
|
32
|
+
);
|
|
33
|
+
if (!parseJsonOutput || !outputJsonSchema.startsWith("{")) {
|
|
34
|
+
return response;
|
|
35
|
+
}
|
|
36
|
+
try {
|
|
37
|
+
const output = JSON.parse(response.data?.modelResponse ?? "");
|
|
38
|
+
return {
|
|
39
|
+
sessionId: response.sessionId,
|
|
40
|
+
windowId: response.windowId,
|
|
41
|
+
output
|
|
42
|
+
};
|
|
43
|
+
} catch (error) {
|
|
44
|
+
throw new import_n8n_workflow.NodeOperationError(this.getNode(), "Output is not a valid JSON");
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
function cleanOutputForToolUse(output) {
|
|
48
|
+
const getOutput = (executionData) => {
|
|
49
|
+
if (executionData.json?.errors?.length) {
|
|
50
|
+
const errorMessage = executionData.json?.errors[0].message;
|
|
51
|
+
return {
|
|
52
|
+
output: `Error: ${errorMessage}`
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
if (executionData.json?.output) {
|
|
56
|
+
return executionData.json?.output;
|
|
57
|
+
}
|
|
58
|
+
if (executionData.json?.data?.modelResponse) {
|
|
59
|
+
return {
|
|
60
|
+
output: executionData.json?.data?.modelResponse
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
return {
|
|
64
|
+
output: { ...executionData.json?.data ?? {} }
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
return output.map((executionData) => ({
|
|
68
|
+
...executionData,
|
|
69
|
+
json: {
|
|
70
|
+
...getOutput(executionData)
|
|
71
|
+
}
|
|
72
|
+
}));
|
|
73
|
+
}
|
|
74
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
75
|
+
0 && (module.exports = {
|
|
76
|
+
cleanOutputForToolUse,
|
|
77
|
+
parseJsonIfPresent
|
|
78
|
+
});
|
|
79
|
+
//# sourceMappingURL=output.utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../nodes/Airtop/actions/common/output.utils.ts"],"sourcesContent":["import { NodeOperationError } from 'n8n-workflow';\nimport type { IExecuteFunctions, IDataObject } from 'n8n-workflow';\n\nimport type { IAirtopNodeExecutionData, IAirtopResponse } from '../../transport/types';\n\n/**\n * Parse JSON when the 'Parse JSON Output' parameter is enabled\n * @param this - The execution context\n * @param index - The index of the node\n * @param response - The Airtop API response to parse\n * @returns The parsed output\n */\nexport function parseJsonIfPresent(\n\tthis: IExecuteFunctions,\n\tindex: number,\n\tresponse: IAirtopResponse,\n): IAirtopResponse {\n\tconst parseJsonOutput = this.getNodeParameter('additionalFields.parseJsonOutput', index, false);\n\tconst outputJsonSchema = this.getNodeParameter(\n\t\t'additionalFields.outputSchema',\n\t\tindex,\n\t\t'',\n\t) as string;\n\n\tif (!parseJsonOutput || !outputJsonSchema.startsWith('{')) {\n\t\treturn response;\n\t}\n\n\ttry {\n\t\tconst output = JSON.parse(response.data?.modelResponse ?? '') as IDataObject;\n\t\treturn {\n\t\t\tsessionId: response.sessionId,\n\t\t\twindowId: response.windowId,\n\t\t\toutput,\n\t\t};\n\t} catch (error) {\n\t\tthrow new NodeOperationError(this.getNode(), 'Output is not a valid JSON');\n\t}\n}\n\n/**\n * Clean up the output when used as a tool\n * @param output - The output to clean up\n * @returns The cleaned up output\n */\nexport function cleanOutputForToolUse(output: IAirtopNodeExecutionData[]) {\n\tconst getOutput = (executionData: IAirtopNodeExecutionData) => {\n\t\t// Return error message\n\t\tif (executionData.json?.errors?.length) {\n\t\t\tconst errorMessage = executionData.json?.errors[0].message as string;\n\t\t\treturn {\n\t\t\t\toutput: `Error: ${errorMessage}`,\n\t\t\t};\n\t\t}\n\n\t\t// Return output parsed from JSON\n\t\tif (executionData.json?.output) {\n\t\t\treturn executionData.json?.output;\n\t\t}\n\n\t\t// Return model response\n\t\tif (executionData.json?.data?.modelResponse) {\n\t\t\treturn {\n\t\t\t\toutput: executionData.json?.data?.modelResponse,\n\t\t\t};\n\t\t}\n\n\t\t// Return everything else\n\t\treturn {\n\t\t\toutput: { ...(executionData.json?.data ?? {}) },\n\t\t};\n\t};\n\n\treturn output.map((executionData) => ({\n\t\t...executionData,\n\t\tjson: {\n\t\t\t...getOutput(executionData),\n\t\t},\n\t}));\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAmC;AAY5B,SAAS,mBAEf,OACA,UACkB;AAClB,QAAM,kBAAkB,KAAK,iBAAiB,oCAAoC,OAAO,KAAK;AAC9F,QAAM,mBAAmB,KAAK;AAAA,IAC7B;AAAA,IACA;AAAA,IACA;AAAA,EACD;AAEA,MAAI,CAAC,mBAAmB,CAAC,iBAAiB,WAAW,GAAG,GAAG;AAC1D,WAAO;AAAA,EACR;AAEA,MAAI;AACH,UAAM,SAAS,KAAK,MAAM,SAAS,MAAM,iBAAiB,EAAE;AAC5D,WAAO;AAAA,MACN,WAAW,SAAS;AAAA,MACpB,UAAU,SAAS;AAAA,MACnB;AAAA,IACD;AAAA,EACD,SAAS,OAAO;AACf,UAAM,IAAI,uCAAmB,KAAK,QAAQ,GAAG,4BAA4B;AAAA,EAC1E;AACD;AAOO,SAAS,sBAAsB,QAAoC;AACzE,QAAM,YAAY,CAAC,kBAA4C;AAE9D,QAAI,cAAc,MAAM,QAAQ,QAAQ;AACvC,YAAM,eAAe,cAAc,MAAM,OAAO,CAAC,EAAE;AACnD,aAAO;AAAA,QACN,QAAQ,UAAU,YAAY;AAAA,MAC/B;AAAA,IACD;AAGA,QAAI,cAAc,MAAM,QAAQ;AAC/B,aAAO,cAAc,MAAM;AAAA,IAC5B;AAGA,QAAI,cAAc,MAAM,MAAM,eAAe;AAC5C,aAAO;AAAA,QACN,QAAQ,cAAc,MAAM,MAAM;AAAA,MACnC;AAAA,IACD;AAGA,WAAO;AAAA,MACN,QAAQ,EAAE,GAAI,cAAc,MAAM,QAAQ,CAAC,EAAG;AAAA,IAC/C;AAAA,EACD;AAEA,SAAO,OAAO,IAAI,CAAC,mBAAmB;AAAA,IACrC,GAAG;AAAA,IACH,MAAM;AAAA,MACL,GAAG,UAAU,aAAa;AAAA,IAC3B;AAAA,EACD,EAAE;AACH;","names":[]}
|
|
@@ -32,9 +32,9 @@ async function executeRequestWithSessionManagement(index, request) {
|
|
|
32
32
|
if (shouldTerminateSession) {
|
|
33
33
|
await import_transport.apiRequest.call(this, "DELETE", `/sessions/${sessionId}`);
|
|
34
34
|
this.logger.info(`[${this.getNode().name}] Session terminated.`);
|
|
35
|
-
return
|
|
35
|
+
return response;
|
|
36
36
|
}
|
|
37
|
-
return
|
|
37
|
+
return { sessionId, windowId, ...response };
|
|
38
38
|
}
|
|
39
39
|
// Annotate the CommonJS export names for ESM import in node:
|
|
40
40
|
0 && (module.exports = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../nodes/Airtop/actions/common/session.utils.ts"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"sources":["../../../../../nodes/Airtop/actions/common/session.utils.ts"],"sourcesContent":["import type { IExecuteFunctions, IDataObject } from 'n8n-workflow';\n\nimport {\n\tvalidateSessionAndWindowId,\n\tcreateSessionAndWindow,\n\tshouldCreateNewSession,\n\tvalidateAirtopApiResponse,\n} from '../../GenericFunctions';\nimport { apiRequest } from '../../transport';\nimport type { IAirtopResponse } from '../../transport/types';\n\n/**\n * Execute the node operation. Creates and terminates a new session if needed.\n * @param this - The execution context\n * @param index - The index of the node\n * @param request - The request to execute\n * @returns The response from the request\n */\nexport async function executeRequestWithSessionManagement(\n\tthis: IExecuteFunctions,\n\tindex: number,\n\trequest: {\n\t\tmethod: 'POST' | 'DELETE';\n\t\tpath: string;\n\t\tbody: IDataObject;\n\t},\n): Promise<IAirtopResponse> {\n\tconst { sessionId, windowId } = shouldCreateNewSession.call(this, index)\n\t\t? await createSessionAndWindow.call(this, index)\n\t\t: validateSessionAndWindowId.call(this, index);\n\n\tconst shouldTerminateSession = this.getNodeParameter('autoTerminateSession', index, false);\n\n\tconst endpoint = request.path.replace('{sessionId}', sessionId).replace('{windowId}', windowId);\n\tconst response = await apiRequest.call(this, request.method, endpoint, request.body);\n\n\tvalidateAirtopApiResponse(this.getNode(), response);\n\n\tif (shouldTerminateSession) {\n\t\tawait apiRequest.call(this, 'DELETE', `/sessions/${sessionId}`);\n\t\tthis.logger.info(`[${this.getNode().name}] Session terminated.`);\n\t\treturn response;\n\t}\n\n\treturn { sessionId, windowId, ...response };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,8BAKO;AACP,uBAA2B;AAU3B,eAAsB,oCAErB,OACA,SAK2B;AAC3B,QAAM,EAAE,WAAW,SAAS,IAAI,+CAAuB,KAAK,MAAM,KAAK,IACpE,MAAM,+CAAuB,KAAK,MAAM,KAAK,IAC7C,mDAA2B,KAAK,MAAM,KAAK;AAE9C,QAAM,yBAAyB,KAAK,iBAAiB,wBAAwB,OAAO,KAAK;AAEzF,QAAM,WAAW,QAAQ,KAAK,QAAQ,eAAe,SAAS,EAAE,QAAQ,cAAc,QAAQ;AAC9F,QAAM,WAAW,MAAM,4BAAW,KAAK,MAAM,QAAQ,QAAQ,UAAU,QAAQ,IAAI;AAEnF,yDAA0B,KAAK,QAAQ,GAAG,QAAQ;AAElD,MAAI,wBAAwB;AAC3B,UAAM,4BAAW,KAAK,MAAM,UAAU,aAAa,SAAS,EAAE;AAC9D,SAAK,OAAO,KAAK,IAAI,KAAK,QAAQ,EAAE,IAAI,uBAAuB;AAC/D,WAAO;AAAA,EACR;AAEA,SAAO,EAAE,WAAW,UAAU,GAAG,SAAS;AAC3C;","names":[]}
|
|
@@ -23,6 +23,7 @@ __export(getPaginated_operation_exports, {
|
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(getPaginated_operation_exports);
|
|
25
25
|
var import_fields = require("../common/fields");
|
|
26
|
+
var import_output = require("../common/output.utils");
|
|
26
27
|
var import_session = require("../common/session.utils");
|
|
27
28
|
const description = [
|
|
28
29
|
{
|
|
@@ -59,6 +60,9 @@ const description = [
|
|
|
59
60
|
{
|
|
60
61
|
...import_fields.outputSchemaField
|
|
61
62
|
},
|
|
63
|
+
{
|
|
64
|
+
...import_fields.parseJsonOutputField
|
|
65
|
+
},
|
|
62
66
|
{
|
|
63
67
|
displayName: "Interaction Mode",
|
|
64
68
|
name: "interactionMode",
|
|
@@ -113,16 +117,21 @@ const description = [
|
|
|
113
117
|
async function execute(index) {
|
|
114
118
|
const prompt = this.getNodeParameter("prompt", index, "");
|
|
115
119
|
const additionalFields = this.getNodeParameter("additionalFields", index);
|
|
116
|
-
|
|
120
|
+
const configFields = ["paginationMode", "interactionMode", "outputSchema"];
|
|
121
|
+
const configuration = configFields.reduce(
|
|
122
|
+
(config, key) => additionalFields[key] ? { ...config, [key]: additionalFields[key] } : config,
|
|
123
|
+
{}
|
|
124
|
+
);
|
|
125
|
+
const result = await import_session.executeRequestWithSessionManagement.call(this, index, {
|
|
117
126
|
method: "POST",
|
|
118
127
|
path: "/sessions/{sessionId}/windows/{windowId}/paginated-extraction",
|
|
119
128
|
body: {
|
|
120
129
|
prompt,
|
|
121
|
-
configuration
|
|
122
|
-
...additionalFields
|
|
123
|
-
}
|
|
130
|
+
configuration
|
|
124
131
|
}
|
|
125
132
|
});
|
|
133
|
+
const nodeOutput = import_output.parseJsonIfPresent.call(this, index, result);
|
|
134
|
+
return this.helpers.returnJsonArray(nodeOutput);
|
|
126
135
|
}
|
|
127
136
|
// Annotate the CommonJS export names for ESM import in node:
|
|
128
137
|
0 && (module.exports = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../nodes/Airtop/actions/extraction/getPaginated.operation.ts"],"sourcesContent":["import {\n\ttype IExecuteFunctions,\n\ttype INodeExecutionData,\n\ttype INodeProperties,\n} from 'n8n-workflow';\n\nimport { outputSchemaField } from '../common/fields';\nimport { executeRequestWithSessionManagement } from '../common/session.utils';\n\nexport const description: INodeProperties[] = [\n\t{\n\t\tdisplayName: 'Prompt',\n\t\tname: 'prompt',\n\t\ttype: 'string',\n\t\ttypeOptions: {\n\t\t\trows: 4,\n\t\t},\n\t\trequired: true,\n\t\tdefault: '',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tresource: ['extraction'],\n\t\t\t\toperation: ['getPaginated'],\n\t\t\t},\n\t\t},\n\t\tdescription: 'The prompt to extract data from the pages',\n\t\tplaceholder: 'e.g. Extract all the product names and prices',\n\t},\n\t{\n\t\tdisplayName: 'Additional Fields',\n\t\tname: 'additionalFields',\n\t\ttype: 'collection',\n\t\tplaceholder: 'Add Field',\n\t\tdefault: {},\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tresource: ['extraction'],\n\t\t\t\toperation: ['getPaginated'],\n\t\t\t},\n\t\t},\n\t\toptions: [\n\t\t\t{\n\t\t\t\t...outputSchemaField,\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Interaction Mode',\n\t\t\t\tname: 'interactionMode',\n\t\t\t\ttype: 'options',\n\t\t\t\tdefault: 'auto',\n\t\t\t\tdescription: 'The strategy for interacting with the page',\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Auto',\n\t\t\t\t\t\tdescription: 'Automatically choose the most cost-effective mode',\n\t\t\t\t\t\tvalue: 'auto',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Accurate',\n\t\t\t\t\t\tdescription: 'Prioritize accuracy over cost',\n\t\t\t\t\t\tvalue: 'accurate',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Cost Efficient',\n\t\t\t\t\t\tdescription: 'Minimize costs while ensuring effectiveness',\n\t\t\t\t\t\tvalue: 'cost-efficient',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Pagination Mode',\n\t\t\t\tname: 'paginationMode',\n\t\t\t\ttype: 'options',\n\t\t\t\tdefault: 'auto',\n\t\t\t\tdescription: 'The pagination approach to use',\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Auto',\n\t\t\t\t\t\tdescription: 'Look for pagination links first, then try infinite scrolling',\n\t\t\t\t\t\tvalue: 'auto',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Paginated',\n\t\t\t\t\t\tdescription: 'Only use pagination links',\n\t\t\t\t\t\tvalue: 'paginated',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Infinite Scroll',\n\t\t\t\t\t\tdescription: 'Scroll the page to load more content',\n\t\t\t\t\t\tvalue: 'infinite-scroll',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t},\n];\n\nexport async function execute(\n\tthis: IExecuteFunctions,\n\tindex: number,\n): Promise<INodeExecutionData[]> {\n\tconst prompt = this.getNodeParameter('prompt', index, '') as string;\n\tconst additionalFields = this.getNodeParameter('additionalFields', index);\n\n\
|
|
1
|
+
{"version":3,"sources":["../../../../../nodes/Airtop/actions/extraction/getPaginated.operation.ts"],"sourcesContent":["import {\n\ttype IExecuteFunctions,\n\ttype INodeExecutionData,\n\ttype INodeProperties,\n} from 'n8n-workflow';\n\nimport { outputSchemaField, parseJsonOutputField } from '../common/fields';\nimport { parseJsonIfPresent } from '../common/output.utils';\nimport { executeRequestWithSessionManagement } from '../common/session.utils';\n\nexport const description: INodeProperties[] = [\n\t{\n\t\tdisplayName: 'Prompt',\n\t\tname: 'prompt',\n\t\ttype: 'string',\n\t\ttypeOptions: {\n\t\t\trows: 4,\n\t\t},\n\t\trequired: true,\n\t\tdefault: '',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tresource: ['extraction'],\n\t\t\t\toperation: ['getPaginated'],\n\t\t\t},\n\t\t},\n\t\tdescription: 'The prompt to extract data from the pages',\n\t\tplaceholder: 'e.g. Extract all the product names and prices',\n\t},\n\t{\n\t\tdisplayName: 'Additional Fields',\n\t\tname: 'additionalFields',\n\t\ttype: 'collection',\n\t\tplaceholder: 'Add Field',\n\t\tdefault: {},\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tresource: ['extraction'],\n\t\t\t\toperation: ['getPaginated'],\n\t\t\t},\n\t\t},\n\t\toptions: [\n\t\t\t{\n\t\t\t\t...outputSchemaField,\n\t\t\t},\n\t\t\t{\n\t\t\t\t...parseJsonOutputField,\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Interaction Mode',\n\t\t\t\tname: 'interactionMode',\n\t\t\t\ttype: 'options',\n\t\t\t\tdefault: 'auto',\n\t\t\t\tdescription: 'The strategy for interacting with the page',\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Auto',\n\t\t\t\t\t\tdescription: 'Automatically choose the most cost-effective mode',\n\t\t\t\t\t\tvalue: 'auto',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Accurate',\n\t\t\t\t\t\tdescription: 'Prioritize accuracy over cost',\n\t\t\t\t\t\tvalue: 'accurate',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Cost Efficient',\n\t\t\t\t\t\tdescription: 'Minimize costs while ensuring effectiveness',\n\t\t\t\t\t\tvalue: 'cost-efficient',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Pagination Mode',\n\t\t\t\tname: 'paginationMode',\n\t\t\t\ttype: 'options',\n\t\t\t\tdefault: 'auto',\n\t\t\t\tdescription: 'The pagination approach to use',\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Auto',\n\t\t\t\t\t\tdescription: 'Look for pagination links first, then try infinite scrolling',\n\t\t\t\t\t\tvalue: 'auto',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Paginated',\n\t\t\t\t\t\tdescription: 'Only use pagination links',\n\t\t\t\t\t\tvalue: 'paginated',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Infinite Scroll',\n\t\t\t\t\t\tdescription: 'Scroll the page to load more content',\n\t\t\t\t\t\tvalue: 'infinite-scroll',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t},\n];\n\nexport async function execute(\n\tthis: IExecuteFunctions,\n\tindex: number,\n): Promise<INodeExecutionData[]> {\n\tconst prompt = this.getNodeParameter('prompt', index, '') as string;\n\tconst additionalFields = this.getNodeParameter('additionalFields', index);\n\n\tconst configFields = ['paginationMode', 'interactionMode', 'outputSchema'];\n\tconst configuration = configFields.reduce(\n\t\t(config, key) => (additionalFields[key] ? { ...config, [key]: additionalFields[key] } : config),\n\t\t{},\n\t);\n\n\tconst result = await executeRequestWithSessionManagement.call(this, index, {\n\t\tmethod: 'POST',\n\t\tpath: '/sessions/{sessionId}/windows/{windowId}/paginated-extraction',\n\t\tbody: {\n\t\t\tprompt,\n\t\t\tconfiguration,\n\t\t},\n\t});\n\n\tconst nodeOutput = parseJsonIfPresent.call(this, index, result);\n\treturn this.helpers.returnJsonArray(nodeOutput);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA,oBAAwD;AACxD,oBAAmC;AACnC,qBAAoD;AAE7C,MAAM,cAAiC;AAAA,EAC7C;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,aAAa;AAAA,MACZ,MAAM;AAAA,IACP;AAAA,IACA,UAAU;AAAA,IACV,SAAS;AAAA,IACT,gBAAgB;AAAA,MACf,MAAM;AAAA,QACL,UAAU,CAAC,YAAY;AAAA,QACvB,WAAW,CAAC,cAAc;AAAA,MAC3B;AAAA,IACD;AAAA,IACA,aAAa;AAAA,IACb,aAAa;AAAA,EACd;AAAA,EACA;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,aAAa;AAAA,IACb,SAAS,CAAC;AAAA,IACV,gBAAgB;AAAA,MACf,MAAM;AAAA,QACL,UAAU,CAAC,YAAY;AAAA,QACvB,WAAW,CAAC,cAAc;AAAA,MAC3B;AAAA,IACD;AAAA,IACA,SAAS;AAAA,MACR;AAAA,QACC,GAAG;AAAA,MACJ;AAAA,MACA;AAAA,QACC,GAAG;AAAA,MACJ;AAAA,MACA;AAAA,QACC,aAAa;AAAA,QACb,MAAM;AAAA,QACN,MAAM;AAAA,QACN,SAAS;AAAA,QACT,aAAa;AAAA,QACb,SAAS;AAAA,UACR;AAAA,YACC,MAAM;AAAA,YACN,aAAa;AAAA,YACb,OAAO;AAAA,UACR;AAAA,UACA;AAAA,YACC,MAAM;AAAA,YACN,aAAa;AAAA,YACb,OAAO;AAAA,UACR;AAAA,UACA;AAAA,YACC,MAAM;AAAA,YACN,aAAa;AAAA,YACb,OAAO;AAAA,UACR;AAAA,QACD;AAAA,MACD;AAAA,MACA;AAAA,QACC,aAAa;AAAA,QACb,MAAM;AAAA,QACN,MAAM;AAAA,QACN,SAAS;AAAA,QACT,aAAa;AAAA,QACb,SAAS;AAAA,UACR;AAAA,YACC,MAAM;AAAA,YACN,aAAa;AAAA,YACb,OAAO;AAAA,UACR;AAAA,UACA;AAAA,YACC,MAAM;AAAA,YACN,aAAa;AAAA,YACb,OAAO;AAAA,UACR;AAAA,UACA;AAAA,YACC,MAAM;AAAA,YACN,aAAa;AAAA,YACb,OAAO;AAAA,UACR;AAAA,QACD;AAAA,MACD;AAAA,IACD;AAAA,EACD;AACD;AAEA,eAAsB,QAErB,OACgC;AAChC,QAAM,SAAS,KAAK,iBAAiB,UAAU,OAAO,EAAE;AACxD,QAAM,mBAAmB,KAAK,iBAAiB,oBAAoB,KAAK;AAExE,QAAM,eAAe,CAAC,kBAAkB,mBAAmB,cAAc;AACzE,QAAM,gBAAgB,aAAa;AAAA,IAClC,CAAC,QAAQ,QAAS,iBAAiB,GAAG,IAAI,EAAE,GAAG,QAAQ,CAAC,GAAG,GAAG,iBAAiB,GAAG,EAAE,IAAI;AAAA,IACxF,CAAC;AAAA,EACF;AAEA,QAAM,SAAS,MAAM,mDAAoC,KAAK,MAAM,OAAO;AAAA,IAC1E,QAAQ;AAAA,IACR,MAAM;AAAA,IACN,MAAM;AAAA,MACL;AAAA,MACA;AAAA,IACD;AAAA,EACD,CAAC;AAED,QAAM,aAAa,iCAAmB,KAAK,MAAM,OAAO,MAAM;AAC9D,SAAO,KAAK,QAAQ,gBAAgB,UAAU;AAC/C;","names":[]}
|
|
@@ -23,6 +23,7 @@ __export(query_operation_exports, {
|
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(query_operation_exports);
|
|
25
25
|
var import_fields = require("../common/fields");
|
|
26
|
+
var import_output = require("../common/output.utils");
|
|
26
27
|
var import_session = require("../common/session.utils");
|
|
27
28
|
const description = [
|
|
28
29
|
{
|
|
@@ -58,23 +59,40 @@ const description = [
|
|
|
58
59
|
options: [
|
|
59
60
|
{
|
|
60
61
|
...import_fields.outputSchemaField
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
...import_fields.parseJsonOutputField
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
displayName: "Include Visual Analysis",
|
|
68
|
+
name: "includeVisualAnalysis",
|
|
69
|
+
type: "boolean",
|
|
70
|
+
default: false,
|
|
71
|
+
description: "Whether to analyze the web page visually when fulfilling the request"
|
|
61
72
|
}
|
|
62
73
|
]
|
|
63
74
|
}
|
|
64
75
|
];
|
|
65
76
|
async function execute(index) {
|
|
66
77
|
const prompt = this.getNodeParameter("prompt", index, "");
|
|
67
|
-
const additionalFields = this.getNodeParameter("additionalFields", index);
|
|
68
|
-
|
|
78
|
+
const additionalFields = this.getNodeParameter("additionalFields", index, {});
|
|
79
|
+
const outputSchema = additionalFields.outputSchema;
|
|
80
|
+
const includeVisualAnalysis = additionalFields.includeVisualAnalysis;
|
|
81
|
+
const result = await import_session.executeRequestWithSessionManagement.call(this, index, {
|
|
69
82
|
method: "POST",
|
|
70
83
|
path: "/sessions/{sessionId}/windows/{windowId}/page-query",
|
|
71
84
|
body: {
|
|
72
85
|
prompt,
|
|
73
86
|
configuration: {
|
|
74
|
-
|
|
87
|
+
experimental: {
|
|
88
|
+
includeVisualAnalysis: includeVisualAnalysis ? "enabled" : "disabled"
|
|
89
|
+
},
|
|
90
|
+
...outputSchema ? { outputSchema } : {}
|
|
75
91
|
}
|
|
76
92
|
}
|
|
77
93
|
});
|
|
94
|
+
const nodeOutput = import_output.parseJsonIfPresent.call(this, index, result);
|
|
95
|
+
return this.helpers.returnJsonArray(nodeOutput);
|
|
78
96
|
}
|
|
79
97
|
// Annotate the CommonJS export names for ESM import in node:
|
|
80
98
|
0 && (module.exports = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../nodes/Airtop/actions/extraction/query.operation.ts"],"sourcesContent":["import {\n\ttype IExecuteFunctions,\n\ttype INodeExecutionData,\n\ttype INodeProperties,\n} from 'n8n-workflow';\n\nimport { outputSchemaField } from '../common/fields';\nimport { executeRequestWithSessionManagement } from '../common/session.utils';\n\nexport const description: INodeProperties[] = [\n\t{\n\t\tdisplayName: 'Prompt',\n\t\tname: 'prompt',\n\t\ttype: 'string',\n\t\ttypeOptions: {\n\t\t\trows: 4,\n\t\t},\n\t\trequired: true,\n\t\tdefault: '',\n\t\tplaceholder: 'e.g. Is there a login form in this page?',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tresource: ['extraction'],\n\t\t\t\toperation: ['query'],\n\t\t\t},\n\t\t},\n\t\tdescription: 'The prompt to query the page content',\n\t},\n\t{\n\t\tdisplayName: 'Additional Fields',\n\t\tname: 'additionalFields',\n\t\ttype: 'collection',\n\t\tplaceholder: 'Add Field',\n\t\tdefault: {},\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tresource: ['extraction'],\n\t\t\t\toperation: ['query'],\n\t\t\t},\n\t\t},\n\t\toptions: [\n\t\t\t{\n\t\t\t\t...outputSchemaField,\n\t\t\t},\n\t\t],\n\t},\n];\n\nexport async function execute(\n\tthis: IExecuteFunctions,\n\tindex: number,\n): Promise<INodeExecutionData[]> {\n\tconst prompt = this.getNodeParameter('prompt', index, '') as string;\n\tconst additionalFields = this.getNodeParameter('additionalFields', index);\n\n\
|
|
1
|
+
{"version":3,"sources":["../../../../../nodes/Airtop/actions/extraction/query.operation.ts"],"sourcesContent":["import {\n\ttype IExecuteFunctions,\n\ttype INodeExecutionData,\n\ttype INodeProperties,\n} from 'n8n-workflow';\n\nimport { outputSchemaField, parseJsonOutputField } from '../common/fields';\nimport { parseJsonIfPresent } from '../common/output.utils';\nimport { executeRequestWithSessionManagement } from '../common/session.utils';\n\nexport const description: INodeProperties[] = [\n\t{\n\t\tdisplayName: 'Prompt',\n\t\tname: 'prompt',\n\t\ttype: 'string',\n\t\ttypeOptions: {\n\t\t\trows: 4,\n\t\t},\n\t\trequired: true,\n\t\tdefault: '',\n\t\tplaceholder: 'e.g. Is there a login form in this page?',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tresource: ['extraction'],\n\t\t\t\toperation: ['query'],\n\t\t\t},\n\t\t},\n\t\tdescription: 'The prompt to query the page content',\n\t},\n\t{\n\t\tdisplayName: 'Additional Fields',\n\t\tname: 'additionalFields',\n\t\ttype: 'collection',\n\t\tplaceholder: 'Add Field',\n\t\tdefault: {},\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tresource: ['extraction'],\n\t\t\t\toperation: ['query'],\n\t\t\t},\n\t\t},\n\t\toptions: [\n\t\t\t{\n\t\t\t\t...outputSchemaField,\n\t\t\t},\n\t\t\t{\n\t\t\t\t...parseJsonOutputField,\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Include Visual Analysis',\n\t\t\t\tname: 'includeVisualAnalysis',\n\t\t\t\ttype: 'boolean',\n\t\t\t\tdefault: false,\n\t\t\t\tdescription: 'Whether to analyze the web page visually when fulfilling the request',\n\t\t\t},\n\t\t],\n\t},\n];\n\nexport async function execute(\n\tthis: IExecuteFunctions,\n\tindex: number,\n): Promise<INodeExecutionData[]> {\n\tconst prompt = this.getNodeParameter('prompt', index, '') as string;\n\tconst additionalFields = this.getNodeParameter('additionalFields', index, {});\n\tconst outputSchema = additionalFields.outputSchema;\n\tconst includeVisualAnalysis = additionalFields.includeVisualAnalysis;\n\n\tconst result = await executeRequestWithSessionManagement.call(this, index, {\n\t\tmethod: 'POST',\n\t\tpath: '/sessions/{sessionId}/windows/{windowId}/page-query',\n\t\tbody: {\n\t\t\tprompt,\n\t\t\tconfiguration: {\n\t\t\t\texperimental: {\n\t\t\t\t\tincludeVisualAnalysis: includeVisualAnalysis ? 'enabled' : 'disabled',\n\t\t\t\t},\n\t\t\t\t...(outputSchema ? { outputSchema } : {}),\n\t\t\t},\n\t\t},\n\t});\n\n\tconst nodeOutput = parseJsonIfPresent.call(this, index, result);\n\treturn this.helpers.returnJsonArray(nodeOutput);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA,oBAAwD;AACxD,oBAAmC;AACnC,qBAAoD;AAE7C,MAAM,cAAiC;AAAA,EAC7C;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,aAAa;AAAA,MACZ,MAAM;AAAA,IACP;AAAA,IACA,UAAU;AAAA,IACV,SAAS;AAAA,IACT,aAAa;AAAA,IACb,gBAAgB;AAAA,MACf,MAAM;AAAA,QACL,UAAU,CAAC,YAAY;AAAA,QACvB,WAAW,CAAC,OAAO;AAAA,MACpB;AAAA,IACD;AAAA,IACA,aAAa;AAAA,EACd;AAAA,EACA;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,aAAa;AAAA,IACb,SAAS,CAAC;AAAA,IACV,gBAAgB;AAAA,MACf,MAAM;AAAA,QACL,UAAU,CAAC,YAAY;AAAA,QACvB,WAAW,CAAC,OAAO;AAAA,MACpB;AAAA,IACD;AAAA,IACA,SAAS;AAAA,MACR;AAAA,QACC,GAAG;AAAA,MACJ;AAAA,MACA;AAAA,QACC,GAAG;AAAA,MACJ;AAAA,MACA;AAAA,QACC,aAAa;AAAA,QACb,MAAM;AAAA,QACN,MAAM;AAAA,QACN,SAAS;AAAA,QACT,aAAa;AAAA,MACd;AAAA,IACD;AAAA,EACD;AACD;AAEA,eAAsB,QAErB,OACgC;AAChC,QAAM,SAAS,KAAK,iBAAiB,UAAU,OAAO,EAAE;AACxD,QAAM,mBAAmB,KAAK,iBAAiB,oBAAoB,OAAO,CAAC,CAAC;AAC5E,QAAM,eAAe,iBAAiB;AACtC,QAAM,wBAAwB,iBAAiB;AAE/C,QAAM,SAAS,MAAM,mDAAoC,KAAK,MAAM,OAAO;AAAA,IAC1E,QAAQ;AAAA,IACR,MAAM;AAAA,IACN,MAAM;AAAA,MACL;AAAA,MACA,eAAe;AAAA,QACd,cAAc;AAAA,UACb,uBAAuB,wBAAwB,YAAY;AAAA,QAC5D;AAAA,QACA,GAAI,eAAe,EAAE,aAAa,IAAI,CAAC;AAAA,MACxC;AAAA,IACD;AAAA,EACD,CAAC;AAED,QAAM,aAAa,iCAAmB,KAAK,MAAM,OAAO,MAAM;AAC9D,SAAO,KAAK,QAAQ,gBAAgB,UAAU;AAC/C;","names":[]}
|
|
@@ -23,11 +23,12 @@ __export(scrape_operation_exports, {
|
|
|
23
23
|
module.exports = __toCommonJS(scrape_operation_exports);
|
|
24
24
|
var import_session = require("../common/session.utils");
|
|
25
25
|
async function execute(index) {
|
|
26
|
-
|
|
26
|
+
const result = await import_session.executeRequestWithSessionManagement.call(this, index, {
|
|
27
27
|
method: "POST",
|
|
28
28
|
path: "/sessions/{sessionId}/windows/{windowId}/scrape-content",
|
|
29
29
|
body: {}
|
|
30
30
|
});
|
|
31
|
+
return this.helpers.returnJsonArray({ ...result });
|
|
31
32
|
}
|
|
32
33
|
// Annotate the CommonJS export names for ESM import in node:
|
|
33
34
|
0 && (module.exports = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../nodes/Airtop/actions/extraction/scrape.operation.ts"],"sourcesContent":["import type { IExecuteFunctions, INodeExecutionData } from 'n8n-workflow';\n\nimport { executeRequestWithSessionManagement } from '../common/session.utils';\n\nexport async function execute(\n\tthis: IExecuteFunctions,\n\tindex: number,\n): Promise<INodeExecutionData[]> {\n\
|
|
1
|
+
{"version":3,"sources":["../../../../../nodes/Airtop/actions/extraction/scrape.operation.ts"],"sourcesContent":["import type { IExecuteFunctions, INodeExecutionData } from 'n8n-workflow';\n\nimport { executeRequestWithSessionManagement } from '../common/session.utils';\n\nexport async function execute(\n\tthis: IExecuteFunctions,\n\tindex: number,\n): Promise<INodeExecutionData[]> {\n\tconst result = await executeRequestWithSessionManagement.call(this, index, {\n\t\tmethod: 'POST',\n\t\tpath: '/sessions/{sessionId}/windows/{windowId}/scrape-content',\n\t\tbody: {},\n\t});\n\n\treturn this.helpers.returnJsonArray({ ...result });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,qBAAoD;AAEpD,eAAsB,QAErB,OACgC;AAChC,QAAM,SAAS,MAAM,mDAAoC,KAAK,MAAM,OAAO;AAAA,IAC1E,QAAQ;AAAA,IACR,MAAM;AAAA,IACN,MAAM,CAAC;AAAA,EACR,CAAC;AAED,SAAO,KAAK,QAAQ,gBAAgB,EAAE,GAAG,OAAO,CAAC;AAClD;","names":[]}
|
|
@@ -0,0 +1,104 @@
|
|
|
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 File_resource_exports = {};
|
|
30
|
+
__export(File_resource_exports, {
|
|
31
|
+
deleteFile: () => deleteFile,
|
|
32
|
+
description: () => description,
|
|
33
|
+
get: () => get,
|
|
34
|
+
getMany: () => getMany,
|
|
35
|
+
load: () => load,
|
|
36
|
+
upload: () => upload
|
|
37
|
+
});
|
|
38
|
+
module.exports = __toCommonJS(File_resource_exports);
|
|
39
|
+
var deleteFile = __toESM(require("./delete.operation"));
|
|
40
|
+
var get = __toESM(require("./get.operation"));
|
|
41
|
+
var getMany = __toESM(require("./getMany.operation"));
|
|
42
|
+
var load = __toESM(require("./load.operation"));
|
|
43
|
+
var upload = __toESM(require("./upload.operation"));
|
|
44
|
+
const description = [
|
|
45
|
+
{
|
|
46
|
+
displayName: "Operation",
|
|
47
|
+
name: "operation",
|
|
48
|
+
type: "options",
|
|
49
|
+
noDataExpression: true,
|
|
50
|
+
displayOptions: {
|
|
51
|
+
show: {
|
|
52
|
+
resource: ["file"]
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
options: [
|
|
56
|
+
{
|
|
57
|
+
name: "Delete",
|
|
58
|
+
value: "deleteFile",
|
|
59
|
+
description: "Delete an uploaded file",
|
|
60
|
+
action: "Delete a file"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
name: "Get",
|
|
64
|
+
value: "get",
|
|
65
|
+
description: "Get a details of an uploaded file",
|
|
66
|
+
action: "Get a file"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
name: "Get Many",
|
|
70
|
+
value: "getMany",
|
|
71
|
+
description: "Get details of multiple uploaded files",
|
|
72
|
+
action: "Get many files"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
name: "Load",
|
|
76
|
+
value: "load",
|
|
77
|
+
description: "Load a file into a session",
|
|
78
|
+
action: "Load a file"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
name: "Upload",
|
|
82
|
+
value: "upload",
|
|
83
|
+
description: "Upload a file into a session",
|
|
84
|
+
action: "Upload a file"
|
|
85
|
+
}
|
|
86
|
+
],
|
|
87
|
+
default: "getMany"
|
|
88
|
+
},
|
|
89
|
+
...deleteFile.description,
|
|
90
|
+
...get.description,
|
|
91
|
+
...getMany.description,
|
|
92
|
+
...load.description,
|
|
93
|
+
...upload.description
|
|
94
|
+
];
|
|
95
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
96
|
+
0 && (module.exports = {
|
|
97
|
+
deleteFile,
|
|
98
|
+
description,
|
|
99
|
+
get,
|
|
100
|
+
getMany,
|
|
101
|
+
load,
|
|
102
|
+
upload
|
|
103
|
+
});
|
|
104
|
+
//# sourceMappingURL=File.resource.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../nodes/Airtop/actions/file/File.resource.ts"],"sourcesContent":["import type { INodeProperties } from 'n8n-workflow';\n\nimport * as deleteFile from './delete.operation';\nimport * as get from './get.operation';\nimport * as getMany from './getMany.operation';\nimport * as load from './load.operation';\nimport * as upload from './upload.operation';\n\nexport { deleteFile, get, getMany, upload, load };\n\nexport const description: INodeProperties[] = [\n\t{\n\t\tdisplayName: 'Operation',\n\t\tname: 'operation',\n\t\ttype: 'options',\n\t\tnoDataExpression: true,\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tresource: ['file'],\n\t\t\t},\n\t\t},\n\t\toptions: [\n\t\t\t{\n\t\t\t\tname: 'Delete',\n\t\t\t\tvalue: 'deleteFile',\n\t\t\t\tdescription: 'Delete an uploaded file',\n\t\t\t\taction: 'Delete a file',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'Get',\n\t\t\t\tvalue: 'get',\n\t\t\t\tdescription: 'Get a details of an uploaded file',\n\t\t\t\taction: 'Get a file',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'Get Many',\n\t\t\t\tvalue: 'getMany',\n\t\t\t\tdescription: 'Get details of multiple uploaded files',\n\t\t\t\taction: 'Get many files',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'Load',\n\t\t\t\tvalue: 'load',\n\t\t\t\tdescription: 'Load a file into a session',\n\t\t\t\taction: 'Load a file',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'Upload',\n\t\t\t\tvalue: 'upload',\n\t\t\t\tdescription: 'Upload a file into a session',\n\t\t\t\taction: 'Upload a file',\n\t\t\t},\n\t\t],\n\t\tdefault: 'getMany',\n\t},\n\t...deleteFile.description,\n\t...get.description,\n\t...getMany.description,\n\t...load.description,\n\t...upload.description,\n];\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,iBAA4B;AAC5B,UAAqB;AACrB,cAAyB;AACzB,WAAsB;AACtB,aAAwB;AAIjB,MAAM,cAAiC;AAAA,EAC7C;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,kBAAkB;AAAA,IAClB,gBAAgB;AAAA,MACf,MAAM;AAAA,QACL,UAAU,CAAC,MAAM;AAAA,MAClB;AAAA,IACD;AAAA,IACA,SAAS;AAAA,MACR;AAAA,QACC,MAAM;AAAA,QACN,OAAO;AAAA,QACP,aAAa;AAAA,QACb,QAAQ;AAAA,MACT;AAAA,MACA;AAAA,QACC,MAAM;AAAA,QACN,OAAO;AAAA,QACP,aAAa;AAAA,QACb,QAAQ;AAAA,MACT;AAAA,MACA;AAAA,QACC,MAAM;AAAA,QACN,OAAO;AAAA,QACP,aAAa;AAAA,QACb,QAAQ;AAAA,MACT;AAAA,MACA;AAAA,QACC,MAAM;AAAA,QACN,OAAO;AAAA,QACP,aAAa;AAAA,QACb,QAAQ;AAAA,MACT;AAAA,MACA;AAAA,QACC,MAAM;AAAA,QACN,OAAO;AAAA,QACP,aAAa;AAAA,QACb,QAAQ;AAAA,MACT;AAAA,IACD;AAAA,IACA,SAAS;AAAA,EACV;AAAA,EACA,GAAG,WAAW;AAAA,EACd,GAAG,IAAI;AAAA,EACP,GAAG,QAAQ;AAAA,EACX,GAAG,KAAK;AAAA,EACR,GAAG,OAAO;AACX;","names":[]}
|
|
@@ -0,0 +1,60 @@
|
|
|
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 delete_operation_exports = {};
|
|
20
|
+
__export(delete_operation_exports, {
|
|
21
|
+
description: () => description,
|
|
22
|
+
execute: () => execute
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(delete_operation_exports);
|
|
25
|
+
var import_n8n_workflow = require("n8n-workflow");
|
|
26
|
+
var import_constants = require("../../constants");
|
|
27
|
+
var import_transport = require("../../transport");
|
|
28
|
+
const description = [
|
|
29
|
+
{
|
|
30
|
+
displayName: "File ID",
|
|
31
|
+
name: "fileId",
|
|
32
|
+
type: "string",
|
|
33
|
+
default: "",
|
|
34
|
+
required: true,
|
|
35
|
+
description: "ID of the file to delete",
|
|
36
|
+
displayOptions: {
|
|
37
|
+
show: {
|
|
38
|
+
resource: ["file"],
|
|
39
|
+
operation: ["deleteFile"]
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
];
|
|
44
|
+
async function execute(index) {
|
|
45
|
+
const fileId = this.getNodeParameter("fileId", index, "");
|
|
46
|
+
if (!fileId) {
|
|
47
|
+
throw new import_n8n_workflow.NodeOperationError(
|
|
48
|
+
this.getNode(),
|
|
49
|
+
import_constants.ERROR_MESSAGES.REQUIRED_PARAMETER.replace("{{field}}", "File ID")
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
await import_transport.apiRequest.call(this, "DELETE", `/files/${fileId}`);
|
|
53
|
+
return this.helpers.returnJsonArray({ data: { message: "File deleted successfully" } });
|
|
54
|
+
}
|
|
55
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
56
|
+
0 && (module.exports = {
|
|
57
|
+
description,
|
|
58
|
+
execute
|
|
59
|
+
});
|
|
60
|
+
//# sourceMappingURL=delete.operation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../nodes/Airtop/actions/file/delete.operation.ts"],"sourcesContent":["import type { IExecuteFunctions, INodeExecutionData, INodeProperties } from 'n8n-workflow';\nimport { NodeOperationError } from 'n8n-workflow';\n\nimport { ERROR_MESSAGES } from '../../constants';\nimport { apiRequest } from '../../transport';\n\nexport const description: INodeProperties[] = [\n\t{\n\t\tdisplayName: 'File ID',\n\t\tname: 'fileId',\n\t\ttype: 'string',\n\t\tdefault: '',\n\t\trequired: true,\n\t\tdescription: 'ID of the file to delete',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tresource: ['file'],\n\t\t\t\toperation: ['deleteFile'],\n\t\t\t},\n\t\t},\n\t},\n];\n\nexport async function execute(\n\tthis: IExecuteFunctions,\n\tindex: number,\n): Promise<INodeExecutionData[]> {\n\tconst fileId = this.getNodeParameter('fileId', index, '') as string;\n\n\tif (!fileId) {\n\t\tthrow new NodeOperationError(\n\t\t\tthis.getNode(),\n\t\t\tERROR_MESSAGES.REQUIRED_PARAMETER.replace('{{field}}', 'File ID'),\n\t\t);\n\t}\n\n\tawait apiRequest.call(this, 'DELETE', `/files/${fileId}`);\n\n\treturn this.helpers.returnJsonArray({ data: { message: 'File deleted successfully' } });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,0BAAmC;AAEnC,uBAA+B;AAC/B,uBAA2B;AAEpB,MAAM,cAAiC;AAAA,EAC7C;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,IACT,UAAU;AAAA,IACV,aAAa;AAAA,IACb,gBAAgB;AAAA,MACf,MAAM;AAAA,QACL,UAAU,CAAC,MAAM;AAAA,QACjB,WAAW,CAAC,YAAY;AAAA,MACzB;AAAA,IACD;AAAA,EACD;AACD;AAEA,eAAsB,QAErB,OACgC;AAChC,QAAM,SAAS,KAAK,iBAAiB,UAAU,OAAO,EAAE;AAExD,MAAI,CAAC,QAAQ;AACZ,UAAM,IAAI;AAAA,MACT,KAAK,QAAQ;AAAA,MACb,gCAAe,mBAAmB,QAAQ,aAAa,SAAS;AAAA,IACjE;AAAA,EACD;AAEA,QAAM,4BAAW,KAAK,MAAM,UAAU,UAAU,MAAM,EAAE;AAExD,SAAO,KAAK,QAAQ,gBAAgB,EAAE,MAAM,EAAE,SAAS,4BAA4B,EAAE,CAAC;AACvF;","names":[]}
|
|
@@ -0,0 +1,91 @@
|
|
|
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 get_operation_exports = {};
|
|
20
|
+
__export(get_operation_exports, {
|
|
21
|
+
description: () => description,
|
|
22
|
+
execute: () => execute
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(get_operation_exports);
|
|
25
|
+
var import_n8n_workflow = require("n8n-workflow");
|
|
26
|
+
var import_constants = require("../../constants");
|
|
27
|
+
var import_transport = require("../../transport");
|
|
28
|
+
const displayOptions = {
|
|
29
|
+
show: {
|
|
30
|
+
resource: ["file"],
|
|
31
|
+
operation: ["get"]
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
const description = [
|
|
35
|
+
{
|
|
36
|
+
displayName: "File ID",
|
|
37
|
+
name: "fileId",
|
|
38
|
+
type: "string",
|
|
39
|
+
default: "",
|
|
40
|
+
required: true,
|
|
41
|
+
description: "ID of the file to retrieve",
|
|
42
|
+
displayOptions
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
displayName: "Output Binary File",
|
|
46
|
+
name: "outputBinaryFile",
|
|
47
|
+
type: "boolean",
|
|
48
|
+
default: false,
|
|
49
|
+
description: "Whether to output the file in binary format if the file is ready for download",
|
|
50
|
+
displayOptions
|
|
51
|
+
}
|
|
52
|
+
];
|
|
53
|
+
async function execute(index) {
|
|
54
|
+
const fileId = this.getNodeParameter("fileId", index, "");
|
|
55
|
+
const outputBinaryFile = this.getNodeParameter("outputBinaryFile", index, false);
|
|
56
|
+
if (!fileId) {
|
|
57
|
+
throw new import_n8n_workflow.NodeOperationError(
|
|
58
|
+
this.getNode(),
|
|
59
|
+
import_constants.ERROR_MESSAGES.REQUIRED_PARAMETER.replace("{{field}}", "File ID")
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
const response = await import_transport.apiRequest.call(
|
|
63
|
+
this,
|
|
64
|
+
"GET",
|
|
65
|
+
`/files/${fileId}`
|
|
66
|
+
);
|
|
67
|
+
const { fileName = "", downloadUrl = "", status = "" } = response?.data ?? {};
|
|
68
|
+
if (outputBinaryFile && downloadUrl && status === "available") {
|
|
69
|
+
const buffer = await this.helpers.httpRequest({
|
|
70
|
+
url: downloadUrl,
|
|
71
|
+
json: false,
|
|
72
|
+
encoding: "arraybuffer"
|
|
73
|
+
});
|
|
74
|
+
const file = await this.helpers.prepareBinaryData(buffer, fileName);
|
|
75
|
+
return [
|
|
76
|
+
{
|
|
77
|
+
json: {
|
|
78
|
+
...response
|
|
79
|
+
},
|
|
80
|
+
binary: { data: file }
|
|
81
|
+
}
|
|
82
|
+
];
|
|
83
|
+
}
|
|
84
|
+
return this.helpers.returnJsonArray({ ...response });
|
|
85
|
+
}
|
|
86
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
87
|
+
0 && (module.exports = {
|
|
88
|
+
description,
|
|
89
|
+
execute
|
|
90
|
+
});
|
|
91
|
+
//# sourceMappingURL=get.operation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../nodes/Airtop/actions/file/get.operation.ts"],"sourcesContent":["import { NodeOperationError } from 'n8n-workflow';\nimport type { IExecuteFunctions, INodeExecutionData, INodeProperties } from 'n8n-workflow';\n\nimport { ERROR_MESSAGES } from '../../constants';\nimport { apiRequest } from '../../transport';\nimport type { IAirtopResponseWithFiles } from '../../transport/types';\n\nconst displayOptions = {\n\tshow: {\n\t\tresource: ['file'],\n\t\toperation: ['get'],\n\t},\n};\n\nexport const description: INodeProperties[] = [\n\t{\n\t\tdisplayName: 'File ID',\n\t\tname: 'fileId',\n\t\ttype: 'string',\n\t\tdefault: '',\n\t\trequired: true,\n\t\tdescription: 'ID of the file to retrieve',\n\t\tdisplayOptions,\n\t},\n\t{\n\t\tdisplayName: 'Output Binary File',\n\t\tname: 'outputBinaryFile',\n\t\ttype: 'boolean',\n\t\tdefault: false,\n\t\tdescription: 'Whether to output the file in binary format if the file is ready for download',\n\t\tdisplayOptions,\n\t},\n];\n\nexport async function execute(\n\tthis: IExecuteFunctions,\n\tindex: number,\n): Promise<INodeExecutionData[]> {\n\tconst fileId = this.getNodeParameter('fileId', index, '') as string;\n\tconst outputBinaryFile = this.getNodeParameter('outputBinaryFile', index, false);\n\n\tif (!fileId) {\n\t\tthrow new NodeOperationError(\n\t\t\tthis.getNode(),\n\t\t\tERROR_MESSAGES.REQUIRED_PARAMETER.replace('{{field}}', 'File ID'),\n\t\t);\n\t}\n\n\tconst response = (await apiRequest.call(\n\t\tthis,\n\t\t'GET',\n\t\t`/files/${fileId}`,\n\t)) as IAirtopResponseWithFiles;\n\n\tconst { fileName = '', downloadUrl = '', status = '' } = response?.data ?? {};\n\n\t// Handle binary file output\n\tif (outputBinaryFile && downloadUrl && status === 'available') {\n\t\tconst buffer = (await this.helpers.httpRequest({\n\t\t\turl: downloadUrl,\n\t\t\tjson: false,\n\t\t\tencoding: 'arraybuffer',\n\t\t})) as Buffer;\n\t\tconst file = await this.helpers.prepareBinaryData(buffer, fileName);\n\t\treturn [\n\t\t\t{\n\t\t\t\tjson: {\n\t\t\t\t\t...response,\n\t\t\t\t},\n\t\t\t\tbinary: { data: file },\n\t\t\t},\n\t\t];\n\t}\n\n\treturn this.helpers.returnJsonArray({ ...response });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAmC;AAGnC,uBAA+B;AAC/B,uBAA2B;AAG3B,MAAM,iBAAiB;AAAA,EACtB,MAAM;AAAA,IACL,UAAU,CAAC,MAAM;AAAA,IACjB,WAAW,CAAC,KAAK;AAAA,EAClB;AACD;AAEO,MAAM,cAAiC;AAAA,EAC7C;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,IACT,UAAU;AAAA,IACV,aAAa;AAAA,IACb;AAAA,EACD;AAAA,EACA;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,IACT,aAAa;AAAA,IACb;AAAA,EACD;AACD;AAEA,eAAsB,QAErB,OACgC;AAChC,QAAM,SAAS,KAAK,iBAAiB,UAAU,OAAO,EAAE;AACxD,QAAM,mBAAmB,KAAK,iBAAiB,oBAAoB,OAAO,KAAK;AAE/E,MAAI,CAAC,QAAQ;AACZ,UAAM,IAAI;AAAA,MACT,KAAK,QAAQ;AAAA,MACb,gCAAe,mBAAmB,QAAQ,aAAa,SAAS;AAAA,IACjE;AAAA,EACD;AAEA,QAAM,WAAY,MAAM,4BAAW;AAAA,IAClC;AAAA,IACA;AAAA,IACA,UAAU,MAAM;AAAA,EACjB;AAEA,QAAM,EAAE,WAAW,IAAI,cAAc,IAAI,SAAS,GAAG,IAAI,UAAU,QAAQ,CAAC;AAG5E,MAAI,oBAAoB,eAAe,WAAW,aAAa;AAC9D,UAAM,SAAU,MAAM,KAAK,QAAQ,YAAY;AAAA,MAC9C,KAAK;AAAA,MACL,MAAM;AAAA,MACN,UAAU;AAAA,IACX,CAAC;AACD,UAAM,OAAO,MAAM,KAAK,QAAQ,kBAAkB,QAAQ,QAAQ;AAClE,WAAO;AAAA,MACN;AAAA,QACC,MAAM;AAAA,UACL,GAAG;AAAA,QACJ;AAAA,QACA,QAAQ,EAAE,MAAM,KAAK;AAAA,MACtB;AAAA,IACD;AAAA,EACD;AAEA,SAAO,KAAK,QAAQ,gBAAgB,EAAE,GAAG,SAAS,CAAC;AACpD;","names":[]}
|