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.
Files changed (274) hide show
  1. package/dist/credentials/AirtopApi.credentials.js +2 -1
  2. package/dist/credentials/AirtopApi.credentials.js.map +1 -1
  3. package/dist/credentials/JinaAiApi.credentials.js +1 -1
  4. package/dist/credentials/JinaAiApi.credentials.js.map +1 -1
  5. package/dist/credentials/MicrosoftSharePointOAuth2Api.credentials.js +0 -9
  6. package/dist/credentials/MicrosoftSharePointOAuth2Api.credentials.js.map +1 -1
  7. package/dist/credentials/MicrosoftTeamsOAuth2Api.credentials.js +13 -0
  8. package/dist/credentials/MicrosoftTeamsOAuth2Api.credentials.js.map +1 -1
  9. package/dist/credentials/Snowflake.credentials.js +46 -2
  10. package/dist/credentials/Snowflake.credentials.js.map +1 -1
  11. package/dist/known/credentials.json +10 -1
  12. package/dist/known/nodes.json +20 -4
  13. package/dist/methods/defined.json +6 -0
  14. package/dist/methods/referenced.json +3 -0
  15. package/dist/nodes/Airtop/Airtop.node.js +14 -8
  16. package/dist/nodes/Airtop/Airtop.node.js.map +1 -1
  17. package/dist/nodes/Airtop/GenericFunctions.js +87 -15
  18. package/dist/nodes/Airtop/GenericFunctions.js.map +1 -1
  19. package/dist/nodes/Airtop/actions/common/fields.js +9 -0
  20. package/dist/nodes/Airtop/actions/common/fields.js.map +1 -1
  21. package/dist/nodes/Airtop/actions/common/output.utils.js +79 -0
  22. package/dist/nodes/Airtop/actions/common/output.utils.js.map +1 -0
  23. package/dist/nodes/Airtop/actions/common/session.utils.js +2 -2
  24. package/dist/nodes/Airtop/actions/common/session.utils.js.map +1 -1
  25. package/dist/nodes/Airtop/actions/extraction/getPaginated.operation.js +13 -4
  26. package/dist/nodes/Airtop/actions/extraction/getPaginated.operation.js.map +1 -1
  27. package/dist/nodes/Airtop/actions/extraction/query.operation.js +21 -3
  28. package/dist/nodes/Airtop/actions/extraction/query.operation.js.map +1 -1
  29. package/dist/nodes/Airtop/actions/extraction/scrape.operation.js +2 -1
  30. package/dist/nodes/Airtop/actions/extraction/scrape.operation.js.map +1 -1
  31. package/dist/nodes/Airtop/actions/file/File.resource.js +104 -0
  32. package/dist/nodes/Airtop/actions/file/File.resource.js.map +1 -0
  33. package/dist/nodes/Airtop/actions/file/delete.operation.js +60 -0
  34. package/dist/nodes/Airtop/actions/file/delete.operation.js.map +1 -0
  35. package/dist/nodes/Airtop/actions/file/get.operation.js +91 -0
  36. package/dist/nodes/Airtop/actions/file/get.operation.js.map +1 -0
  37. package/dist/nodes/Airtop/actions/file/getMany.operation.js +100 -0
  38. package/dist/nodes/Airtop/actions/file/getMany.operation.js.map +1 -0
  39. package/dist/nodes/Airtop/actions/file/helpers.js +199 -0
  40. package/dist/nodes/Airtop/actions/file/helpers.js.map +1 -0
  41. package/dist/nodes/Airtop/actions/file/load.operation.js +85 -0
  42. package/dist/nodes/Airtop/actions/file/load.operation.js.map +1 -0
  43. package/dist/nodes/Airtop/actions/file/upload.operation.js +186 -0
  44. package/dist/nodes/Airtop/actions/file/upload.operation.js.map +1 -0
  45. package/dist/nodes/Airtop/actions/interaction/Interaction.resource.js +22 -1
  46. package/dist/nodes/Airtop/actions/interaction/Interaction.resource.js.map +1 -1
  47. package/dist/nodes/Airtop/actions/interaction/fill.operation.js +89 -0
  48. package/dist/nodes/Airtop/actions/interaction/fill.operation.js.map +1 -0
  49. package/dist/nodes/Airtop/actions/interaction/scroll.operation.js +219 -0
  50. package/dist/nodes/Airtop/actions/interaction/scroll.operation.js.map +1 -0
  51. package/dist/nodes/Airtop/actions/node.type.js.map +1 -1
  52. package/dist/nodes/Airtop/actions/router.js +13 -4
  53. package/dist/nodes/Airtop/actions/router.js.map +1 -1
  54. package/dist/nodes/Airtop/actions/session/create.operation.js +85 -32
  55. package/dist/nodes/Airtop/actions/session/create.operation.js.map +1 -1
  56. package/dist/nodes/Airtop/actions/window/Window.resource.js +2 -1
  57. package/dist/nodes/Airtop/actions/window/Window.resource.js.map +1 -1
  58. package/dist/nodes/Airtop/actions/window/create.operation.js +1 -1
  59. package/dist/nodes/Airtop/actions/window/create.operation.js.map +1 -1
  60. package/dist/nodes/Airtop/actions/window/takeScreenshot.operation.js +26 -3
  61. package/dist/nodes/Airtop/actions/window/takeScreenshot.operation.js.map +1 -1
  62. package/dist/nodes/Airtop/constants.js +38 -5
  63. package/dist/nodes/Airtop/constants.js.map +1 -1
  64. package/dist/nodes/Airtop/countries.js +1026 -0
  65. package/dist/nodes/Airtop/countries.js.map +1 -0
  66. package/dist/nodes/Airtop/transport/index.js +6 -3
  67. package/dist/nodes/Airtop/transport/index.js.map +1 -1
  68. package/dist/nodes/Airtop/transport/types.js.map +1 -1
  69. package/dist/nodes/Aws/IAM/AwsIam.node.js +95 -0
  70. package/dist/nodes/Aws/IAM/AwsIam.node.js.map +1 -0
  71. package/dist/nodes/Aws/IAM/AwsIam.node.json +18 -0
  72. package/dist/nodes/Aws/IAM/AwsIam.svg +18 -0
  73. package/dist/nodes/Aws/IAM/descriptions/common.js +188 -0
  74. package/dist/nodes/Aws/IAM/descriptions/common.js.map +1 -0
  75. package/dist/nodes/Aws/IAM/descriptions/group/Group.resource.js +175 -0
  76. package/dist/nodes/Aws/IAM/descriptions/group/Group.resource.js.map +1 -0
  77. package/dist/nodes/Aws/IAM/descriptions/group/create.operation.js +66 -0
  78. package/dist/nodes/Aws/IAM/descriptions/group/create.operation.js.map +1 -0
  79. package/dist/nodes/Aws/IAM/descriptions/group/delete.operation.js +43 -0
  80. package/dist/nodes/Aws/IAM/descriptions/group/delete.operation.js.map +1 -0
  81. package/dist/nodes/Aws/IAM/descriptions/group/get.operation.js +50 -0
  82. package/dist/nodes/Aws/IAM/descriptions/group/get.operation.js.map +1 -0
  83. package/dist/nodes/Aws/IAM/descriptions/group/getAll.operation.js +47 -0
  84. package/dist/nodes/Aws/IAM/descriptions/group/getAll.operation.js.map +1 -0
  85. package/dist/nodes/Aws/IAM/descriptions/group/update.operation.js +70 -0
  86. package/dist/nodes/Aws/IAM/descriptions/group/update.operation.js.map +1 -0
  87. package/dist/nodes/Aws/IAM/descriptions/index.js +42 -0
  88. package/dist/nodes/Aws/IAM/descriptions/index.js.map +1 -0
  89. package/dist/nodes/Aws/IAM/descriptions/user/User.resource.js +231 -0
  90. package/dist/nodes/Aws/IAM/descriptions/user/User.resource.js.map +1 -0
  91. package/dist/nodes/Aws/IAM/descriptions/user/addToGroup.operation.js +47 -0
  92. package/dist/nodes/Aws/IAM/descriptions/user/addToGroup.operation.js.map +1 -0
  93. package/dist/nodes/Aws/IAM/descriptions/user/create.operation.js +118 -0
  94. package/dist/nodes/Aws/IAM/descriptions/user/create.operation.js.map +1 -0
  95. package/dist/nodes/Aws/IAM/descriptions/user/delete.operation.js +43 -0
  96. package/dist/nodes/Aws/IAM/descriptions/user/delete.operation.js.map +1 -0
  97. package/dist/nodes/Aws/IAM/descriptions/user/get.operation.js +43 -0
  98. package/dist/nodes/Aws/IAM/descriptions/user/get.operation.js.map +1 -0
  99. package/dist/nodes/Aws/IAM/descriptions/user/getAll.operation.js +66 -0
  100. package/dist/nodes/Aws/IAM/descriptions/user/getAll.operation.js.map +1 -0
  101. package/dist/nodes/Aws/IAM/descriptions/user/removeFromGroup.operation.js +74 -0
  102. package/dist/nodes/Aws/IAM/descriptions/user/removeFromGroup.operation.js.map +1 -0
  103. package/dist/nodes/Aws/IAM/descriptions/user/update.operation.js +68 -0
  104. package/dist/nodes/Aws/IAM/descriptions/user/update.operation.js.map +1 -0
  105. package/dist/nodes/Aws/IAM/helpers/constants.js +47 -0
  106. package/dist/nodes/Aws/IAM/helpers/constants.js.map +1 -0
  107. package/dist/nodes/Aws/IAM/helpers/errorHandler.js +90 -0
  108. package/dist/nodes/Aws/IAM/helpers/errorHandler.js.map +1 -0
  109. package/dist/nodes/Aws/IAM/helpers/types.js +17 -0
  110. package/dist/nodes/Aws/IAM/helpers/types.js.map +1 -0
  111. package/dist/nodes/Aws/IAM/helpers/utils.js +279 -0
  112. package/dist/nodes/Aws/IAM/helpers/utils.js.map +1 -0
  113. package/dist/nodes/Aws/IAM/methods/index.js +39 -0
  114. package/dist/nodes/Aws/IAM/methods/index.js.map +1 -0
  115. package/dist/nodes/Aws/IAM/methods/listSearch.js +132 -0
  116. package/dist/nodes/Aws/IAM/methods/listSearch.js.map +1 -0
  117. package/dist/nodes/Aws/IAM/transport/index.js +64 -0
  118. package/dist/nodes/Aws/IAM/transport/index.js.map +1 -0
  119. package/dist/nodes/Cron/Cron.node.js +1 -1
  120. package/dist/nodes/Cron/Cron.node.js.map +1 -1
  121. package/dist/nodes/EmailReadImap/v1/EmailReadImapV1.node.js +2 -2
  122. package/dist/nodes/EmailReadImap/v1/EmailReadImapV1.node.js.map +1 -1
  123. package/dist/nodes/EmailReadImap/v2/EmailReadImapV2.node.js +2 -2
  124. package/dist/nodes/EmailReadImap/v2/EmailReadImapV2.node.js.map +1 -1
  125. package/dist/nodes/Evaluation/Evaluation/Description.node.js +146 -0
  126. package/dist/nodes/Evaluation/Evaluation/Description.node.js.map +1 -0
  127. package/dist/nodes/Evaluation/Evaluation/Evaluation.node.ee.js +117 -0
  128. package/dist/nodes/Evaluation/Evaluation/Evaluation.node.ee.js.map +1 -0
  129. package/dist/nodes/Evaluation/EvaluationTrigger/EvaluationTrigger.node.ee.js +187 -0
  130. package/dist/nodes/Evaluation/EvaluationTrigger/EvaluationTrigger.node.ee.js.map +1 -0
  131. package/dist/nodes/Evaluation/methods/index.js +42 -0
  132. package/dist/nodes/Evaluation/methods/index.js.map +1 -0
  133. package/dist/nodes/Evaluation/methods/loadOptions.js +40 -0
  134. package/dist/nodes/Evaluation/methods/loadOptions.js.map +1 -0
  135. package/dist/nodes/Evaluation/utils/evaluationTriggerUtils.js +119 -0
  136. package/dist/nodes/Evaluation/utils/evaluationTriggerUtils.js.map +1 -0
  137. package/dist/nodes/Evaluation/utils/evaluationUtils.js +171 -0
  138. package/dist/nodes/Evaluation/utils/evaluationUtils.js.map +1 -0
  139. package/dist/nodes/ExecuteWorkflow/ExecuteWorkflowTrigger/ExecuteWorkflowTrigger.node.js +4 -3
  140. package/dist/nodes/ExecuteWorkflow/ExecuteWorkflowTrigger/ExecuteWorkflowTrigger.node.js.map +1 -1
  141. package/dist/nodes/Form/common.descriptions.js +2 -2
  142. package/dist/nodes/Form/common.descriptions.js.map +1 -1
  143. package/dist/nodes/Google/Drive/v2/actions/file/upload.operation.js +4 -1
  144. package/dist/nodes/Google/Drive/v2/actions/file/upload.operation.js.map +1 -1
  145. package/dist/nodes/Google/Firebase/CloudFirestore/GenericFunctions.js +1 -2
  146. package/dist/nodes/Google/Firebase/CloudFirestore/GenericFunctions.js.map +1 -1
  147. package/dist/nodes/Google/Sheet/GoogleSheetsTrigger.node.js +113 -107
  148. package/dist/nodes/Google/Sheet/GoogleSheetsTrigger.node.js.map +1 -1
  149. package/dist/nodes/Google/Sheet/v2/actions/sheet/read.operation.js +52 -106
  150. package/dist/nodes/Google/Sheet/v2/actions/sheet/read.operation.js.map +1 -1
  151. package/dist/nodes/Google/Sheet/v2/actions/utils/readOperation.js +97 -0
  152. package/dist/nodes/Google/Sheet/v2/actions/utils/readOperation.js.map +1 -0
  153. package/dist/nodes/Google/Sheet/v2/actions/versionDescription.js +20 -17
  154. package/dist/nodes/Google/Sheet/v2/actions/versionDescription.js.map +1 -1
  155. package/dist/nodes/Google/YouTube/YouTube.node.js +4 -2
  156. package/dist/nodes/Google/YouTube/YouTube.node.js.map +1 -1
  157. package/dist/nodes/HttpRequest/GenericFunctions.js +1 -1
  158. package/dist/nodes/HttpRequest/GenericFunctions.js.map +1 -1
  159. package/dist/nodes/Interval/Interval.node.js +1 -1
  160. package/dist/nodes/Interval/Interval.node.js.map +1 -1
  161. package/dist/nodes/Jira/Jira.node.js +34 -15
  162. package/dist/nodes/Jira/Jira.node.js.map +1 -1
  163. package/dist/nodes/LocalFileTrigger/LocalFileTrigger.node.js +2 -2
  164. package/dist/nodes/LocalFileTrigger/LocalFileTrigger.node.js.map +1 -1
  165. package/dist/nodes/MQTT/MqttTrigger.node.js +2 -2
  166. package/dist/nodes/MQTT/MqttTrigger.node.js.map +1 -1
  167. package/dist/nodes/ManualTrigger/ManualTrigger.node.js +1 -1
  168. package/dist/nodes/ManualTrigger/ManualTrigger.node.js.map +1 -1
  169. package/dist/nodes/Merge/Merge.node.js +3 -2
  170. package/dist/nodes/Merge/Merge.node.js.map +1 -1
  171. package/dist/nodes/Merge/v3/actions/mode/combineBySql.js +42 -4
  172. package/dist/nodes/Merge/v3/actions/mode/combineBySql.js.map +1 -1
  173. package/dist/nodes/Merge/v3/actions/versionDescription.js +1 -1
  174. package/dist/nodes/Merge/v3/actions/versionDescription.js.map +1 -1
  175. package/dist/nodes/Microsoft/SharePoint/MicrosoftSharePoint.node.js +93 -0
  176. package/dist/nodes/Microsoft/SharePoint/MicrosoftSharePoint.node.js.map +1 -0
  177. package/dist/nodes/Microsoft/SharePoint/MicrosoftSharepoint.node.json +18 -0
  178. package/dist/nodes/Microsoft/SharePoint/descriptions/common.descriptions.js +190 -0
  179. package/dist/nodes/Microsoft/SharePoint/descriptions/common.descriptions.js.map +1 -0
  180. package/dist/nodes/Microsoft/SharePoint/descriptions/file/File.resource.js +108 -0
  181. package/dist/nodes/Microsoft/SharePoint/descriptions/file/File.resource.js.map +1 -0
  182. package/dist/nodes/Microsoft/SharePoint/descriptions/file/download.operation.js +62 -0
  183. package/dist/nodes/Microsoft/SharePoint/descriptions/file/download.operation.js.map +1 -0
  184. package/dist/nodes/Microsoft/SharePoint/descriptions/file/update.operation.js +129 -0
  185. package/dist/nodes/Microsoft/SharePoint/descriptions/file/update.operation.js.map +1 -0
  186. package/dist/nodes/Microsoft/SharePoint/descriptions/file/upload.operation.js +77 -0
  187. package/dist/nodes/Microsoft/SharePoint/descriptions/file/upload.operation.js.map +1 -0
  188. package/dist/nodes/Microsoft/SharePoint/descriptions/index.js +45 -0
  189. package/dist/nodes/Microsoft/SharePoint/descriptions/index.js.map +1 -0
  190. package/dist/nodes/Microsoft/SharePoint/descriptions/item/Item.resource.js +175 -0
  191. package/dist/nodes/Microsoft/SharePoint/descriptions/item/Item.resource.js.map +1 -0
  192. package/dist/nodes/Microsoft/SharePoint/descriptions/item/create.operation.js +100 -0
  193. package/dist/nodes/Microsoft/SharePoint/descriptions/item/create.operation.js.map +1 -0
  194. package/dist/nodes/Microsoft/SharePoint/descriptions/item/delete.operation.js +62 -0
  195. package/dist/nodes/Microsoft/SharePoint/descriptions/item/delete.operation.js.map +1 -0
  196. package/dist/nodes/Microsoft/SharePoint/descriptions/item/get.operation.js +83 -0
  197. package/dist/nodes/Microsoft/SharePoint/descriptions/item/get.operation.js.map +1 -0
  198. package/dist/nodes/Microsoft/SharePoint/descriptions/item/getAll.operation.js +203 -0
  199. package/dist/nodes/Microsoft/SharePoint/descriptions/item/getAll.operation.js.map +1 -0
  200. package/dist/nodes/Microsoft/SharePoint/descriptions/item/update.operation.js +100 -0
  201. package/dist/nodes/Microsoft/SharePoint/descriptions/item/update.operation.js.map +1 -0
  202. package/dist/nodes/Microsoft/SharePoint/descriptions/item/upsert.operation.js +100 -0
  203. package/dist/nodes/Microsoft/SharePoint/descriptions/item/upsert.operation.js.map +1 -0
  204. package/dist/nodes/Microsoft/SharePoint/descriptions/list/List.resource.js +99 -0
  205. package/dist/nodes/Microsoft/SharePoint/descriptions/list/List.resource.js.map +1 -0
  206. package/dist/nodes/Microsoft/SharePoint/descriptions/list/get.operation.js +65 -0
  207. package/dist/nodes/Microsoft/SharePoint/descriptions/list/get.operation.js.map +1 -0
  208. package/dist/nodes/Microsoft/SharePoint/descriptions/list/getAll.operation.js +105 -0
  209. package/dist/nodes/Microsoft/SharePoint/descriptions/list/getAll.operation.js.map +1 -0
  210. package/dist/nodes/Microsoft/SharePoint/helpers/interfaces.js +17 -0
  211. package/dist/nodes/Microsoft/SharePoint/helpers/interfaces.js.map +1 -0
  212. package/dist/nodes/Microsoft/SharePoint/helpers/utils.js +252 -0
  213. package/dist/nodes/Microsoft/SharePoint/helpers/utils.js.map +1 -0
  214. package/dist/nodes/Microsoft/SharePoint/methods/index.js +42 -0
  215. package/dist/nodes/Microsoft/SharePoint/methods/index.js.map +1 -0
  216. package/dist/nodes/Microsoft/SharePoint/methods/listSearch.js +222 -0
  217. package/dist/nodes/Microsoft/SharePoint/methods/listSearch.js.map +1 -0
  218. package/dist/nodes/Microsoft/SharePoint/methods/resourceMapping.js +104 -0
  219. package/dist/nodes/Microsoft/SharePoint/methods/resourceMapping.js.map +1 -0
  220. package/dist/nodes/Microsoft/SharePoint/test/credentials.js +54 -0
  221. package/dist/nodes/Microsoft/SharePoint/test/credentials.js.map +1 -0
  222. package/dist/nodes/Microsoft/SharePoint/transport/index.js +46 -0
  223. package/dist/nodes/Microsoft/SharePoint/transport/index.js.map +1 -0
  224. package/dist/nodes/Microsoft/Teams/MicrosoftTeamsTrigger.node.js +387 -0
  225. package/dist/nodes/Microsoft/Teams/MicrosoftTeamsTrigger.node.js.map +1 -0
  226. package/dist/nodes/Microsoft/Teams/MicrosoftTeamsTrigger.node.json +18 -0
  227. package/dist/nodes/Microsoft/Teams/v2/helpers/types.js +17 -0
  228. package/dist/nodes/Microsoft/Teams/v2/helpers/types.js.map +1 -0
  229. package/dist/nodes/Microsoft/Teams/v2/helpers/utils-trigger.js +147 -0
  230. package/dist/nodes/Microsoft/Teams/v2/helpers/utils-trigger.js.map +1 -0
  231. package/dist/nodes/Microsoft/Teams/v2/transport/index.js.map +1 -1
  232. package/dist/nodes/MongoDb/GenericFunctions.js +9 -2
  233. package/dist/nodes/MongoDb/GenericFunctions.js.map +1 -1
  234. package/dist/nodes/MongoDb/MongoDb.node.js +25 -5
  235. package/dist/nodes/MongoDb/MongoDb.node.js.map +1 -1
  236. package/dist/nodes/PostBin/BinDescription.js +1 -1
  237. package/dist/nodes/PostBin/BinDescription.js.map +1 -1
  238. package/dist/nodes/PostBin/GenericFunctions.js +5 -5
  239. package/dist/nodes/PostBin/GenericFunctions.js.map +1 -1
  240. package/dist/nodes/PostBin/PostBin.node.js +1 -1
  241. package/dist/nodes/PostBin/PostBin.node.js.map +1 -1
  242. package/dist/nodes/PostBin/RequestDescription.js +2 -2
  243. package/dist/nodes/PostBin/RequestDescription.js.map +1 -1
  244. package/dist/nodes/Postgres/PostgresTrigger.node.js +2 -2
  245. package/dist/nodes/Postgres/PostgresTrigger.node.js.map +1 -1
  246. package/dist/nodes/RabbitMQ/RabbitMQTrigger.node.js +2 -2
  247. package/dist/nodes/RabbitMQ/RabbitMQTrigger.node.js.map +1 -1
  248. package/dist/nodes/RespondToWebhook/RespondToWebhook.node.js +8 -3
  249. package/dist/nodes/RespondToWebhook/RespondToWebhook.node.js.map +1 -1
  250. package/dist/nodes/RespondToWebhook/utils.js +43 -0
  251. package/dist/nodes/RespondToWebhook/utils.js.map +1 -0
  252. package/dist/nodes/Schedule/ScheduleTrigger.node.js +1 -1
  253. package/dist/nodes/Schedule/ScheduleTrigger.node.js.map +1 -1
  254. package/dist/nodes/Snowflake/GenericFunctions.js +34 -2
  255. package/dist/nodes/Snowflake/GenericFunctions.js.map +1 -1
  256. package/dist/nodes/Snowflake/Snowflake.node.js +5 -7
  257. package/dist/nodes/Snowflake/Snowflake.node.js.map +1 -1
  258. package/dist/nodes/SseTrigger/SseTrigger.node.js +2 -2
  259. package/dist/nodes/SseTrigger/SseTrigger.node.js.map +1 -1
  260. package/dist/nodes/Telegram/Telegram.node.js +5 -1
  261. package/dist/nodes/Telegram/Telegram.node.js.map +1 -1
  262. package/dist/nodes/Transform/Summarize/utils.js +2 -1
  263. package/dist/nodes/Transform/Summarize/utils.js.map +1 -1
  264. package/dist/test/setup.js +1 -0
  265. package/dist/test/setup.js.map +1 -1
  266. package/dist/types/credentials.json +7 -7
  267. package/dist/types/nodes.json +27 -23
  268. package/dist/utils/workflowInputsResourceMapping/GenericFunctions.js +12 -2
  269. package/dist/utils/workflowInputsResourceMapping/GenericFunctions.js.map +1 -1
  270. package/package.json +15 -12
  271. package/dist/nodes/EvaluationMetrics/EvaluationMetrics.node.js +0 -119
  272. package/dist/nodes/EvaluationMetrics/EvaluationMetrics.node.js.map +0 -1
  273. package/dist/nodes/EvaluationMetrics/EvaluationMetrics.node.json +0 -14
  274. /package/dist/{credentials/icons/SharePoint.svg → nodes/Microsoft/SharePoint/microsoftSharePoint.svg} +0 -0
@@ -22,19 +22,21 @@ __export(create_operation_exports, {
22
22
  execute: () => execute
23
23
  });
24
24
  module.exports = __toCommonJS(create_operation_exports);
25
- var import_constants = require("../../constants");
25
+ var import_countries = require("../../countries");
26
26
  var import_GenericFunctions = require("../../GenericFunctions");
27
27
  var import_transport = require("../../transport");
28
28
  var import_fields = require("../common/fields");
29
+ const displayOptions = {
30
+ show: {
31
+ resource: ["session"],
32
+ operation: ["create"]
33
+ }
34
+ };
35
+ const countryOptions = import_countries.COUNTRIES.map(({ name, value }) => ({ name, value }));
29
36
  const description = [
30
37
  {
31
38
  ...import_fields.profileNameField,
32
- displayOptions: {
33
- show: {
34
- resource: ["session"],
35
- operation: ["create"]
36
- }
37
- }
39
+ displayOptions
38
40
  },
39
41
  {
40
42
  displayName: "Save Profile",
@@ -42,12 +44,7 @@ const description = [
42
44
  type: "boolean",
43
45
  default: false,
44
46
  description: 'Whether to automatically save the <a href="https://docs.airtop.ai/guides/how-to/saving-a-profile" target="_blank">Airtop profile</a> for this session upon termination',
45
- displayOptions: {
46
- show: {
47
- resource: ["session"],
48
- operation: ["create"]
49
- }
50
- }
47
+ displayOptions
51
48
  },
52
49
  {
53
50
  displayName: "Idle Timeout",
@@ -56,13 +53,11 @@ const description = [
56
53
  default: 10,
57
54
  validateType: "number",
58
55
  description: "Minutes to wait before the session is terminated due to inactivity",
59
- displayOptions: {
60
- show: {
61
- resource: ["session"],
62
- operation: ["create"]
63
- }
64
- }
56
+ displayOptions
65
57
  },
58
+ /**
59
+ * Proxy Configuration
60
+ */
66
61
  {
67
62
  displayName: "Proxy",
68
63
  name: "proxy",
@@ -81,15 +76,41 @@ const description = [
81
76
  description: "Use Airtop-provided proxy"
82
77
  },
83
78
  {
84
- name: "Custom",
85
- value: "custom",
86
- description: "Configure a custom proxy"
79
+ name: "Proxy URL",
80
+ value: "proxyUrl",
81
+ description: "Use a proxy URL to configure the proxy"
82
+ }
83
+ ],
84
+ displayOptions
85
+ },
86
+ {
87
+ displayName: "Proxy Configuration",
88
+ name: "proxyConfig",
89
+ type: "collection",
90
+ default: { country: "US", sticky: true },
91
+ description: "The Airtop-provided configuration to use for the proxy",
92
+ placeholder: "Add Attribute",
93
+ options: [
94
+ {
95
+ displayName: "Country",
96
+ name: "country",
97
+ type: "options",
98
+ default: "US",
99
+ description: 'The country to use for the proxy. Not all countries are guaranteed to provide a proxy. Learn more <a href="https://docs.airtop.ai/api-reference/airtop-api/sessions/create#request.body.configuration.proxy.Proxy.Airtop-Proxy-Configuration.country" target="_blank">here</a>.',
100
+ options: countryOptions
101
+ },
102
+ {
103
+ displayName: "Keep Same IP",
104
+ name: "sticky",
105
+ type: "boolean",
106
+ default: true,
107
+ description: "Whether to try to maintain the same IP address for the duration of the session. Airtop can guarantee that the same IP address will be available for up to a maximum of 30 minutes."
87
108
  }
88
109
  ],
89
110
  displayOptions: {
90
111
  show: {
91
- resource: ["session"],
92
- operation: ["create"]
112
+ ...displayOptions.show,
113
+ proxy: ["integrated"]
93
114
  }
94
115
  }
95
116
  },
@@ -99,30 +120,62 @@ const description = [
99
120
  type: "string",
100
121
  default: "",
101
122
  description: "The URL of the proxy to use",
123
+ validateType: "string",
102
124
  displayOptions: {
103
125
  show: {
104
- proxy: ["custom"]
126
+ ...displayOptions.show,
127
+ proxy: ["proxyUrl"]
105
128
  }
106
129
  }
130
+ },
131
+ {
132
+ displayName: "Additional Fields",
133
+ name: "additionalFields",
134
+ type: "collection",
135
+ placeholder: "Add Field",
136
+ default: {},
137
+ displayOptions,
138
+ options: [
139
+ {
140
+ displayName: "Auto Solve Captchas",
141
+ name: "solveCaptcha",
142
+ type: "boolean",
143
+ default: false,
144
+ description: 'Whether to automatically solve <a href="https://docs.airtop.ai/guides/how-to/solving-captchas" target="_blank">captcha challenges</a>'
145
+ },
146
+ {
147
+ displayName: "Extension IDs",
148
+ name: "extensionIds",
149
+ type: "string",
150
+ default: "",
151
+ placeholder: "e.g. extId1, extId2, ...",
152
+ description: 'Comma-separated extension IDs from the Google Web Store to be loaded into the session. Learn more <a href="https://docs.airtop.ai/guides/how-to/using-chrome-extensions" target="_blank">here</a>.'
153
+ }
154
+ ]
107
155
  }
108
156
  ];
109
157
  async function execute(index) {
110
- const url = `${import_constants.INTEGRATION_URL}/create-session`;
111
158
  const profileName = import_GenericFunctions.validateProfileName.call(this, index);
112
159
  const timeoutMinutes = import_GenericFunctions.validateTimeoutMinutes.call(this, index);
113
160
  const saveProfileOnTermination = import_GenericFunctions.validateSaveProfileOnTermination.call(this, index, profileName);
114
- const proxyParam = this.getNodeParameter("proxy", index, "none");
115
- const proxyUrl = import_GenericFunctions.validateProxyUrl.call(this, index, proxyParam);
161
+ const { proxy } = import_GenericFunctions.validateProxy.call(this, index);
162
+ const solveCaptcha = this.getNodeParameter(
163
+ "additionalFields.solveCaptcha",
164
+ index,
165
+ false
166
+ );
167
+ const extensions = this.getNodeParameter("additionalFields.extensionIds", index, "");
168
+ const extensionIds = extensions ? extensions.split(",").map((id) => id.trim()) : [];
116
169
  const body = {
117
170
  configuration: {
118
171
  profileName,
119
172
  timeoutMinutes,
120
- proxy: proxyParam === "custom" ? proxyUrl : Boolean(proxyParam === "integrated")
173
+ proxy,
174
+ solveCaptcha,
175
+ ...extensionIds.length > 0 ? { extensionIds } : {}
121
176
  }
122
177
  };
123
- const response = await import_transport.apiRequest.call(this, "POST", url, body);
124
- const sessionId = response.sessionId;
125
- (0, import_GenericFunctions.validateAirtopApiResponse)(this.getNode(), response);
178
+ const { sessionId } = await import_GenericFunctions.createSession.call(this, body);
126
179
  if (saveProfileOnTermination) {
127
180
  await import_transport.apiRequest.call(
128
181
  this,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../nodes/Airtop/actions/session/create.operation.ts"],"sourcesContent":["import {\n\ttype IDataObject,\n\ttype IExecuteFunctions,\n\ttype INodeExecutionData,\n\ttype INodeProperties,\n} from 'n8n-workflow';\n\nimport { INTEGRATION_URL } from '../../constants';\nimport {\n\tvalidateAirtopApiResponse,\n\tvalidateProfileName,\n\tvalidateProxyUrl,\n\tvalidateSaveProfileOnTermination,\n\tvalidateTimeoutMinutes,\n} from '../../GenericFunctions';\nimport { apiRequest } from '../../transport';\nimport { profileNameField } from '../common/fields';\n\nexport const description: INodeProperties[] = [\n\t{\n\t\t...profileNameField,\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tresource: ['session'],\n\t\t\t\toperation: ['create'],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tdisplayName: 'Save Profile',\n\t\tname: 'saveProfileOnTermination',\n\t\ttype: 'boolean',\n\t\tdefault: false,\n\t\tdescription:\n\t\t\t'Whether to automatically save the <a href=\"https://docs.airtop.ai/guides/how-to/saving-a-profile\" target=\"_blank\">Airtop profile</a> for this session upon termination',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tresource: ['session'],\n\t\t\t\toperation: ['create'],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tdisplayName: 'Idle Timeout',\n\t\tname: 'timeoutMinutes',\n\t\ttype: 'number',\n\t\tdefault: 10,\n\t\tvalidateType: 'number',\n\t\tdescription: 'Minutes to wait before the session is terminated due to inactivity',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tresource: ['session'],\n\t\t\t\toperation: ['create'],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tdisplayName: 'Proxy',\n\t\tname: 'proxy',\n\t\ttype: 'options',\n\t\tdefault: 'none',\n\t\tdescription: 'Choose how to configure the proxy for this session',\n\t\toptions: [\n\t\t\t{\n\t\t\t\tname: 'None',\n\t\t\t\tvalue: 'none',\n\t\t\t\tdescription: 'No proxy will be used',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'Integrated',\n\t\t\t\tvalue: 'integrated',\n\t\t\t\tdescription: 'Use Airtop-provided proxy',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'Custom',\n\t\t\t\tvalue: 'custom',\n\t\t\t\tdescription: 'Configure a custom proxy',\n\t\t\t},\n\t\t],\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tresource: ['session'],\n\t\t\t\toperation: ['create'],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tdisplayName: 'Proxy URL',\n\t\tname: 'proxyUrl',\n\t\ttype: 'string',\n\t\tdefault: '',\n\t\tdescription: 'The URL of the proxy to use',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tproxy: ['custom'],\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 url = `${INTEGRATION_URL}/create-session`;\n\n\tconst profileName = validateProfileName.call(this, index);\n\tconst timeoutMinutes = validateTimeoutMinutes.call(this, index);\n\tconst saveProfileOnTermination = validateSaveProfileOnTermination.call(this, index, profileName);\n\tconst proxyParam = this.getNodeParameter('proxy', index, 'none') as string;\n\tconst proxyUrl = validateProxyUrl.call(this, index, proxyParam);\n\n\tconst body: IDataObject = {\n\t\tconfiguration: {\n\t\t\tprofileName,\n\t\t\ttimeoutMinutes,\n\t\t\tproxy: proxyParam === 'custom' ? proxyUrl : Boolean(proxyParam === 'integrated'),\n\t\t},\n\t};\n\n\tconst response = await apiRequest.call(this, 'POST', url, body);\n\tconst sessionId = response.sessionId;\n\n\t// validate response\n\tvalidateAirtopApiResponse(this.getNode(), response);\n\n\tif (saveProfileOnTermination) {\n\t\tawait apiRequest.call(\n\t\t\tthis,\n\t\t\t'PUT',\n\t\t\t`/sessions/${sessionId}/save-profile-on-termination/${profileName}`,\n\t\t);\n\t}\n\n\treturn this.helpers.returnJsonArray({ sessionId } as IDataObject);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA,uBAAgC;AAChC,8BAMO;AACP,uBAA2B;AAC3B,oBAAiC;AAE1B,MAAM,cAAiC;AAAA,EAC7C;AAAA,IACC,GAAG;AAAA,IACH,gBAAgB;AAAA,MACf,MAAM;AAAA,QACL,UAAU,CAAC,SAAS;AAAA,QACpB,WAAW,CAAC,QAAQ;AAAA,MACrB;AAAA,IACD;AAAA,EACD;AAAA,EACA;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,IACT,aACC;AAAA,IACD,gBAAgB;AAAA,MACf,MAAM;AAAA,QACL,UAAU,CAAC,SAAS;AAAA,QACpB,WAAW,CAAC,QAAQ;AAAA,MACrB;AAAA,IACD;AAAA,EACD;AAAA,EACA;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,IACT,cAAc;AAAA,IACd,aAAa;AAAA,IACb,gBAAgB;AAAA,MACf,MAAM;AAAA,QACL,UAAU,CAAC,SAAS;AAAA,QACpB,WAAW,CAAC,QAAQ;AAAA,MACrB;AAAA,IACD;AAAA,EACD;AAAA,EACA;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,IACT,aAAa;AAAA,IACb,SAAS;AAAA,MACR;AAAA,QACC,MAAM;AAAA,QACN,OAAO;AAAA,QACP,aAAa;AAAA,MACd;AAAA,MACA;AAAA,QACC,MAAM;AAAA,QACN,OAAO;AAAA,QACP,aAAa;AAAA,MACd;AAAA,MACA;AAAA,QACC,MAAM;AAAA,QACN,OAAO;AAAA,QACP,aAAa;AAAA,MACd;AAAA,IACD;AAAA,IACA,gBAAgB;AAAA,MACf,MAAM;AAAA,QACL,UAAU,CAAC,SAAS;AAAA,QACpB,WAAW,CAAC,QAAQ;AAAA,MACrB;AAAA,IACD;AAAA,EACD;AAAA,EACA;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,IACT,aAAa;AAAA,IACb,gBAAgB;AAAA,MACf,MAAM;AAAA,QACL,OAAO,CAAC,QAAQ;AAAA,MACjB;AAAA,IACD;AAAA,EACD;AACD;AAEA,eAAsB,QAErB,OACgC;AAChC,QAAM,MAAM,GAAG,gCAAe;AAE9B,QAAM,cAAc,4CAAoB,KAAK,MAAM,KAAK;AACxD,QAAM,iBAAiB,+CAAuB,KAAK,MAAM,KAAK;AAC9D,QAAM,2BAA2B,yDAAiC,KAAK,MAAM,OAAO,WAAW;AAC/F,QAAM,aAAa,KAAK,iBAAiB,SAAS,OAAO,MAAM;AAC/D,QAAM,WAAW,yCAAiB,KAAK,MAAM,OAAO,UAAU;AAE9D,QAAM,OAAoB;AAAA,IACzB,eAAe;AAAA,MACd;AAAA,MACA;AAAA,MACA,OAAO,eAAe,WAAW,WAAW,QAAQ,eAAe,YAAY;AAAA,IAChF;AAAA,EACD;AAEA,QAAM,WAAW,MAAM,4BAAW,KAAK,MAAM,QAAQ,KAAK,IAAI;AAC9D,QAAM,YAAY,SAAS;AAG3B,yDAA0B,KAAK,QAAQ,GAAG,QAAQ;AAElD,MAAI,0BAA0B;AAC7B,UAAM,4BAAW;AAAA,MAChB;AAAA,MACA;AAAA,MACA,aAAa,SAAS,gCAAgC,WAAW;AAAA,IAClE;AAAA,EACD;AAEA,SAAO,KAAK,QAAQ,gBAAgB,EAAE,UAAU,CAAgB;AACjE;","names":[]}
1
+ {"version":3,"sources":["../../../../../nodes/Airtop/actions/session/create.operation.ts"],"sourcesContent":["import {\n\ttype IDataObject,\n\ttype IExecuteFunctions,\n\ttype INodeExecutionData,\n\ttype INodeProperties,\n} from 'n8n-workflow';\n\nimport { COUNTRIES } from '../../countries';\nimport {\n\tcreateSession,\n\tvalidateProfileName,\n\tvalidateProxy,\n\tvalidateSaveProfileOnTermination,\n\tvalidateTimeoutMinutes,\n} from '../../GenericFunctions';\nimport { apiRequest } from '../../transport';\nimport { profileNameField } from '../common/fields';\n\nconst displayOptions = {\n\tshow: {\n\t\tresource: ['session'],\n\t\toperation: ['create'],\n\t},\n};\n\nconst countryOptions = COUNTRIES.map(({ name, value }) => ({ name, value }));\n\nexport const description: INodeProperties[] = [\n\t{\n\t\t...profileNameField,\n\t\tdisplayOptions,\n\t},\n\t{\n\t\tdisplayName: 'Save Profile',\n\t\tname: 'saveProfileOnTermination',\n\t\ttype: 'boolean',\n\t\tdefault: false,\n\t\tdescription:\n\t\t\t'Whether to automatically save the <a href=\"https://docs.airtop.ai/guides/how-to/saving-a-profile\" target=\"_blank\">Airtop profile</a> for this session upon termination',\n\t\tdisplayOptions,\n\t},\n\t{\n\t\tdisplayName: 'Idle Timeout',\n\t\tname: 'timeoutMinutes',\n\t\ttype: 'number',\n\t\tdefault: 10,\n\t\tvalidateType: 'number',\n\t\tdescription: 'Minutes to wait before the session is terminated due to inactivity',\n\t\tdisplayOptions,\n\t},\n\t/**\n\t * Proxy Configuration\n\t */\n\t{\n\t\tdisplayName: 'Proxy',\n\t\tname: 'proxy',\n\t\ttype: 'options',\n\t\tdefault: 'none',\n\t\tdescription: 'Choose how to configure the proxy for this session',\n\t\toptions: [\n\t\t\t{\n\t\t\t\tname: 'None',\n\t\t\t\tvalue: 'none',\n\t\t\t\tdescription: 'No proxy will be used',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'Integrated',\n\t\t\t\tvalue: 'integrated',\n\t\t\t\tdescription: 'Use Airtop-provided proxy',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'Proxy URL',\n\t\t\t\tvalue: 'proxyUrl',\n\t\t\t\tdescription: 'Use a proxy URL to configure the proxy',\n\t\t\t},\n\t\t],\n\t\tdisplayOptions,\n\t},\n\t{\n\t\tdisplayName: 'Proxy Configuration',\n\t\tname: 'proxyConfig',\n\t\ttype: 'collection',\n\t\tdefault: { country: 'US', sticky: true },\n\t\tdescription: 'The Airtop-provided configuration to use for the proxy',\n\t\tplaceholder: 'Add Attribute',\n\t\toptions: [\n\t\t\t{\n\t\t\t\tdisplayName: 'Country',\n\t\t\t\tname: 'country',\n\t\t\t\ttype: 'options',\n\t\t\t\tdefault: 'US',\n\t\t\t\tdescription:\n\t\t\t\t\t'The country to use for the proxy. Not all countries are guaranteed to provide a proxy. Learn more <a href=\"https://docs.airtop.ai/api-reference/airtop-api/sessions/create#request.body.configuration.proxy.Proxy.Airtop-Proxy-Configuration.country\" target=\"_blank\">here</a>.',\n\t\t\t\toptions: countryOptions,\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Keep Same IP',\n\t\t\t\tname: 'sticky',\n\t\t\t\ttype: 'boolean',\n\t\t\t\tdefault: true,\n\t\t\t\tdescription:\n\t\t\t\t\t'Whether to try to maintain the same IP address for the duration of the session. Airtop can guarantee that the same IP address will be available for up to a maximum of 30 minutes.',\n\t\t\t},\n\t\t],\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\t...displayOptions.show,\n\t\t\t\tproxy: ['integrated'],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tdisplayName: 'Proxy URL',\n\t\tname: 'proxyUrl',\n\t\ttype: 'string',\n\t\tdefault: '',\n\t\tdescription: 'The URL of the proxy to use',\n\t\tvalidateType: 'string',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\t...displayOptions.show,\n\t\t\t\tproxy: ['proxyUrl'],\n\t\t\t},\n\t\t},\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\toptions: [\n\t\t\t{\n\t\t\t\tdisplayName: 'Auto Solve Captchas',\n\t\t\t\tname: 'solveCaptcha',\n\t\t\t\ttype: 'boolean',\n\t\t\t\tdefault: false,\n\t\t\t\tdescription:\n\t\t\t\t\t'Whether to automatically solve <a href=\"https://docs.airtop.ai/guides/how-to/solving-captchas\" target=\"_blank\">captcha challenges</a>',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Extension IDs',\n\t\t\t\tname: 'extensionIds',\n\t\t\t\ttype: 'string',\n\t\t\t\tdefault: '',\n\t\t\t\tplaceholder: 'e.g. extId1, extId2, ...',\n\t\t\t\tdescription:\n\t\t\t\t\t'Comma-separated extension IDs from the Google Web Store to be loaded into the session. Learn more <a href=\"https://docs.airtop.ai/guides/how-to/using-chrome-extensions\" target=\"_blank\">here</a>.',\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 profileName = validateProfileName.call(this, index);\n\tconst timeoutMinutes = validateTimeoutMinutes.call(this, index);\n\tconst saveProfileOnTermination = validateSaveProfileOnTermination.call(this, index, profileName);\n\tconst { proxy } = validateProxy.call(this, index);\n\tconst solveCaptcha = this.getNodeParameter(\n\t\t'additionalFields.solveCaptcha',\n\t\tindex,\n\t\tfalse,\n\t) as boolean;\n\n\tconst extensions = this.getNodeParameter('additionalFields.extensionIds', index, '') as string;\n\tconst extensionIds = extensions ? extensions.split(',').map((id) => id.trim()) : [];\n\n\tconst body: IDataObject = {\n\t\tconfiguration: {\n\t\t\tprofileName,\n\t\t\ttimeoutMinutes,\n\t\t\tproxy,\n\t\t\tsolveCaptcha,\n\t\t\t...(extensionIds.length > 0 ? { extensionIds } : {}),\n\t\t},\n\t};\n\n\tconst { sessionId } = await createSession.call(this, body);\n\n\tif (saveProfileOnTermination) {\n\t\tawait apiRequest.call(\n\t\t\tthis,\n\t\t\t'PUT',\n\t\t\t`/sessions/${sessionId}/save-profile-on-termination/${profileName}`,\n\t\t);\n\t}\n\n\treturn this.helpers.returnJsonArray({ sessionId } as IDataObject);\n}\n"],"mappings":";;;;;;;;;;;;;;;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AiB,iCAAiC,OAAO,EAAE;AACnF,QAAM,eAAe,aAAa,WAAW,MAAM,GAAG,EAAE,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC;AAElF,QAAM,OAAoB;AAAA,IACzB,eAAe;AAAA,MACd;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,GAAI,aAAa,SAAS,IAAI,EAAE,aAAa,IAAI,CAAC;AAAA,IACnD;AAAA,EACD;AAEA,QAAM,EAAE,UAAU,IAAI,MAAM,sCAAc,KAAK,MAAM,IAAI;AAEzD,MAAI,0BAA0B;AAC7B,UAAM,4BAAW;AAAA,MAChB;AAAA,MACA;AAAA,MACA,aAAa,SAAS,gCAAgC,WAAW;AAAA,IAClE;AAAA,EACD;AAEA,SAAO,KAAK,QAAQ,gBAAgB,EAAE,UAAU,CAAgB;AACjE;","names":[]}
@@ -100,7 +100,8 @@ const description = [
100
100
  }
101
101
  },
102
102
  ...create.description,
103
- ...load.description
103
+ ...load.description,
104
+ ...takeScreenshot.description
104
105
  ];
105
106
  // Annotate the CommonJS export names for ESM import in node:
106
107
  0 && (module.exports = {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../nodes/Airtop/actions/window/Window.resource.ts"],"sourcesContent":["import type { INodeProperties } from 'n8n-workflow';\n\nimport * as close from './close.operation';\nimport * as create from './create.operation';\nimport * as load from './load.operation';\nimport * as takeScreenshot from './takeScreenshot.operation';\nimport { sessionIdField, windowIdField } from '../common/fields';\n\nexport { create, close, takeScreenshot, 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\ttypeOptions: {\n\t\t\tsortable: false,\n\t\t},\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tresource: ['window'],\n\t\t\t},\n\t\t},\n\t\toptions: [\n\t\t\t{\n\t\t\t\tname: 'Create a New Browser Window',\n\t\t\t\tvalue: 'create',\n\t\t\t\tdescription: 'Create a new browser window inside a session. Can load a URL when created.',\n\t\t\t\taction: 'Create a window',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'Load URL',\n\t\t\t\tvalue: 'load',\n\t\t\t\tdescription: 'Load a URL in an existing window',\n\t\t\t\taction: 'Load a page',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'Take Screenshot',\n\t\t\t\tvalue: 'takeScreenshot',\n\t\t\t\tdescription: 'Take a screenshot of the current window',\n\t\t\t\taction: 'Take screenshot',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'Close Window',\n\t\t\t\tvalue: 'close',\n\t\t\t\tdescription: 'Close a window inside a session',\n\t\t\t\taction: 'Close a window',\n\t\t\t},\n\t\t],\n\t\tdefault: 'create',\n\t},\n\t{\n\t\t...sessionIdField,\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tresource: ['window'],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\t...windowIdField,\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tresource: ['window'],\n\t\t\t\toperation: ['close', 'takeScreenshot', 'load'],\n\t\t\t},\n\t\t},\n\t},\n\t...create.description,\n\t...load.description,\n];\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,YAAuB;AACvB,aAAwB;AACxB,WAAsB;AACtB,qBAAgC;AAChC,oBAA8C;AAIvC,MAAM,cAAiC;AAAA,EAC7C;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,kBAAkB;AAAA,IAClB,aAAa;AAAA,MACZ,UAAU;AAAA,IACX;AAAA,IACA,gBAAgB;AAAA,MACf,MAAM;AAAA,QACL,UAAU,CAAC,QAAQ;AAAA,MACpB;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,IACD;AAAA,IACA,SAAS;AAAA,EACV;AAAA,EACA;AAAA,IACC,GAAG;AAAA,IACH,gBAAgB;AAAA,MACf,MAAM;AAAA,QACL,UAAU,CAAC,QAAQ;AAAA,MACpB;AAAA,IACD;AAAA,EACD;AAAA,EACA;AAAA,IACC,GAAG;AAAA,IACH,gBAAgB;AAAA,MACf,MAAM;AAAA,QACL,UAAU,CAAC,QAAQ;AAAA,QACnB,WAAW,CAAC,SAAS,kBAAkB,MAAM;AAAA,MAC9C;AAAA,IACD;AAAA,EACD;AAAA,EACA,GAAG,OAAO;AAAA,EACV,GAAG,KAAK;AACT;","names":[]}
1
+ {"version":3,"sources":["../../../../../nodes/Airtop/actions/window/Window.resource.ts"],"sourcesContent":["import type { INodeProperties } from 'n8n-workflow';\n\nimport * as close from './close.operation';\nimport * as create from './create.operation';\nimport * as load from './load.operation';\nimport * as takeScreenshot from './takeScreenshot.operation';\nimport { sessionIdField, windowIdField } from '../common/fields';\n\nexport { create, close, takeScreenshot, 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\ttypeOptions: {\n\t\t\tsortable: false,\n\t\t},\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tresource: ['window'],\n\t\t\t},\n\t\t},\n\t\toptions: [\n\t\t\t{\n\t\t\t\tname: 'Create a New Browser Window',\n\t\t\t\tvalue: 'create',\n\t\t\t\tdescription: 'Create a new browser window inside a session. Can load a URL when created.',\n\t\t\t\taction: 'Create a window',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'Load URL',\n\t\t\t\tvalue: 'load',\n\t\t\t\tdescription: 'Load a URL in an existing window',\n\t\t\t\taction: 'Load a page',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'Take Screenshot',\n\t\t\t\tvalue: 'takeScreenshot',\n\t\t\t\tdescription: 'Take a screenshot of the current window',\n\t\t\t\taction: 'Take screenshot',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'Close Window',\n\t\t\t\tvalue: 'close',\n\t\t\t\tdescription: 'Close a window inside a session',\n\t\t\t\taction: 'Close a window',\n\t\t\t},\n\t\t],\n\t\tdefault: 'create',\n\t},\n\t{\n\t\t...sessionIdField,\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tresource: ['window'],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\t...windowIdField,\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tresource: ['window'],\n\t\t\t\toperation: ['close', 'takeScreenshot', 'load'],\n\t\t\t},\n\t\t},\n\t},\n\t...create.description,\n\t...load.description,\n\t...takeScreenshot.description,\n];\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,YAAuB;AACvB,aAAwB;AACxB,WAAsB;AACtB,qBAAgC;AAChC,oBAA8C;AAIvC,MAAM,cAAiC;AAAA,EAC7C;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,kBAAkB;AAAA,IAClB,aAAa;AAAA,MACZ,UAAU;AAAA,IACX;AAAA,IACA,gBAAgB;AAAA,MACf,MAAM;AAAA,QACL,UAAU,CAAC,QAAQ;AAAA,MACpB;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,IACD;AAAA,IACA,SAAS;AAAA,EACV;AAAA,EACA;AAAA,IACC,GAAG;AAAA,IACH,gBAAgB;AAAA,MACf,MAAM;AAAA,QACL,UAAU,CAAC,QAAQ;AAAA,MACpB;AAAA,IACD;AAAA,EACD;AAAA,EACA;AAAA,IACC,GAAG;AAAA,IACH,gBAAgB;AAAA,MACf,MAAM;AAAA,QACL,UAAU,CAAC,QAAQ;AAAA,QACnB,WAAW,CAAC,SAAS,kBAAkB,MAAM;AAAA,MAC9C;AAAA,IACD;AAAA,EACD;AAAA,EACA,GAAG,OAAO;AAAA,EACV,GAAG,KAAK;AAAA,EACR,GAAG,eAAe;AACnB;","names":[]}
@@ -117,7 +117,7 @@ const description = [
117
117
  {
118
118
  name: "Load",
119
119
  value: "load",
120
- description: "Wait until the page dom and it's assets have loaded"
120
+ description: "Wait until the page dom and its assets have loaded"
121
121
  },
122
122
  {
123
123
  name: "DOM Content Loaded",
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../nodes/Airtop/actions/window/create.operation.ts"],"sourcesContent":["import type {\n\tIExecuteFunctions,\n\tINodeExecutionData,\n\tIDataObject,\n\tINodeProperties,\n} from 'n8n-workflow';\nimport { NodeApiError } from 'n8n-workflow';\n\nimport {\n\tvalidateAirtopApiResponse,\n\tvalidateSessionId,\n\tvalidateUrl,\n\tvalidateScreenResolution,\n} from '../../GenericFunctions';\nimport { apiRequest } from '../../transport';\nimport type { IAirtopResponse } from '../../transport/types';\nimport { urlField } from '../common/fields';\n\nexport const description: INodeProperties[] = [\n\t{\n\t\t...urlField,\n\t\tdescription: 'Initial URL to load in the window. Defaults to https://www.google.com.',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tresource: ['window'],\n\t\t\t\toperation: ['create'],\n\t\t\t},\n\t\t},\n\t},\n\t// Live View Options\n\t{\n\t\tdisplayName: 'Get Live View',\n\t\tname: 'getLiveView',\n\t\ttype: 'boolean',\n\t\tdefault: false,\n\t\tdescription:\n\t\t\t'Whether to get the URL of the window\\'s <a href=\"https://docs.airtop.ai/guides/how-to/creating-a-live-view\" target=\"_blank\">Live View</a>',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tresource: ['window'],\n\t\t\t\toperation: ['create'],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tdisplayName: 'Include Navigation Bar',\n\t\tname: 'includeNavigationBar',\n\t\ttype: 'boolean',\n\t\tdefault: false,\n\t\tdescription:\n\t\t\t'Whether to include the navigation bar in the Live View. When enabled, the navigation bar will be visible allowing you to navigate between pages.',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tresource: ['window'],\n\t\t\t\toperation: ['create'],\n\t\t\t\tgetLiveView: [true],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tdisplayName: 'Screen Resolution',\n\t\tname: 'screenResolution',\n\t\ttype: 'string',\n\t\tdefault: '',\n\t\tdescription:\n\t\t\t'The screen resolution of the Live View. Setting a resolution will force the window to open at that specific size.',\n\t\tplaceholder: 'e.g. 1280x720',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tresource: ['window'],\n\t\t\t\toperation: ['create'],\n\t\t\t\tgetLiveView: [true],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tdisplayName: 'Disable Resize',\n\t\tname: 'disableResize',\n\t\ttype: 'boolean',\n\t\tdefault: false,\n\t\tdescription: 'Whether to disable the window from being resized in the Live View',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tresource: ['window'],\n\t\t\t\toperation: ['create'],\n\t\t\t\tgetLiveView: [true],\n\t\t\t},\n\t\t},\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: ['window'],\n\t\t\t\toperation: ['create'],\n\t\t\t},\n\t\t},\n\t\toptions: [\n\t\t\t{\n\t\t\t\tdisplayName: 'Wait Until',\n\t\t\t\tname: 'waitUntil',\n\t\t\t\ttype: 'options',\n\t\t\t\tdescription: 'Wait until the specified loading event occurs',\n\t\t\t\tdefault: 'load',\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Load',\n\t\t\t\t\t\tvalue: 'load',\n\t\t\t\t\t\tdescription: \"Wait until the page dom and it's assets have loaded\",\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'DOM Content Loaded',\n\t\t\t\t\t\tvalue: 'domContentLoaded',\n\t\t\t\t\t\tdescription: 'Wait until the page DOM has loaded',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Complete',\n\t\t\t\t\t\tvalue: 'complete',\n\t\t\t\t\t\tdescription: 'Wait until all iframes in the page have loaded',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'No Wait',\n\t\t\t\t\t\tvalue: 'noWait',\n\t\t\t\t\t\tdescription: 'Do not wait for any loading event and it will return immediately',\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 sessionId = validateSessionId.call(this, index);\n\tconst url = validateUrl.call(this, index);\n\tconst additionalFields = this.getNodeParameter('additionalFields', index);\n\t// Live View Options\n\tconst getLiveView = this.getNodeParameter('getLiveView', index, false);\n\tconst includeNavigationBar = this.getNodeParameter('includeNavigationBar', index, false);\n\tconst screenResolution = validateScreenResolution.call(this, index);\n\tconst disableResize = this.getNodeParameter('disableResize', index, false);\n\n\tlet response: IAirtopResponse;\n\n\tconst body: IDataObject = {\n\t\turl,\n\t\t...additionalFields,\n\t};\n\n\tresponse = await apiRequest.call(this, 'POST', `/sessions/${sessionId}/windows`, body);\n\n\tif (!response?.data?.windowId) {\n\t\tthrow new NodeApiError(this.getNode(), {\n\t\t\tmessage: 'Failed to create window',\n\t\t\tcode: 500,\n\t\t});\n\t}\n\n\tconst windowId = String(response.data.windowId);\n\n\tif (getLiveView) {\n\t\t// Get Window info\n\t\tresponse = await apiRequest.call(\n\t\t\tthis,\n\t\t\t'GET',\n\t\t\t`/sessions/${sessionId}/windows/${windowId}`,\n\t\t\tundefined,\n\t\t\t{\n\t\t\t\t...(includeNavigationBar && { includeNavigationBar: true }),\n\t\t\t\t...(screenResolution && { screenResolution }),\n\t\t\t\t...(disableResize && { disableResize: true }),\n\t\t\t},\n\t\t);\n\t}\n\n\t// validate response\n\tvalidateAirtopApiResponse(this.getNode(), response);\n\n\treturn this.helpers.returnJsonArray({ sessionId, windowId, ...response });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA,0BAA6B;AAE7B,8BAKO;AACP,uBAA2B;AAE3B,oBAAyB;AAElB,MAAM,cAAiC;AAAA,EAC7C;AAAA,IACC,GAAG;AAAA,IACH,aAAa;AAAA,IACb,gBAAgB;AAAA,MACf,MAAM;AAAA,QACL,UAAU,CAAC,QAAQ;AAAA,QACnB,WAAW,CAAC,QAAQ;AAAA,MACrB;AAAA,IACD;AAAA,EACD;AAAA;AAAA,EAEA;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,IACT,aACC;AAAA,IACD,gBAAgB;AAAA,MACf,MAAM;AA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B,EAAE,iBAAiB;AAAA,QAC3C,GAAI,iBAAiB,EAAE,eAAe,KAAK;AAAA,MAC5C;AAAA,IACD;AAAA,EACD;AAGA,yDAA0B,KAAK,QAAQ,GAAG,QAAQ;AAElD,SAAO,KAAK,QAAQ,gBAAgB,EAAE,WAAW,UAAU,GAAG,SAAS,CAAC;AACzE;","names":[]}
1
+ {"version":3,"sources":["../../../../../nodes/Airtop/actions/window/create.operation.ts"],"sourcesContent":["import type {\n\tIExecuteFunctions,\n\tINodeExecutionData,\n\tIDataObject,\n\tINodeProperties,\n} from 'n8n-workflow';\nimport { NodeApiError } from 'n8n-workflow';\n\nimport {\n\tvalidateAirtopApiResponse,\n\tvalidateSessionId,\n\tvalidateUrl,\n\tvalidateScreenResolution,\n} from '../../GenericFunctions';\nimport { apiRequest } from '../../transport';\nimport type { IAirtopResponse } from '../../transport/types';\nimport { urlField } from '../common/fields';\n\nexport const description: INodeProperties[] = [\n\t{\n\t\t...urlField,\n\t\tdescription: 'Initial URL to load in the window. Defaults to https://www.google.com.',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tresource: ['window'],\n\t\t\t\toperation: ['create'],\n\t\t\t},\n\t\t},\n\t},\n\t// Live View Options\n\t{\n\t\tdisplayName: 'Get Live View',\n\t\tname: 'getLiveView',\n\t\ttype: 'boolean',\n\t\tdefault: false,\n\t\tdescription:\n\t\t\t'Whether to get the URL of the window\\'s <a href=\"https://docs.airtop.ai/guides/how-to/creating-a-live-view\" target=\"_blank\">Live View</a>',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tresource: ['window'],\n\t\t\t\toperation: ['create'],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tdisplayName: 'Include Navigation Bar',\n\t\tname: 'includeNavigationBar',\n\t\ttype: 'boolean',\n\t\tdefault: false,\n\t\tdescription:\n\t\t\t'Whether to include the navigation bar in the Live View. When enabled, the navigation bar will be visible allowing you to navigate between pages.',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tresource: ['window'],\n\t\t\t\toperation: ['create'],\n\t\t\t\tgetLiveView: [true],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tdisplayName: 'Screen Resolution',\n\t\tname: 'screenResolution',\n\t\ttype: 'string',\n\t\tdefault: '',\n\t\tdescription:\n\t\t\t'The screen resolution of the Live View. Setting a resolution will force the window to open at that specific size.',\n\t\tplaceholder: 'e.g. 1280x720',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tresource: ['window'],\n\t\t\t\toperation: ['create'],\n\t\t\t\tgetLiveView: [true],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tdisplayName: 'Disable Resize',\n\t\tname: 'disableResize',\n\t\ttype: 'boolean',\n\t\tdefault: false,\n\t\tdescription: 'Whether to disable the window from being resized in the Live View',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tresource: ['window'],\n\t\t\t\toperation: ['create'],\n\t\t\t\tgetLiveView: [true],\n\t\t\t},\n\t\t},\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: ['window'],\n\t\t\t\toperation: ['create'],\n\t\t\t},\n\t\t},\n\t\toptions: [\n\t\t\t{\n\t\t\t\tdisplayName: 'Wait Until',\n\t\t\t\tname: 'waitUntil',\n\t\t\t\ttype: 'options',\n\t\t\t\tdescription: 'Wait until the specified loading event occurs',\n\t\t\t\tdefault: 'load',\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Load',\n\t\t\t\t\t\tvalue: 'load',\n\t\t\t\t\t\tdescription: 'Wait until the page dom and its assets have loaded',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'DOM Content Loaded',\n\t\t\t\t\t\tvalue: 'domContentLoaded',\n\t\t\t\t\t\tdescription: 'Wait until the page DOM has loaded',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Complete',\n\t\t\t\t\t\tvalue: 'complete',\n\t\t\t\t\t\tdescription: 'Wait until all iframes in the page have loaded',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'No Wait',\n\t\t\t\t\t\tvalue: 'noWait',\n\t\t\t\t\t\tdescription: 'Do not wait for any loading event and it will return immediately',\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 sessionId = validateSessionId.call(this, index);\n\tconst url = validateUrl.call(this, index);\n\tconst additionalFields = this.getNodeParameter('additionalFields', index);\n\t// Live View Options\n\tconst getLiveView = this.getNodeParameter('getLiveView', index, false);\n\tconst includeNavigationBar = this.getNodeParameter('includeNavigationBar', index, false);\n\tconst screenResolution = validateScreenResolution.call(this, index);\n\tconst disableResize = this.getNodeParameter('disableResize', index, false);\n\n\tlet response: IAirtopResponse;\n\n\tconst body: IDataObject = {\n\t\turl,\n\t\t...additionalFields,\n\t};\n\n\tresponse = await apiRequest.call(this, 'POST', `/sessions/${sessionId}/windows`, body);\n\n\tif (!response?.data?.windowId) {\n\t\tthrow new NodeApiError(this.getNode(), {\n\t\t\tmessage: 'Failed to create window',\n\t\t\tcode: 500,\n\t\t});\n\t}\n\n\tconst windowId = String(response.data.windowId);\n\n\tif (getLiveView) {\n\t\t// Get Window info\n\t\tresponse = await apiRequest.call(\n\t\t\tthis,\n\t\t\t'GET',\n\t\t\t`/sessions/${sessionId}/windows/${windowId}`,\n\t\t\tundefined,\n\t\t\t{\n\t\t\t\t...(includeNavigationBar && { includeNavigationBar: true }),\n\t\t\t\t...(screenResolution && { screenResolution }),\n\t\t\t\t...(disableResize && { disableResize: true }),\n\t\t\t},\n\t\t);\n\t}\n\n\t// validate response\n\tvalidateAirtopApiResponse(this.getNode(), response);\n\n\treturn this.helpers.returnJsonArray({ sessionId, windowId, ...response });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA,0BAA6B;AAE7B,8BAKO;AACP,uBAA2B;AAE3B,oBAAyB;AAElB,MAAM,cAAiC;AAAA,EAC7C;AAAA,IACC,GAAG;AAAA,IACH,aAAa;AAAA,IACb,gBAAgB;AAAA,MACf,MAAM;AAAA,QACL,UAAU,CAAC,QAAQ;AAAA,QACnB,WAAW,CAAC,QAAQ;AAAA,MACrB;AAAA,IACD;AAAA,EACD;AAAA;AAAA,EAEA;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,IACT,aACC;AAAA,IACD,gBAAgB;AAAA,MACf,MAAM;AAAA,QACL,UAAU,CAAC,QAAQ;AAAA,QACnB,WAAW,CAAC,QAAQ;AAAA,MACrB;AAAA,IACD;AAAA,EACD;AAAA,EACA;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,IACT,aACC;AAAA,IACD,gBAAgB;AAAA,MACf,MAAM;AAAA,QACL,UAAU,CAAC,QAAQ;AAAA,QACnB,WAAW,CAAC,QAAQ;AAAA,QACpB,aAAa,CAAC,IAAI;AAAA,MACnB;AAAA,IACD;AAAA,EACD;AAAA,EACA;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,IACT,aACC;AAAA,IACD,aAAa;AAAA,IACb,gBAAgB;AAAA,MACf,MAAM;AAAA,QACL,UAAU,CAAC,QAAQ;AAAA,QACnB,WAAW,CAAC,QAAQ;AAAA,QACpB,aAAa,CAAC,IAAI;AAAA,MACnB;AAAA,IACD;AAAA,EACD;AAAA,EACA;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SA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,KAAK;AAEzE,MAAI;AAEJ,QAAM,OAAoB;AAAA,IACzB;AAAA,IACA,GAAG;AAAA,EACJ;AAEA,aAAW,MAAM,4BAAW,KAAK,MAAM,QAAQ,aAAa,SAAS,YAAY,IAAI;AAErF,MAAI,CAAC,UAAU,MAAM,UAAU;AAC9B,UAAM,IAAI,iCAAa,KAAK,QAAQ,GAAG;AAAA,MACtC,SAAS;AAAA,MACT,MAAM;AAAA,IACP,CAAC;AAAA,EACF;AAEA,QAAM,WAAW,OAAO,SAAS,KAAK,QAAQ;AAE9C,MAAI,aAAa;AAEhB,eAAW,MAAM,4BAAW;AAAA,MAC3B;AAAA,MACA;AAAA,MACA,aAAa,SAAS,YAAY,QAAQ;AAAA,MAC1C;AAAA,MACA;AAAA,QACC,GAAI,wBAAwB,EAAE,sBAAsB,KAAK;AAAA,QACzD,GAAI,oBAAoB,EAAE,iBAAiB;AAAA,QAC3C,GAAI,iBAAiB,EAAE,eAAe,KAAK;AAAA,MAC5C;AAAA,IACD;AAAA,EACD;AAGA,yDAA0B,KAAK,QAAQ,GAAG,QAAQ;AAElD,SAAO,KAAK,QAAQ,gBAAgB,EAAE,WAAW,UAAU,GAAG,SAAS,CAAC;AACzE;","names":[]}
@@ -18,14 +18,32 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
  var takeScreenshot_operation_exports = {};
20
20
  __export(takeScreenshot_operation_exports, {
21
+ description: () => description,
21
22
  execute: () => execute
22
23
  });
23
24
  module.exports = __toCommonJS(takeScreenshot_operation_exports);
24
25
  var import_GenericFunctions = require("../../GenericFunctions");
25
26
  var import_transport = require("../../transport");
27
+ const description = [
28
+ {
29
+ displayName: "Output Binary Image",
30
+ description: "Whether to output the image as a binary file instead of a base64 encoded string",
31
+ name: "outputImageAsBinary",
32
+ type: "boolean",
33
+ default: false,
34
+ displayOptions: {
35
+ show: {
36
+ resource: ["window"],
37
+ operation: ["takeScreenshot"]
38
+ }
39
+ }
40
+ }
41
+ ];
26
42
  async function execute(index) {
27
43
  const { sessionId, windowId } = import_GenericFunctions.validateSessionAndWindowId.call(this, index);
44
+ const outputImageAsBinary = this.getNodeParameter("outputImageAsBinary", index, false);
28
45
  let data;
46
+ let image = "";
29
47
  const response = await import_transport.apiRequest.call(
30
48
  this,
31
49
  "POST",
@@ -33,15 +51,19 @@ async function execute(index) {
33
51
  );
34
52
  (0, import_GenericFunctions.validateAirtopApiResponse)(this.getNode(), response);
35
53
  if (response.meta?.screenshots?.length) {
36
- const buffer = (0, import_GenericFunctions.convertScreenshotToBinary)(response.meta.screenshots[0]);
37
- data = await this.helpers.prepareBinaryData(buffer, "screenshot.jpg", "image/jpeg");
54
+ if (outputImageAsBinary) {
55
+ const buffer = (0, import_GenericFunctions.convertScreenshotToBinary)(response.meta.screenshots[0]);
56
+ data = await this.helpers.prepareBinaryData(buffer, "screenshot.jpg", "image/jpeg");
57
+ } else {
58
+ image = response?.meta?.screenshots?.[0].dataUrl;
59
+ }
38
60
  }
39
61
  return [
40
62
  {
41
63
  json: {
42
64
  sessionId,
43
65
  windowId,
44
- ...response
66
+ image
45
67
  },
46
68
  ...data ? { binary: { data } } : {}
47
69
  }
@@ -49,6 +71,7 @@ async function execute(index) {
49
71
  }
50
72
  // Annotate the CommonJS export names for ESM import in node:
51
73
  0 && (module.exports = {
74
+ description,
52
75
  execute
53
76
  });
54
77
  //# sourceMappingURL=takeScreenshot.operation.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../nodes/Airtop/actions/window/takeScreenshot.operation.ts"],"sourcesContent":["import type { IExecuteFunctions, INodeExecutionData, IBinaryData } from 'n8n-workflow';\n\nimport {\n\tvalidateSessionAndWindowId,\n\tvalidateAirtopApiResponse,\n\tconvertScreenshotToBinary,\n} from '../../GenericFunctions';\nimport { apiRequest } from '../../transport';\n\nexport async function execute(\n\tthis: IExecuteFunctions,\n\tindex: number,\n): Promise<INodeExecutionData[]> {\n\tconst { sessionId, windowId } = validateSessionAndWindowId.call(this, index);\n\tlet data: IBinaryData | undefined; // for storing the binary data\n\tconst response = await apiRequest.call(\n\t\tthis,\n\t\t'POST',\n\t\t`/sessions/${sessionId}/windows/${windowId}/screenshot`,\n\t);\n\n\t// validate response\n\tvalidateAirtopApiResponse(this.getNode(), response);\n\n\t// process screenshot on success\n\tif (response.meta?.screenshots?.length) {\n\t\tconst buffer = convertScreenshotToBinary(response.meta.screenshots[0]);\n\t\tdata = await this.helpers.prepareBinaryData(buffer, 'screenshot.jpg', 'image/jpeg');\n\t}\n\n\treturn [\n\t\t{\n\t\t\tjson: {\n\t\t\t\tsessionId,\n\t\t\t\twindowId,\n\t\t\t\t...response,\n\t\t\t},\n\t\t\t...(data ? { binary: { data } } : {}),\n\t\t},\n\t];\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,8BAIO;AACP,uBAA2B;AAE3B,eAAsB,QAErB,OACgC;AAChC,QAAM,EAAE,WAAW,SAAS,IAAI,mDAA2B,KAAK,MAAM,KAAK;AAC3E,MAAI;AACJ,QAAM,WAAW,MAAM,4BAAW;AAAA,IACjC;AAAA,IACA;AAAA,IACA,aAAa,SAAS,YAAY,QAAQ;AAAA,EAC3C;AAGA,yDAA0B,KAAK,QAAQ,GAAG,QAAQ;AAGlD,MAAI,SAAS,MAAM,aAAa,QAAQ;AACvC,UAAM,aAAS,mDAA0B,SAAS,KAAK,YAAY,CAAC,CAAC;AACrE,WAAO,MAAM,KAAK,QAAQ,kBAAkB,QAAQ,kBAAkB,YAAY;AAAA,EACnF;AAEA,SAAO;AAAA,IACN;AAAA,MACC,MAAM;AAAA,QACL;AAAA,QACA;AAAA,QACA,GAAG;AAAA,MACJ;AAAA,MACA,GAAI,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,CAAC;AAAA,IACpC;AAAA,EACD;AACD;","names":[]}
1
+ {"version":3,"sources":["../../../../../nodes/Airtop/actions/window/takeScreenshot.operation.ts"],"sourcesContent":["import type {\n\tIExecuteFunctions,\n\tINodeExecutionData,\n\tIBinaryData,\n\tINodeProperties,\n} from 'n8n-workflow';\n\nimport {\n\tvalidateSessionAndWindowId,\n\tvalidateAirtopApiResponse,\n\tconvertScreenshotToBinary,\n} from '../../GenericFunctions';\nimport { apiRequest } from '../../transport';\n\nexport const description: INodeProperties[] = [\n\t{\n\t\tdisplayName: 'Output Binary Image',\n\t\tdescription: 'Whether to output the image as a binary file instead of a base64 encoded string',\n\t\tname: 'outputImageAsBinary',\n\t\ttype: 'boolean',\n\t\tdefault: false,\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tresource: ['window'],\n\t\t\t\toperation: ['takeScreenshot'],\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 { sessionId, windowId } = validateSessionAndWindowId.call(this, index);\n\tconst outputImageAsBinary = this.getNodeParameter('outputImageAsBinary', index, false) as boolean;\n\n\tlet data: IBinaryData | undefined; // for storing the binary data\n\tlet image = ''; // for storing the base64 encoded image\n\n\tconst response = await apiRequest.call(\n\t\tthis,\n\t\t'POST',\n\t\t`/sessions/${sessionId}/windows/${windowId}/screenshot`,\n\t);\n\n\t// validate response\n\tvalidateAirtopApiResponse(this.getNode(), response);\n\n\t// process screenshot on success\n\tif (response.meta?.screenshots?.length) {\n\t\tif (outputImageAsBinary) {\n\t\t\tconst buffer = convertScreenshotToBinary(response.meta.screenshots[0]);\n\t\t\tdata = await this.helpers.prepareBinaryData(buffer, 'screenshot.jpg', 'image/jpeg');\n\t\t} else {\n\t\t\timage = response?.meta?.screenshots?.[0].dataUrl;\n\t\t}\n\t}\n\n\treturn [\n\t\t{\n\t\t\tjson: {\n\t\t\t\tsessionId,\n\t\t\t\twindowId,\n\t\t\t\timage,\n\t\t\t},\n\t\t\t...(data ? { binary: { data } } : {}),\n\t\t},\n\t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
25
  MAX_TIMEOUT_MINUTES: () => MAX_TIMEOUT_MINUTES,
26
- MIN_TIMEOUT_MINUTES: () => MIN_TIMEOUT_MINUTES
26
+ MIN_TIMEOUT_MINUTES: () => MIN_TIMEOUT_MINUTES,
27
+ N8N_VERSION: () => N8N_VERSION,
28
+ OPERATION_TIMEOUT: () => OPERATION_TIMEOUT,
29
+ SESSION_STATUS: () => SESSION_STATUS,
30
+ getN8NVersion: () => getN8NVersion
27
31
  });
28
32
  module.exports = __toCommonJS(constants_exports);
29
- const BASE_URL = "https://api.airtop.ai/api/v1";
30
- const INTEGRATION_URL = "https://portal-api.airtop.ai/integrations/v1/no-code";
33
+ var import_fs = require("fs");
34
+ var import_n8n_workflow = require("n8n-workflow");
35
+ var import_path = require("path");
36
+ const getN8NVersion = () => {
37
+ if (process.env.N8N_VERSION) {
38
+ return process.env.N8N_VERSION;
39
+ }
40
+ try {
41
+ const PACKAGE_DIR = (0, import_path.resolve)(__dirname, "../../../");
42
+ const packageJsonPath = (0, import_path.join)(PACKAGE_DIR, "package.json");
43
+ const n8nPackageJson = (0, import_n8n_workflow.jsonParse)((0, import_fs.readFileSync)(packageJsonPath, "utf8"));
44
+ return n8nPackageJson.version;
45
+ } catch (error) {
46
+ return "0.0.0";
47
+ }
48
+ };
49
+ const N8N_VERSION = getN8NVersion();
50
+ const BASE_URL = process.env.AIRTOP_BASE_URL ?? "https://api.airtop.ai/api/v1";
51
+ const INTEGRATION_URL = process.env.AIRTOP_INTEGRATION_URL ?? "https://portal-api.airtop.ai/integrations/v1/no-code";
31
52
  const DEFAULT_TIMEOUT_MINUTES = 10;
32
53
  const MIN_TIMEOUT_MINUTES = 1;
33
54
  const MAX_TIMEOUT_MINUTES = 10080;
55
+ const SESSION_STATUS = {
56
+ INITIALIZING: "initializing",
57
+ RUNNING: "running"
58
+ };
59
+ const OPERATION_TIMEOUT = 5 * 60 * 1e3;
34
60
  const ERROR_MESSAGES = {
35
61
  SESSION_ID_REQUIRED: "Please fill the 'Session ID' parameter",
36
62
  WINDOW_ID_REQUIRED: "Please fill the 'Window ID' parameter",
37
63
  URL_REQUIRED: "Please fill the 'URL' parameter",
38
64
  PROFILE_NAME_INVALID: "'Profile Name' should only contain letters, numbers and dashes",
39
65
  TIMEOUT_MINUTES_INVALID: `Timeout must be between ${MIN_TIMEOUT_MINUTES} and ${MAX_TIMEOUT_MINUTES} minutes`,
66
+ TIMEOUT_REACHED: "Timeout reached while waiting for the operation to complete",
40
67
  URL_INVALID: "'URL' must start with 'http' or 'https'",
41
68
  PROFILE_NAME_REQUIRED: "'Profile Name' is required when 'Save Profile' is enabled",
42
69
  REQUIRED_PARAMETER: "Please fill the '{{field}}' parameter",
43
70
  PROXY_URL_REQUIRED: "Please fill the 'Proxy URL' parameter",
44
71
  PROXY_URL_INVALID: "'Proxy URL' must start with 'http' or 'https'",
45
- SCREEN_RESOLUTION_INVALID: "'Screen Resolution' must be in the format 'width x height' (e.g. '1280x720')"
72
+ SCREEN_RESOLUTION_INVALID: "'Screen Resolution' must be in the format 'width x height' (e.g. '1280x720')",
73
+ SCROLL_BY_AMOUNT_INVALID: "'Scroll By' amount must be a number and either a percentage or pixels (e.g. '100px' or '100%')",
74
+ SCROLL_MODE_INVALID: "Please fill any of the 'Scroll To Edge' or 'Scroll By' parameters"
46
75
  };
47
76
  // Annotate the CommonJS export names for ESM import in node:
48
77
  0 && (module.exports = {
@@ -51,6 +80,10 @@ const ERROR_MESSAGES = {
51
80
  ERROR_MESSAGES,
52
81
  INTEGRATION_URL,
53
82
  MAX_TIMEOUT_MINUTES,
54
- MIN_TIMEOUT_MINUTES
83
+ MIN_TIMEOUT_MINUTES,
84
+ N8N_VERSION,
85
+ OPERATION_TIMEOUT,
86
+ SESSION_STATUS,
87
+ getN8NVersion
55
88
  });
56
89
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../nodes/Airtop/constants.ts"],"sourcesContent":["export const BASE_URL = 'https://api.airtop.ai/api/v1';\nexport const INTEGRATION_URL = 'https://portal-api.airtop.ai/integrations/v1/no-code';\n\nexport const DEFAULT_TIMEOUT_MINUTES = 10;\nexport const MIN_TIMEOUT_MINUTES = 1;\nexport const MAX_TIMEOUT_MINUTES = 10080;\n\nexport const ERROR_MESSAGES = {\n\tSESSION_ID_REQUIRED: \"Please fill the 'Session ID' parameter\",\n\tWINDOW_ID_REQUIRED: \"Please fill the 'Window ID' parameter\",\n\tURL_REQUIRED: \"Please fill the 'URL' parameter\",\n\tPROFILE_NAME_INVALID: \"'Profile Name' should only contain letters, numbers and dashes\",\n\tTIMEOUT_MINUTES_INVALID: `Timeout must be between ${MIN_TIMEOUT_MINUTES} and ${MAX_TIMEOUT_MINUTES} minutes`,\n\tURL_INVALID: \"'URL' must start with 'http' or 'https'\",\n\tPROFILE_NAME_REQUIRED: \"'Profile Name' is required when 'Save Profile' is enabled\",\n\tREQUIRED_PARAMETER: \"Please fill the '{{field}}' parameter\",\n\tPROXY_URL_REQUIRED: \"Please fill the 'Proxy URL' parameter\",\n\tPROXY_URL_INVALID: \"'Proxy URL' must start with 'http' or 'https'\",\n\tSCREEN_RESOLUTION_INVALID:\n\t\t\"'Screen Resolution' must be in the format 'width x height' (e.g. '1280x720')\",\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,MAAM,WAAW;AACjB,MAAM,kBAAkB;AAExB,MAAM,0BAA0B;AAChC,MAAM,sBAAsB;AAC5B,MAAM,sBAAsB;AAE5B,MAAM,iBAAiB;AAAA,EAC7B,qBAAqB;AAAA,EACrB,oBAAoB;AAAA,EACpB,cAAc;AAAA,EACd,sBAAsB;AAAA,EACtB,yBAAyB,2BAA2B,mBAAmB,QAAQ,mBAAmB;AAAA,EAClG,aAAa;AAAA,EACb,uBAAuB;AAAA,EACvB,oBAAoB;AAAA,EACpB,oBAAoB;AAAA,EACpB,mBAAmB;AAAA,EACnB,2BACC;AACF;","names":[]}
1
+ {"version":3,"sources":["../../../nodes/Airtop/constants.ts"],"sourcesContent":["import { readFileSync } from 'fs';\nimport type { n8n } from 'n8n-core';\nimport { jsonParse } from 'n8n-workflow';\nimport { join, resolve } from 'path';\n\n// Helper function to get n8n version that can be mocked in tests\nexport const getN8NVersion = (): string => {\n\tif (process.env.N8N_VERSION) {\n\t\treturn process.env.N8N_VERSION;\n\t}\n\n\ttry {\n\t\tconst PACKAGE_DIR = resolve(__dirname, '../../../');\n\t\tconst packageJsonPath = join(PACKAGE_DIR, 'package.json');\n\t\tconst n8nPackageJson = jsonParse<n8n.PackageJson>(readFileSync(packageJsonPath, 'utf8'));\n\t\treturn n8nPackageJson.version;\n\t} catch (error) {\n\t\t// Fallback version\n\t\treturn '0.0.0';\n\t}\n};\n\nexport const N8N_VERSION = getN8NVersion();\n\nexport const BASE_URL = process.env.AIRTOP_BASE_URL ?? 'https://api.airtop.ai/api/v1';\nexport const INTEGRATION_URL =\n\tprocess.env.AIRTOP_INTEGRATION_URL ?? 'https://portal-api.airtop.ai/integrations/v1/no-code';\n\n// Session operations\nexport const DEFAULT_TIMEOUT_MINUTES = 10;\nexport const MIN_TIMEOUT_MINUTES = 1;\nexport const MAX_TIMEOUT_MINUTES = 10080;\nexport const SESSION_STATUS = {\n\tINITIALIZING: 'initializing',\n\tRUNNING: 'running',\n} as const;\n\n// Operations\nexport const OPERATION_TIMEOUT = 5 * 60 * 1000; // 5 mins\n\n// Scroll operation\nexport type TScrollingMode = 'manual' | 'automatic';\n\n// Error messages\nexport const ERROR_MESSAGES = {\n\tSESSION_ID_REQUIRED: \"Please fill the 'Session ID' parameter\",\n\tWINDOW_ID_REQUIRED: \"Please fill the 'Window ID' parameter\",\n\tURL_REQUIRED: \"Please fill the 'URL' parameter\",\n\tPROFILE_NAME_INVALID: \"'Profile Name' should only contain letters, numbers and dashes\",\n\tTIMEOUT_MINUTES_INVALID: `Timeout must be between ${MIN_TIMEOUT_MINUTES} and ${MAX_TIMEOUT_MINUTES} minutes`,\n\tTIMEOUT_REACHED: 'Timeout reached while waiting for the operation to complete',\n\tURL_INVALID: \"'URL' must start with 'http' or 'https'\",\n\tPROFILE_NAME_REQUIRED: \"'Profile Name' is required when 'Save Profile' is enabled\",\n\tREQUIRED_PARAMETER: \"Please fill the '{{field}}' parameter\",\n\tPROXY_URL_REQUIRED: \"Please fill the 'Proxy URL' parameter\",\n\tPROXY_URL_INVALID: \"'Proxy URL' must start with 'http' or 'https'\",\n\tSCREEN_RESOLUTION_INVALID:\n\t\t\"'Screen Resolution' must be in the format 'width x height' (e.g. '1280x720')\",\n\tSCROLL_BY_AMOUNT_INVALID:\n\t\t\"'Scroll By' amount must be a number and either a percentage or pixels (e.g. '100px' or '100%')\",\n\tSCROLL_MODE_INVALID: \"Please fill any of the 'Scroll To Edge' or 'Scroll By' parameters\",\n} as const;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAA6B;AAE7B,0BAA0B;AAC1B,kBAA8B;AAGvB,MAAM,gBAAgB,MAAc;AAC1C,MAAI,QAAQ,IAAI,aAAa;AAC5B,WAAO,QAAQ,IAAI;AAAA,EACpB;AAEA,MAAI;AACH,UAAM,kBAAc,qBAAQ,WAAW,WAAW;AAClD,UAAM,sBAAkB,kBAAK,aAAa,cAAc;AACxD,UAAM,qBAAiB,mCAA2B,wBAAa,iBAAiB,MAAM,CAAC;AACvF,WAAO,eAAe;AAAA,EACvB,SAAS,OAAO;AAEf,WAAO;AAAA,EACR;AACD;AAEO,MAAM,cAAc,cAAc;AAElC,MAAM,WAAW,QAAQ,IAAI,mBAAmB;AAChD,MAAM,kBACZ,QAAQ,IAAI,0BAA0B;AAGhC,MAAM,0BAA0B;AAChC,MAAM,sBAAsB;AAC5B,MAAM,sBAAsB;AAC5B,MAAM,iBAAiB;AAAA,EAC7B,cAAc;AAAA,EACd,SAAS;AACV;AAGO,MAAM,oBAAoB,IAAI,KAAK;AAMnC,MAAM,iBAAiB;AAAA,EAC7B,qBAAqB;AAAA,EACrB,oBAAoB;AAAA,EACpB,cAAc;AAAA,EACd,sBAAsB;AAAA,EACtB,yBAAyB,2BAA2B,mBAAmB,QAAQ,mBAAmB;AAAA,EAClG,iBAAiB;AAAA,EACjB,aAAa;AAAA,EACb,uBAAuB;AAAA,EACvB,oBAAoB;AAAA,EACpB,oBAAoB;AAAA,EACpB,mBAAmB;AAAA,EACnB,2BACC;AAAA,EACD,0BACC;AAAA,EACD,qBAAqB;AACtB;","names":[]}