n8n-nodes-base 1.93.1 → 1.94.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) 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 +9 -0
  6. package/dist/credentials/MicrosoftSharePointOAuth2Api.credentials.js.map +1 -1
  7. package/dist/credentials/icons/microsoftSharePoint.svg +59 -0
  8. package/dist/known/nodes.json +0 -4
  9. package/dist/nodes/Airtop/Airtop.node.js +14 -8
  10. package/dist/nodes/Airtop/Airtop.node.js.map +1 -1
  11. package/dist/nodes/Airtop/GenericFunctions.js +87 -15
  12. package/dist/nodes/Airtop/GenericFunctions.js.map +1 -1
  13. package/dist/nodes/Airtop/actions/common/fields.js +9 -0
  14. package/dist/nodes/Airtop/actions/common/fields.js.map +1 -1
  15. package/dist/nodes/Airtop/actions/common/output.utils.js +79 -0
  16. package/dist/nodes/Airtop/actions/common/output.utils.js.map +1 -0
  17. package/dist/nodes/Airtop/actions/common/session.utils.js +2 -2
  18. package/dist/nodes/Airtop/actions/common/session.utils.js.map +1 -1
  19. package/dist/nodes/Airtop/actions/extraction/getPaginated.operation.js +13 -4
  20. package/dist/nodes/Airtop/actions/extraction/getPaginated.operation.js.map +1 -1
  21. package/dist/nodes/Airtop/actions/extraction/query.operation.js +21 -3
  22. package/dist/nodes/Airtop/actions/extraction/query.operation.js.map +1 -1
  23. package/dist/nodes/Airtop/actions/extraction/scrape.operation.js +2 -1
  24. package/dist/nodes/Airtop/actions/extraction/scrape.operation.js.map +1 -1
  25. package/dist/nodes/Airtop/actions/file/File.resource.js +104 -0
  26. package/dist/nodes/Airtop/actions/file/File.resource.js.map +1 -0
  27. package/dist/nodes/Airtop/actions/file/delete.operation.js +60 -0
  28. package/dist/nodes/Airtop/actions/file/delete.operation.js.map +1 -0
  29. package/dist/nodes/Airtop/actions/file/get.operation.js +91 -0
  30. package/dist/nodes/Airtop/actions/file/get.operation.js.map +1 -0
  31. package/dist/nodes/Airtop/actions/file/getMany.operation.js +100 -0
  32. package/dist/nodes/Airtop/actions/file/getMany.operation.js.map +1 -0
  33. package/dist/nodes/Airtop/actions/file/helpers.js +199 -0
  34. package/dist/nodes/Airtop/actions/file/helpers.js.map +1 -0
  35. package/dist/nodes/Airtop/actions/file/load.operation.js +85 -0
  36. package/dist/nodes/Airtop/actions/file/load.operation.js.map +1 -0
  37. package/dist/nodes/Airtop/actions/file/upload.operation.js +186 -0
  38. package/dist/nodes/Airtop/actions/file/upload.operation.js.map +1 -0
  39. package/dist/nodes/Airtop/actions/interaction/Interaction.resource.js +22 -1
  40. package/dist/nodes/Airtop/actions/interaction/Interaction.resource.js.map +1 -1
  41. package/dist/nodes/Airtop/actions/interaction/fill.operation.js +89 -0
  42. package/dist/nodes/Airtop/actions/interaction/fill.operation.js.map +1 -0
  43. package/dist/nodes/Airtop/actions/interaction/scroll.operation.js +219 -0
  44. package/dist/nodes/Airtop/actions/interaction/scroll.operation.js.map +1 -0
  45. package/dist/nodes/Airtop/actions/node.type.js.map +1 -1
  46. package/dist/nodes/Airtop/actions/router.js +13 -4
  47. package/dist/nodes/Airtop/actions/router.js.map +1 -1
  48. package/dist/nodes/Airtop/actions/session/create.operation.js +85 -32
  49. package/dist/nodes/Airtop/actions/session/create.operation.js.map +1 -1
  50. package/dist/nodes/Airtop/actions/window/Window.resource.js +2 -1
  51. package/dist/nodes/Airtop/actions/window/Window.resource.js.map +1 -1
  52. package/dist/nodes/Airtop/actions/window/create.operation.js +1 -1
  53. package/dist/nodes/Airtop/actions/window/create.operation.js.map +1 -1
  54. package/dist/nodes/Airtop/actions/window/takeScreenshot.operation.js +26 -3
  55. package/dist/nodes/Airtop/actions/window/takeScreenshot.operation.js.map +1 -1
  56. package/dist/nodes/Airtop/constants.js +38 -5
  57. package/dist/nodes/Airtop/constants.js.map +1 -1
  58. package/dist/nodes/Airtop/countries.js +1026 -0
  59. package/dist/nodes/Airtop/countries.js.map +1 -0
  60. package/dist/nodes/Airtop/transport/index.js +6 -3
  61. package/dist/nodes/Airtop/transport/index.js.map +1 -1
  62. package/dist/nodes/Airtop/transport/types.js.map +1 -1
  63. package/dist/nodes/Google/Drive/v2/actions/file/upload.operation.js +4 -1
  64. package/dist/nodes/Google/Drive/v2/actions/file/upload.operation.js.map +1 -1
  65. package/dist/nodes/Google/Firebase/CloudFirestore/GenericFunctions.js +1 -2
  66. package/dist/nodes/Google/Firebase/CloudFirestore/GenericFunctions.js.map +1 -1
  67. package/dist/nodes/HttpRequest/GenericFunctions.js +1 -1
  68. package/dist/nodes/HttpRequest/GenericFunctions.js.map +1 -1
  69. package/dist/nodes/Merge/Merge.node.js +3 -2
  70. package/dist/nodes/Merge/Merge.node.js.map +1 -1
  71. package/dist/nodes/Merge/v3/actions/mode/combineBySql.js +42 -4
  72. package/dist/nodes/Merge/v3/actions/mode/combineBySql.js.map +1 -1
  73. package/dist/nodes/Merge/v3/actions/versionDescription.js +1 -1
  74. package/dist/nodes/Merge/v3/actions/versionDescription.js.map +1 -1
  75. package/dist/nodes/Microsoft/SharePoint/descriptions/file/update.operation.js +2 -2
  76. package/dist/nodes/Microsoft/SharePoint/descriptions/file/update.operation.js.map +1 -1
  77. package/dist/nodes/Microsoft/SharePoint/descriptions/file/upload.operation.js +2 -2
  78. package/dist/nodes/Microsoft/SharePoint/descriptions/file/upload.operation.js.map +1 -1
  79. package/dist/nodes/Microsoft/SharePoint/descriptions/item/Item.resource.js +1 -1
  80. package/dist/nodes/Microsoft/SharePoint/descriptions/item/Item.resource.js.map +1 -1
  81. package/dist/nodes/Microsoft/SharePoint/descriptions/list/List.resource.js +1 -1
  82. package/dist/nodes/Microsoft/SharePoint/descriptions/list/List.resource.js.map +1 -1
  83. package/dist/nodes/MongoDb/GenericFunctions.js +9 -2
  84. package/dist/nodes/MongoDb/GenericFunctions.js.map +1 -1
  85. package/dist/nodes/MongoDb/MongoDb.node.js +25 -5
  86. package/dist/nodes/MongoDb/MongoDb.node.js.map +1 -1
  87. package/dist/nodes/Telegram/Telegram.node.js +5 -1
  88. package/dist/nodes/Telegram/Telegram.node.js.map +1 -1
  89. package/dist/nodes/Transform/Summarize/utils.js +2 -1
  90. package/dist/nodes/Transform/Summarize/utils.js.map +1 -1
  91. package/dist/test/setup.js +1 -0
  92. package/dist/test/setup.js.map +1 -1
  93. package/dist/types/credentials.json +2 -2
  94. package/dist/types/nodes.json +8 -9
  95. package/package.json +4 -5
  96. package/dist/nodes/EvaluationMetrics/EvaluationMetrics.node.js +0 -119
  97. package/dist/nodes/EvaluationMetrics/EvaluationMetrics.node.js.map +0 -1
  98. package/dist/nodes/EvaluationMetrics/EvaluationMetrics.node.json +0 -14
@@ -0,0 +1,199 @@
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 helpers_exports = {};
20
+ __export(helpers_exports, {
21
+ createAndUploadFile: () => createAndUploadFile,
22
+ createFileBuffer: () => createFileBuffer,
23
+ pollFileUntilAvailable: () => pollFileUntilAvailable,
24
+ pushFileToSession: () => pushFileToSession,
25
+ requestAllFiles: () => requestAllFiles,
26
+ triggerFileInput: () => triggerFileInput,
27
+ waitForFileInSession: () => waitForFileInSession
28
+ });
29
+ module.exports = __toCommonJS(helpers_exports);
30
+ var import_n8n_workflow = require("n8n-workflow");
31
+ var import_constants = require("../../constants");
32
+ var import_transport = require("../../transport");
33
+ async function requestAllFiles(sessionIds) {
34
+ const endpoint = "/files";
35
+ let hasMore = true;
36
+ let currentOffset = 0;
37
+ const limit = 100;
38
+ const files = [];
39
+ let responseData;
40
+ while (hasMore) {
41
+ responseData = await import_transport.apiRequest.call(
42
+ this,
43
+ "GET",
44
+ endpoint,
45
+ {},
46
+ { offset: currentOffset, limit, sessionIds }
47
+ );
48
+ if (responseData.data?.files && Array.isArray(responseData.data?.files)) {
49
+ files.push(...responseData.data.files);
50
+ }
51
+ hasMore = Boolean(responseData.data?.pagination?.hasMore);
52
+ currentOffset += limit;
53
+ }
54
+ return {
55
+ data: {
56
+ files,
57
+ pagination: {
58
+ hasMore
59
+ }
60
+ }
61
+ };
62
+ }
63
+ async function pollFileUntilAvailable(fileId, timeout = import_constants.OPERATION_TIMEOUT, intervalSeconds = 1) {
64
+ let fileStatus = "";
65
+ const startTime = Date.now();
66
+ while (fileStatus !== "available") {
67
+ const elapsedTime = Date.now() - startTime;
68
+ if (elapsedTime >= timeout) {
69
+ throw new import_n8n_workflow.NodeApiError(this.getNode(), {
70
+ message: import_constants.ERROR_MESSAGES.TIMEOUT_REACHED,
71
+ code: 500
72
+ });
73
+ }
74
+ const response = await import_transport.apiRequest.call(this, "GET", `/files/${fileId}`);
75
+ fileStatus = response.data?.status;
76
+ await new Promise((resolve) => setTimeout(resolve, intervalSeconds * 1e3));
77
+ }
78
+ return fileId;
79
+ }
80
+ async function createAndUploadFile(fileName, fileBuffer, fileType, pollingFunction = pollFileUntilAvailable) {
81
+ const createResponse = await import_transport.apiRequest.call(this, "POST", "/files", { fileName, fileType });
82
+ const fileId = createResponse.data?.id;
83
+ const uploadUrl = createResponse.data?.uploadUrl;
84
+ if (!fileId || !uploadUrl) {
85
+ throw new import_n8n_workflow.NodeApiError(this.getNode(), {
86
+ message: "Failed to create file entry: missing file ID or upload URL",
87
+ code: 500
88
+ });
89
+ }
90
+ await this.helpers.httpRequest({
91
+ method: "PUT",
92
+ url: uploadUrl,
93
+ body: fileBuffer,
94
+ headers: {
95
+ "Content-Type": "application/octet-stream"
96
+ }
97
+ });
98
+ return await pollingFunction.call(this, fileId);
99
+ }
100
+ function parseEvent(eventText) {
101
+ const dataLine = eventText.split("\n").find((line) => line.startsWith("data:"));
102
+ if (!dataLine) {
103
+ return null;
104
+ }
105
+ const jsonStr = dataLine.replace("data: ", "").trim();
106
+ return (0, import_n8n_workflow.jsonParse)(jsonStr, {
107
+ errorMessage: "Failed to parse server event"
108
+ });
109
+ }
110
+ function isFileAvailable(event, fileId) {
111
+ return event.event === "file_upload_status" && event.fileId === fileId && event.status === "available";
112
+ }
113
+ async function waitForFileInSession(sessionId, fileId, timeout = import_constants.OPERATION_TIMEOUT) {
114
+ const url = `${import_constants.BASE_URL}/sessions/${sessionId}/events?all=true`;
115
+ const fileReadyPromise = new Promise(async (resolve, reject) => {
116
+ const stream = await this.helpers.httpRequestWithAuthentication.call(this, "airtopApi", {
117
+ method: "GET",
118
+ url,
119
+ encoding: "stream"
120
+ });
121
+ const close = () => {
122
+ resolve();
123
+ stream.removeAllListeners();
124
+ };
125
+ const onError = (errorMessage) => {
126
+ const error = new import_n8n_workflow.NodeApiError(this.getNode(), {
127
+ message: errorMessage,
128
+ description: "Failed to upload file",
129
+ code: 500
130
+ });
131
+ reject(error);
132
+ stream.removeAllListeners();
133
+ };
134
+ stream.on("data", (data) => {
135
+ const event = parseEvent(data.toString());
136
+ if (!event) {
137
+ return;
138
+ }
139
+ if (event?.eventData?.error) {
140
+ onError(event.eventData.error);
141
+ return;
142
+ }
143
+ if (isFileAvailable(event, fileId)) {
144
+ close();
145
+ }
146
+ });
147
+ });
148
+ const timeoutPromise = new Promise((_resolve, reject) => {
149
+ setTimeout(
150
+ () => reject(
151
+ new import_n8n_workflow.NodeApiError(this.getNode(), {
152
+ message: import_constants.ERROR_MESSAGES.TIMEOUT_REACHED,
153
+ code: 500
154
+ })
155
+ ),
156
+ timeout
157
+ );
158
+ });
159
+ await Promise.race([fileReadyPromise, timeoutPromise]);
160
+ }
161
+ async function pushFileToSession(fileId, sessionId, pollingFunction = waitForFileInSession) {
162
+ await import_transport.apiRequest.call(this, "POST", `/files/${fileId}/push`, { sessionIds: [sessionId] });
163
+ await pollingFunction.call(this, sessionId, fileId);
164
+ }
165
+ async function triggerFileInput(fileId, windowId, sessionId, elementDescription = "") {
166
+ await import_transport.apiRequest.call(this, "POST", `/sessions/${sessionId}/windows/${windowId}/file-input`, {
167
+ fileId,
168
+ ...elementDescription ? { elementDescription } : {}
169
+ });
170
+ }
171
+ async function createFileBuffer(source, value, itemIndex) {
172
+ if (source === "url") {
173
+ const buffer = await this.helpers.httpRequest({
174
+ url: value,
175
+ json: false,
176
+ encoding: "arraybuffer"
177
+ });
178
+ return buffer;
179
+ }
180
+ if (source === "binary") {
181
+ const binaryData = await this.helpers.getBinaryDataBuffer(itemIndex, value);
182
+ return binaryData;
183
+ }
184
+ throw new import_n8n_workflow.NodeApiError(this.getNode(), {
185
+ message: `Unsupported source type: ${source}. Please use 'url' or 'binary'`,
186
+ code: 500
187
+ });
188
+ }
189
+ // Annotate the CommonJS export names for ESM import in node:
190
+ 0 && (module.exports = {
191
+ createAndUploadFile,
192
+ createFileBuffer,
193
+ pollFileUntilAvailable,
194
+ pushFileToSession,
195
+ requestAllFiles,
196
+ triggerFileInput,
197
+ waitForFileInSession
198
+ });
199
+ //# sourceMappingURL=helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../nodes/Airtop/actions/file/helpers.ts"],"sourcesContent":["import type { IExecuteFunctions } from 'n8n-workflow';\nimport { jsonParse, NodeApiError } from 'n8n-workflow';\nimport type { Stream } from 'stream';\n\nimport { BASE_URL, ERROR_MESSAGES, OPERATION_TIMEOUT } from '../../constants';\nimport { apiRequest } from '../../transport';\nimport type { IAirtopResponseWithFiles, IAirtopServerEvent } from '../../transport/types';\n\n/**\n * Fetches all files from the Airtop API using pagination\n * @param this - The execution context providing access to n8n functionality\n * @param sessionIds - Comma-separated string of session IDs to filter files by\n * @returns Promise resolving to a response object containing the complete array of files\n */\nexport async function requestAllFiles(\n\tthis: IExecuteFunctions,\n\tsessionIds: string,\n): Promise<IAirtopResponseWithFiles> {\n\tconst endpoint = '/files';\n\tlet hasMore = true;\n\tlet currentOffset = 0;\n\tconst limit = 100;\n\tconst files: IAirtopResponseWithFiles['data']['files'] = [];\n\tlet responseData: IAirtopResponseWithFiles;\n\n\twhile (hasMore) {\n\t\t// request files\n\t\tresponseData = (await apiRequest.call(\n\t\t\tthis,\n\t\t\t'GET',\n\t\t\tendpoint,\n\t\t\t{},\n\t\t\t{ offset: currentOffset, limit, sessionIds },\n\t\t)) as IAirtopResponseWithFiles;\n\t\t// add files to the array\n\t\tif (responseData.data?.files && Array.isArray(responseData.data?.files)) {\n\t\t\tfiles.push(...responseData.data.files);\n\t\t}\n\t\t// check if there are more files\n\t\thasMore = Boolean(responseData.data?.pagination?.hasMore);\n\t\tcurrentOffset += limit;\n\t}\n\n\treturn {\n\t\tdata: {\n\t\t\tfiles,\n\t\t\tpagination: {\n\t\t\t\thasMore,\n\t\t\t},\n\t\t},\n\t};\n}\n\n/**\n * Polls the Airtop API until a file reaches \"available\" status or times out\n * @param this - The execution context providing access to n8n functionality\n * @param fileId - The unique identifier of the file to poll\n * @param timeout - Maximum time in milliseconds to wait before failing (defaults to OPERATION_TIMEOUT)\n * @param intervalSeconds - Time in seconds to wait between polling attempts (defaults to 1)\n * @returns Promise resolving to the file ID when the file is available\n * @throws NodeApiError if the operation times out or API request fails\n */\nexport async function pollFileUntilAvailable(\n\tthis: IExecuteFunctions,\n\tfileId: string,\n\ttimeout = OPERATION_TIMEOUT,\n\tintervalSeconds = 1,\n): Promise<string> {\n\tlet fileStatus = '';\n\tconst startTime = Date.now();\n\n\twhile (fileStatus !== 'available') {\n\t\tconst elapsedTime = Date.now() - startTime;\n\t\tif (elapsedTime >= timeout) {\n\t\t\tthrow new NodeApiError(this.getNode(), {\n\t\t\t\tmessage: ERROR_MESSAGES.TIMEOUT_REACHED,\n\t\t\t\tcode: 500,\n\t\t\t});\n\t\t}\n\n\t\tconst response = await apiRequest.call(this, 'GET', `/files/${fileId}`);\n\t\tfileStatus = response.data?.status as string;\n\n\t\t// Wait before the next polling attempt\n\t\tawait new Promise((resolve) => setTimeout(resolve, intervalSeconds * 1000));\n\t}\n\n\treturn fileId;\n}\n\n/**\n * Creates a file entry in Airtop, uploads the file content, and waits until processing completes\n * @param this - The execution context providing access to n8n functionality\n * @param fileName - Name to assign to the uploaded file\n * @param fileBuffer - Buffer containing the binary file data to upload\n * @param fileType - Classification of the file in Airtop (e.g., 'customer_upload')\n * @param pollingFunction - Function to use for checking file availability (defaults to pollFileUntilAvailable)\n * @returns Promise resolving to the file ID once upload is complete and file is available\n * @throws NodeApiError if file creation, upload, or polling fails\n */\nexport async function createAndUploadFile(\n\tthis: IExecuteFunctions,\n\tfileName: string,\n\tfileBuffer: Buffer,\n\tfileType: string,\n\tpollingFunction = pollFileUntilAvailable,\n): Promise<string> {\n\t// Create file entry\n\tconst createResponse = await apiRequest.call(this, 'POST', '/files', { fileName, fileType });\n\n\tconst fileId = createResponse.data?.id;\n\tconst uploadUrl = createResponse.data?.uploadUrl as string;\n\n\tif (!fileId || !uploadUrl) {\n\t\tthrow new NodeApiError(this.getNode(), {\n\t\t\tmessage: 'Failed to create file entry: missing file ID or upload URL',\n\t\t\tcode: 500,\n\t\t});\n\t}\n\n\t// Upload the file\n\tawait this.helpers.httpRequest({\n\t\tmethod: 'PUT',\n\t\turl: uploadUrl,\n\t\tbody: fileBuffer,\n\t\theaders: {\n\t\t\t'Content-Type': 'application/octet-stream',\n\t\t},\n\t});\n\n\t// Poll until the file is available\n\treturn await pollingFunction.call(this, fileId as string);\n}\n\nfunction parseEvent(eventText: string): IAirtopServerEvent | null {\n\tconst dataLine = eventText.split('\\n').find((line) => line.startsWith('data:'));\n\tif (!dataLine) {\n\t\treturn null;\n\t}\n\tconst jsonStr = dataLine.replace('data: ', '').trim();\n\treturn jsonParse<IAirtopServerEvent>(jsonStr, {\n\t\terrorMessage: 'Failed to parse server event',\n\t});\n}\n\nfunction isFileAvailable(event: IAirtopServerEvent, fileId: string): boolean {\n\treturn (\n\t\tevent.event === 'file_upload_status' && event.fileId === fileId && event.status === 'available'\n\t);\n}\n\n/**\n * Waits for a file to be ready in a session by monitoring session events\n * @param this - The execution context providing access to n8n functionality\n * @param sessionId - ID of the session to monitor for file events\n * @param timeout - Maximum time in milliseconds to wait before failing (defaults to OPERATION_TIMEOUT)\n * @returns Promise that resolves when a file in the session becomes available\n * @throws NodeApiError if the timeout is reached before a file becomes available\n */\nexport async function waitForFileInSession(\n\tthis: IExecuteFunctions,\n\tsessionId: string,\n\tfileId: string,\n\ttimeout = OPERATION_TIMEOUT,\n): Promise<void> {\n\tconst url = `${BASE_URL}/sessions/${sessionId}/events?all=true`;\n\n\tconst fileReadyPromise = new Promise<void>(async (resolve, reject) => {\n\t\tconst stream = (await this.helpers.httpRequestWithAuthentication.call(this, 'airtopApi', {\n\t\t\tmethod: 'GET',\n\t\t\turl,\n\t\t\tencoding: 'stream',\n\t\t})) as Stream;\n\n\t\tconst close = () => {\n\t\t\tresolve();\n\t\t\tstream.removeAllListeners();\n\t\t};\n\n\t\tconst onError = (errorMessage: string) => {\n\t\t\tconst error = new NodeApiError(this.getNode(), {\n\t\t\t\tmessage: errorMessage,\n\t\t\t\tdescription: 'Failed to upload file',\n\t\t\t\tcode: 500,\n\t\t\t});\n\t\t\treject(error);\n\t\t\tstream.removeAllListeners();\n\t\t};\n\n\t\tstream.on('data', (data: Uint8Array) => {\n\t\t\tconst event = parseEvent(data.toString());\n\t\t\tif (!event) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// handle error\n\t\t\tif (event?.eventData?.error) {\n\t\t\t\tonError(event.eventData.error);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// handle file available\n\t\t\tif (isFileAvailable(event, fileId)) {\n\t\t\t\tclose();\n\t\t\t}\n\t\t});\n\t});\n\n\tconst timeoutPromise = new Promise<void>((_resolve, reject) => {\n\t\tsetTimeout(\n\t\t\t() =>\n\t\t\t\treject(\n\t\t\t\t\tnew NodeApiError(this.getNode(), {\n\t\t\t\t\t\tmessage: ERROR_MESSAGES.TIMEOUT_REACHED,\n\t\t\t\t\t\tcode: 500,\n\t\t\t\t\t}),\n\t\t\t\t),\n\t\t\ttimeout,\n\t\t);\n\t});\n\n\tawait Promise.race([fileReadyPromise, timeoutPromise]);\n}\n\n/**\n * Associates a file with a session and waits until the file is ready for use\n * @param this - The execution context providing access to n8n functionality\n * @param fileId - ID of the file to associate with the session\n * @param sessionId - ID of the session to add the file to\n * @param pollingFunction - Function to use for checking file availability in session (defaults to waitForFileInSession)\n * @returns Promise that resolves when the file is ready for use in the session\n */\nexport async function pushFileToSession(\n\tthis: IExecuteFunctions,\n\tfileId: string,\n\tsessionId: string,\n\tpollingFunction = waitForFileInSession,\n): Promise<void> {\n\t// Push file into session\n\tawait apiRequest.call(this, 'POST', `/files/${fileId}/push`, { sessionIds: [sessionId] });\n\tawait pollingFunction.call(this, sessionId, fileId);\n}\n\n/**\n * Activates a file upload input in a specific window within a session\n * @param this - The execution context providing access to n8n functionality\n * @param fileId - ID of the file to use for the input\n * @param windowId - ID of the window where the file input will be triggered\n * @param sessionId - ID of the session containing the window\n * @returns Promise that resolves when the file input has been triggered\n */\nexport async function triggerFileInput(\n\tthis: IExecuteFunctions,\n\tfileId: string,\n\twindowId: string,\n\tsessionId: string,\n\telementDescription = '',\n): Promise<void> {\n\tawait apiRequest.call(this, 'POST', `/sessions/${sessionId}/windows/${windowId}/file-input`, {\n\t\tfileId,\n\t\t...(elementDescription ? { elementDescription } : {}),\n\t});\n}\n\n/**\n * Creates a file Buffer from either a URL or binary data\n * This function supports two source types:\n * - URL: Downloads the file from the specified URL and returns it as a Buffer\n * - Binary: Retrieves binary data from the workflow's binary data storage\n *\n * @param this - The execution context providing access to n8n functionality\n * @param source - Source type, either 'url' or 'binary'\n * @param value - Either a URL string or binary data property name depending on source type\n * @param itemIndex - Index of the workflow item to get binary data from (when source is 'binary')\n * @returns Promise resolving to a Buffer containing the file data\n * @throws NodeApiError if the source type is unsupported or retrieval fails\n */\nexport async function createFileBuffer(\n\tthis: IExecuteFunctions,\n\tsource: string,\n\tvalue: string,\n\titemIndex: number,\n): Promise<Buffer> {\n\tif (source === 'url') {\n\t\tconst buffer = (await this.helpers.httpRequest({\n\t\t\turl: value,\n\t\t\tjson: false,\n\t\t\tencoding: 'arraybuffer',\n\t\t})) as Buffer;\n\n\t\treturn buffer;\n\t}\n\n\tif (source === 'binary') {\n\t\tconst binaryData = await this.helpers.getBinaryDataBuffer(itemIndex, value);\n\t\treturn binaryData;\n\t}\n\n\tthrow new NodeApiError(this.getNode(), {\n\t\tmessage: `Unsupported source type: ${source}. Please use 'url' or 'binary'`,\n\t\tcode: 500,\n\t});\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,0BAAwC;AAGxC,uBAA4D;AAC5D,uBAA2B;AAS3B,eAAsB,gBAErB,YACoC;AACpC,QAAM,WAAW;AACjB,MAAI,UAAU;AACd,MAAI,gBAAgB;AACpB,QAAM,QAAQ;AACd,QAAM,QAAmD,CAAC;AAC1D,MAAI;AAEJ,SAAO,SAAS;AAEf,mBAAgB,MAAM,4BAAW;AAAA,MAChC;AAAA,MACA;AAAA,MACA;AAAA,MACA,CAAC;AAAA,MACD,EAAE,QAAQ,eAAe,OAAO,WAAW;AAAA,IAC5C;AAEA,QAAI,aAAa,MAAM,SA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nPropDesc = 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 load_operation_exports = {};
20
+ __export(load_operation_exports, {
21
+ description: () => description,
22
+ execute: () => execute
23
+ });
24
+ module.exports = __toCommonJS(load_operation_exports);
25
+ var import_n8n_workflow = require("n8n-workflow");
26
+ var import_helpers = require("./helpers");
27
+ var import_fields = require("../common/fields");
28
+ const displayOptions = {
29
+ show: {
30
+ resource: ["file"],
31
+ operation: ["load"]
32
+ }
33
+ };
34
+ const description = [
35
+ {
36
+ ...import_fields.sessionIdField,
37
+ description: "The session ID to load the file into",
38
+ displayOptions
39
+ },
40
+ {
41
+ ...import_fields.windowIdField,
42
+ description: "The window ID to trigger the file input in",
43
+ displayOptions
44
+ },
45
+ {
46
+ displayName: "File ID",
47
+ name: "fileId",
48
+ type: "string",
49
+ default: "",
50
+ required: true,
51
+ description: "ID of the file to load into the session",
52
+ displayOptions
53
+ },
54
+ {
55
+ ...import_fields.elementDescriptionField,
56
+ description: "Optional description of the file input to interact with",
57
+ placeholder: "e.g. the file upload selection box",
58
+ displayOptions
59
+ }
60
+ ];
61
+ async function execute(index) {
62
+ const fileId = this.getNodeParameter("fileId", index, "");
63
+ const sessionId = this.getNodeParameter("sessionId", index, "");
64
+ const windowId = this.getNodeParameter("windowId", index, "");
65
+ const elementDescription = this.getNodeParameter("elementDescription", index, "");
66
+ try {
67
+ await import_helpers.pushFileToSession.call(this, fileId, sessionId);
68
+ await import_helpers.triggerFileInput.call(this, fileId, windowId, sessionId, elementDescription);
69
+ return this.helpers.returnJsonArray({
70
+ sessionId,
71
+ windowId,
72
+ data: {
73
+ message: "File loaded successfully"
74
+ }
75
+ });
76
+ } catch (error) {
77
+ throw new import_n8n_workflow.NodeOperationError(this.getNode(), error);
78
+ }
79
+ }
80
+ // Annotate the CommonJS export names for ESM import in node:
81
+ 0 && (module.exports = {
82
+ description,
83
+ execute
84
+ });
85
+ //# sourceMappingURL=load.operation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../nodes/Airtop/actions/file/load.operation.ts"],"sourcesContent":["import type { IExecuteFunctions, INodeExecutionData, INodeProperties } from 'n8n-workflow';\nimport { NodeOperationError } from 'n8n-workflow';\n\nimport { pushFileToSession, triggerFileInput } from './helpers';\nimport { sessionIdField, windowIdField, elementDescriptionField } from '../common/fields';\n\nconst displayOptions = {\n\tshow: {\n\t\tresource: ['file'],\n\t\toperation: ['load'],\n\t},\n};\n\nexport const description: INodeProperties[] = [\n\t{\n\t\t...sessionIdField,\n\t\tdescription: 'The session ID to load the file into',\n\t\tdisplayOptions,\n\t},\n\t{\n\t\t...windowIdField,\n\t\tdescription: 'The window ID to trigger the file input in',\n\t\tdisplayOptions,\n\t},\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 load into the session',\n\t\tdisplayOptions,\n\t},\n\t{\n\t\t...elementDescriptionField,\n\t\tdescription: 'Optional description of the file input to interact with',\n\t\tplaceholder: 'e.g. the file upload selection box',\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 sessionId = this.getNodeParameter('sessionId', index, '') as string;\n\tconst windowId = this.getNodeParameter('windowId', index, '') as string;\n\tconst elementDescription = this.getNodeParameter('elementDescription', index, '') as string;\n\n\ttry {\n\t\tawait pushFileToSession.call(this, fileId, sessionId);\n\t\tawait triggerFileInput.call(this, fileId, windowId, sessionId, elementDescription);\n\n\t\treturn this.helpers.returnJsonArray({\n\t\t\tsessionId,\n\t\t\twindowId,\n\t\t\tdata: {\n\t\t\t\tmessage: 'File loaded successfully',\n\t\t\t},\n\t\t});\n\t} catch (error) {\n\t\tthrow new NodeOperationError(this.getNode(), error as Error);\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,0BAAmC;AAEnC,qBAAoD;AACpD,oBAAuE;AAEvE,MAAM,iBAAiB;AAAA,EACtB,MAAM;AAAA,IACL,UAAU,CAAC,MAAM;AAAA,IACjB,WAAW,CAAC,MAAM;AAAA,EACnB;AACD;AAEO,MAAM,cAAiC;AAAA,EAC7C;AAAA,IACC,GAAG;AAAA,IACH,aAAa;AAAA,IACb;AAAA,EACD;AAAA,EACA;AAAA,IACC,GAAG;AAAA,IACH,aAAa;AAAA,IACb;AAAA,EACD;AAAA,EACA;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,GAAG;AAAA,IACH,aAAa;AAAA,IACb,aAAa;AAAA,IACb;AAAA,EACD;AACD;AAEA,eAAsB,QAErB,OACgC;AAChC,QAAM,SAAS,KAAK,iBAAiB,UAAU,OAAO,EAAE;AACxD,QAAM,YAAY,KAAK,iBAAiB,aAAa,OAAO,EAAE;AAC9D,QAAM,WAAW,KAAK,iBAAiB,YAAY,OAAO,EAAE;AAC5D,QAAM,qBAAqB,KAAK,iBAAiB,sBAAsB,OAAO,EAAE;AAEhF,MAAI;AACH,UAAM,iCAAkB,KAAK,MAAM,QAAQ,SAAS;AACpD,UAAM,gCAAiB,KAAK,MAAM,QAAQ,UAAU,WAAW,kBAAkB;AAEjF,WAAO,KAAK,QAAQ,gBAAgB;AAAA,MACnC;AAAA,MACA;AAAA,MACA,MAAM;AAAA,QACL,SAAS;AAAA,MACV;AAAA,IACD,CAAC;AAAA,EACF,SAAS,OAAO;AACf,UAAM,IAAI,uCAAmB,KAAK,QAAQ,GAAG,KAAc;AAAA,EAC5D;AACD;","names":[]}
@@ -0,0 +1,186 @@
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 upload_operation_exports = {};
20
+ __export(upload_operation_exports, {
21
+ description: () => description,
22
+ execute: () => execute
23
+ });
24
+ module.exports = __toCommonJS(upload_operation_exports);
25
+ var import_n8n_workflow = require("n8n-workflow");
26
+ var import_helpers = require("./helpers");
27
+ var import_GenericFunctions = require("../../GenericFunctions");
28
+ var import_fields = require("../common/fields");
29
+ const displayOptions = {
30
+ show: {
31
+ resource: ["file"],
32
+ operation: ["upload"]
33
+ }
34
+ };
35
+ const description = [
36
+ {
37
+ ...import_fields.sessionIdField,
38
+ description: "The session ID to load the file into",
39
+ displayOptions
40
+ },
41
+ {
42
+ ...import_fields.windowIdField,
43
+ description: "The window ID to trigger the file input in",
44
+ displayOptions
45
+ },
46
+ {
47
+ displayName: "File Name",
48
+ name: "fileName",
49
+ type: "string",
50
+ default: "",
51
+ required: true,
52
+ description: "Name for the file to upload. For a session, all files loaded should have <b>unique names</b>.",
53
+ displayOptions
54
+ },
55
+ {
56
+ displayName: "File Type",
57
+ name: "fileType",
58
+ type: "options",
59
+ options: [
60
+ {
61
+ name: "Browser Download",
62
+ value: "browser_download"
63
+ },
64
+ {
65
+ name: "Screenshot",
66
+ value: "screenshot"
67
+ },
68
+ {
69
+ name: "Video",
70
+ value: "video"
71
+ },
72
+ {
73
+ name: "Customer Upload",
74
+ value: "customer_upload"
75
+ }
76
+ ],
77
+ default: "customer_upload",
78
+ description: "Choose the type of file to upload. Defaults to 'Customer Upload'.",
79
+ displayOptions
80
+ },
81
+ {
82
+ displayName: "Source",
83
+ name: "source",
84
+ type: "options",
85
+ options: [
86
+ {
87
+ name: "URL",
88
+ value: "url"
89
+ },
90
+ {
91
+ name: "Binary",
92
+ value: "binary"
93
+ }
94
+ ],
95
+ default: "url",
96
+ description: "Source of the file to upload",
97
+ displayOptions
98
+ },
99
+ {
100
+ displayName: "Binary Property",
101
+ name: "binaryPropertyName",
102
+ type: "string",
103
+ default: "data",
104
+ required: true,
105
+ displayOptions: {
106
+ show: {
107
+ source: ["binary"],
108
+ ...displayOptions.show
109
+ }
110
+ },
111
+ description: "Name of the binary property containing the file data"
112
+ },
113
+ {
114
+ displayName: "URL",
115
+ name: "url",
116
+ type: "string",
117
+ default: "",
118
+ required: true,
119
+ displayOptions: {
120
+ show: {
121
+ source: ["url"],
122
+ ...displayOptions.show
123
+ }
124
+ },
125
+ description: "URL from where to fetch the file to upload"
126
+ },
127
+ {
128
+ displayName: "Trigger File Input",
129
+ name: "triggerFileInputParameter",
130
+ type: "boolean",
131
+ default: true,
132
+ description: "Whether to automatically trigger the file input dialog in the current window. If disabled, the file will only be uploaded to the session without opening the file input dialog.",
133
+ displayOptions
134
+ },
135
+ {
136
+ ...import_fields.elementDescriptionField,
137
+ description: "Optional description of the file input to interact with",
138
+ placeholder: "e.g. the file upload selection box",
139
+ displayOptions: {
140
+ show: {
141
+ triggerFileInputParameter: [true],
142
+ ...displayOptions.show
143
+ }
144
+ }
145
+ }
146
+ ];
147
+ async function execute(index) {
148
+ const sessionId = import_GenericFunctions.validateRequiredStringField.call(this, index, "sessionId", "Session ID");
149
+ const windowId = import_GenericFunctions.validateRequiredStringField.call(this, index, "windowId", "Window ID");
150
+ const fileName = this.getNodeParameter("fileName", index, "");
151
+ const fileType = this.getNodeParameter("fileType", index, "customer_upload");
152
+ const source = this.getNodeParameter("source", index, "url");
153
+ const url = this.getNodeParameter("url", index, "");
154
+ const binaryPropertyName = this.getNodeParameter("binaryPropertyName", index, "");
155
+ const triggerFileInputParameter = this.getNodeParameter(
156
+ "triggerFileInputParameter",
157
+ index,
158
+ true
159
+ );
160
+ const elementDescription = this.getNodeParameter("elementDescription", index, "");
161
+ const fileValue = source === "url" ? url : binaryPropertyName;
162
+ try {
163
+ const fileBuffer = await import_helpers.createFileBuffer.call(this, source, fileValue, index);
164
+ const fileId = await import_helpers.createAndUploadFile.call(this, fileName, fileBuffer, fileType);
165
+ await import_helpers.pushFileToSession.call(this, fileId, sessionId);
166
+ if (triggerFileInputParameter) {
167
+ await import_helpers.triggerFileInput.call(this, fileId, windowId, sessionId, elementDescription);
168
+ }
169
+ return this.helpers.returnJsonArray({
170
+ sessionId,
171
+ windowId,
172
+ data: {
173
+ fileId,
174
+ message: "File uploaded successfully"
175
+ }
176
+ });
177
+ } catch (error) {
178
+ throw new import_n8n_workflow.NodeOperationError(this.getNode(), error);
179
+ }
180
+ }
181
+ // Annotate the CommonJS export names for ESM import in node:
182
+ 0 && (module.exports = {
183
+ description,
184
+ execute
185
+ });
186
+ //# sourceMappingURL=upload.operation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../nodes/Airtop/actions/file/upload.operation.ts"],"sourcesContent":["import type { IExecuteFunctions, INodeExecutionData, INodeProperties } from 'n8n-workflow';\nimport { NodeOperationError } from 'n8n-workflow';\n\nimport {\n\tcreateAndUploadFile,\n\tpushFileToSession,\n\ttriggerFileInput,\n\tcreateFileBuffer,\n} from './helpers';\nimport { validateRequiredStringField } from '../../GenericFunctions';\nimport { sessionIdField, windowIdField, elementDescriptionField } from '../common/fields';\n\nconst displayOptions = {\n\tshow: {\n\t\tresource: ['file'],\n\t\toperation: ['upload'],\n\t},\n};\n\nexport const description: INodeProperties[] = [\n\t{\n\t\t...sessionIdField,\n\t\tdescription: 'The session ID to load the file into',\n\t\tdisplayOptions,\n\t},\n\t{\n\t\t...windowIdField,\n\t\tdescription: 'The window ID to trigger the file input in',\n\t\tdisplayOptions,\n\t},\n\t{\n\t\tdisplayName: 'File Name',\n\t\tname: 'fileName',\n\t\ttype: 'string',\n\t\tdefault: '',\n\t\trequired: true,\n\t\tdescription:\n\t\t\t'Name for the file to upload. For a session, all files loaded should have <b>unique names</b>.',\n\t\tdisplayOptions,\n\t},\n\t{\n\t\tdisplayName: 'File Type',\n\t\tname: 'fileType',\n\t\ttype: 'options',\n\t\toptions: [\n\t\t\t{\n\t\t\t\tname: 'Browser Download',\n\t\t\t\tvalue: 'browser_download',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'Screenshot',\n\t\t\t\tvalue: 'screenshot',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'Video',\n\t\t\t\tvalue: 'video',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'Customer Upload',\n\t\t\t\tvalue: 'customer_upload',\n\t\t\t},\n\t\t],\n\t\tdefault: 'customer_upload',\n\t\tdescription: \"Choose the type of file to upload. Defaults to 'Customer Upload'.\",\n\t\tdisplayOptions,\n\t},\n\t{\n\t\tdisplayName: 'Source',\n\t\tname: 'source',\n\t\ttype: 'options',\n\t\toptions: [\n\t\t\t{\n\t\t\t\tname: 'URL',\n\t\t\t\tvalue: 'url',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'Binary',\n\t\t\t\tvalue: 'binary',\n\t\t\t},\n\t\t],\n\t\tdefault: 'url',\n\t\tdescription: 'Source of the file to upload',\n\t\tdisplayOptions,\n\t},\n\t{\n\t\tdisplayName: 'Binary Property',\n\t\tname: 'binaryPropertyName',\n\t\ttype: 'string',\n\t\tdefault: 'data',\n\t\trequired: true,\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tsource: ['binary'],\n\t\t\t\t...displayOptions.show,\n\t\t\t},\n\t\t},\n\t\tdescription: 'Name of the binary property containing the file data',\n\t},\n\t{\n\t\tdisplayName: 'URL',\n\t\tname: 'url',\n\t\ttype: 'string',\n\t\tdefault: '',\n\t\trequired: true,\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tsource: ['url'],\n\t\t\t\t...displayOptions.show,\n\t\t\t},\n\t\t},\n\t\tdescription: 'URL from where to fetch the file to upload',\n\t},\n\t{\n\t\tdisplayName: 'Trigger File Input',\n\t\tname: 'triggerFileInputParameter',\n\t\ttype: 'boolean',\n\t\tdefault: true,\n\t\tdescription:\n\t\t\t'Whether to automatically trigger the file input dialog in the current window. If disabled, the file will only be uploaded to the session without opening the file input dialog.',\n\t\tdisplayOptions,\n\t},\n\t{\n\t\t...elementDescriptionField,\n\t\tdescription: 'Optional description of the file input to interact with',\n\t\tplaceholder: 'e.g. the file upload selection box',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\ttriggerFileInputParameter: [true],\n\t\t\t\t...displayOptions.show,\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 = validateRequiredStringField.call(this, index, 'sessionId', 'Session ID');\n\tconst windowId = validateRequiredStringField.call(this, index, 'windowId', 'Window ID');\n\tconst fileName = this.getNodeParameter('fileName', index, '') as string;\n\tconst fileType = this.getNodeParameter('fileType', index, 'customer_upload') as string;\n\tconst source = this.getNodeParameter('source', index, 'url') as string;\n\tconst url = this.getNodeParameter('url', index, '') as string;\n\tconst binaryPropertyName = this.getNodeParameter('binaryPropertyName', index, '');\n\tconst triggerFileInputParameter = this.getNodeParameter(\n\t\t'triggerFileInputParameter',\n\t\tindex,\n\t\ttrue,\n\t) as boolean;\n\tconst elementDescription = this.getNodeParameter('elementDescription', index, '') as string;\n\n\t// Get the file content based on source type\n\tconst fileValue = source === 'url' ? url : binaryPropertyName;\n\n\ttry {\n\t\tconst fileBuffer = await createFileBuffer.call(this, source, fileValue, index);\n\t\tconst fileId = await createAndUploadFile.call(this, fileName, fileBuffer, fileType);\n\t\t// Push file to session\n\t\tawait pushFileToSession.call(this, fileId, sessionId);\n\n\t\tif (triggerFileInputParameter) {\n\t\t\tawait triggerFileInput.call(this, fileId, windowId, sessionId, elementDescription);\n\t\t}\n\n\t\treturn this.helpers.returnJsonArray({\n\t\t\tsessionId,\n\t\t\twindowId,\n\t\t\tdata: {\n\t\t\t\tfileId,\n\t\t\t\tmessage: 'File uploaded successfully',\n\t\t\t},\n\t\t});\n\t} catch (error) {\n\t\tthrow new NodeOperationError(this.getNode(), error as Error);\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,0BAAmC;AAEnC,qBAKO;AACP,8BAA4C;AAC5C,oBAAuE;AAEvE,MAAM,iBAAiB;AAAA,EACtB,MAAM;AAAA,IACL,UAAU,CAAC,MAAM;AAAA,IACjB,WAAW,CAAC,QAAQ;AAAA,EACrB;AACD;AAEO,MAAM,cAAiC;AAAA,EAC7C;AAAA,IACC,GAAG;AAAA,IACH,aAAa;AAAA,IACb;AAAA,EACD;AAAA,EACA;AAAA,IACC,GAAG;AAAA,IACH,aAAa;AAAA,IACb;AAAA,EACD;AAAA,EACA;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,IACT,UAAU;AAAA,IACV,a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AG,KAAc;AAAA,EAC5D;AACD;","names":[]}
@@ -30,12 +30,16 @@ var Interaction_resource_exports = {};
30
30
  __export(Interaction_resource_exports, {
31
31
  click: () => click,
32
32
  description: () => description,
33
+ fill: () => fill,
33
34
  hover: () => hover,
35
+ scroll: () => scroll,
34
36
  type: () => type
35
37
  });
36
38
  module.exports = __toCommonJS(Interaction_resource_exports);
37
39
  var click = __toESM(require("./click.operation"));
40
+ var fill = __toESM(require("./fill.operation"));
38
41
  var hover = __toESM(require("./hover.operation"));
42
+ var scroll = __toESM(require("./scroll.operation"));
39
43
  var type = __toESM(require("./type.operation"));
40
44
  var import_fields = require("../common/fields");
41
45
  const description = [
@@ -56,12 +60,24 @@ const description = [
56
60
  description: "Execute a click on an element given a description",
57
61
  action: "Click an element"
58
62
  },
63
+ {
64
+ name: "Fill Form",
65
+ value: "fill",
66
+ description: "Fill a form with the provided information",
67
+ action: "Fill form"
68
+ },
59
69
  {
60
70
  name: "Hover on an Element",
61
71
  value: "hover",
62
72
  description: "Execute a hover action on an element given a description",
63
73
  action: "Hover on an element"
64
74
  },
75
+ {
76
+ name: "Scroll",
77
+ value: "scroll",
78
+ description: "Execute a scroll action on the page",
79
+ action: "Scroll on page"
80
+ },
65
81
  {
66
82
  name: "Type",
67
83
  value: "type",
@@ -88,7 +104,9 @@ const description = [
88
104
  }
89
105
  },
90
106
  ...click.description,
107
+ ...fill.description,
91
108
  ...hover.description,
109
+ ...scroll.description,
92
110
  ...type.description,
93
111
  {
94
112
  displayName: "Additional Fields",
@@ -98,7 +116,8 @@ const description = [
98
116
  default: {},
99
117
  displayOptions: {
100
118
  show: {
101
- resource: ["interaction"]
119
+ resource: ["interaction"],
120
+ operation: ["click", "hover", "type", "scroll"]
102
121
  }
103
122
  },
104
123
  options: [
@@ -163,7 +182,9 @@ const description = [
163
182
  0 && (module.exports = {
164
183
  click,
165
184
  description,
185
+ fill,
166
186
  hover,
187
+ scroll,
167
188
  type
168
189
  });
169
190
  //# sourceMappingURL=Interaction.resource.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../nodes/Airtop/actions/interaction/Interaction.resource.ts"],"sourcesContent":["import type { INodeProperties } from 'n8n-workflow';\n\nimport * as click from './click.operation';\nimport * as hover from './hover.operation';\nimport * as type from './type.operation';\nimport { sessionIdField, windowIdField } from '../common/fields';\nexport { click, hover, type };\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: ['interaction'],\n\t\t\t},\n\t\t},\n\t\toptions: [\n\t\t\t{\n\t\t\t\tname: 'Click an Element',\n\t\t\t\tvalue: 'click',\n\t\t\t\tdescription: 'Execute a click on an element given a description',\n\t\t\t\taction: 'Click an element',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'Hover on an Element',\n\t\t\t\tvalue: 'hover',\n\t\t\t\tdescription: 'Execute a hover action on an element given a description',\n\t\t\t\taction: 'Hover on an element',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'Type',\n\t\t\t\tvalue: 'type',\n\t\t\t\tdescription: 'Execute a Type action on an element given a description',\n\t\t\t\taction: 'Type text',\n\t\t\t},\n\t\t],\n\t\tdefault: 'click',\n\t},\n\t{\n\t\t...sessionIdField,\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tresource: ['interaction'],\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: ['interaction'],\n\t\t\t},\n\t\t},\n\t},\n\t...click.description,\n\t...hover.description,\n\t...type.description,\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: ['interaction'],\n\t\t\t},\n\t\t},\n\t\toptions: [\n\t\t\t{\n\t\t\t\tdisplayName: 'Visual Scope',\n\t\t\t\tname: 'visualScope',\n\t\t\t\ttype: 'options',\n\t\t\t\tdefault: 'auto',\n\t\t\t\tdescription: 'Defines the strategy for visual analysis of the current window',\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: 'Provides the simplest out-of-the-box experience for most web pages',\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: 'Viewport',\n\t\t\t\t\t\tdescription: 'For analysis of the current browser view only',\n\t\t\t\t\t\tvalue: 'viewport',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Page',\n\t\t\t\t\t\tdescription: 'For analysis of the entire page',\n\t\t\t\t\t\tvalue: 'page',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Scan',\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\"For a full page analysis on sites that have compatibility issues with 'Page' mode\",\n\t\t\t\t\t\tvalue: 'scan',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Wait Until Event After Navigation',\n\t\t\t\tname: 'waitForNavigation',\n\t\t\t\ttype: 'options',\n\t\t\t\tdefault: 'load',\n\t\t\t\tdescription:\n\t\t\t\t\t\"The condition to wait for the navigation to complete after an interaction (click, type or hover). Defaults to 'Fully Loaded'.\",\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Fully Loaded (Slower)',\n\t\t\t\t\t\tvalue: 'load',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'DOM Only Loaded (Faster)',\n\t\t\t\t\t\tvalue: 'domcontentloaded',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'All Network Activity Has Stopped',\n\t\t\t\t\t\tvalue: 'networkidle0',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Most Network Activity Has Stopped',\n\t\t\t\t\t\tvalue: 'networkidle2',\n\t\t\t\t\t},\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;AAEA,YAAuB;AACvB,YAAuB;AACvB,WAAsB;AACtB,oBAA8C;AAGvC,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,aAAa;AAAA,MACzB;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,IACD;AAAA,IACA,SAAS;AAAA,EACV;AAAA,EACA;AAAA,IACC,GAAG;AAAA,IACH,gBAAgB;AAAA,MACf,MAAM;AAAA,QACL,UAAU,CAAC,aAAa;AAAA,MACzB;AAAA,IACD;AAAA,EACD;AAAA,EACA;AAAA,IACC,GAAG;AAAA,IACH,gBAAgB;AAAA,MACf,MAAM;AAAA,QACL,UAAU,CAAC,aAAa;AAAA,MACzB;AAAA,IACD;AAAA,EACD;AAAA,EACA,GAAG,MAAM;AAAA,EACT,GAAG,MAAM;AAAA,EACT,GAAG,KAAK;AAAA,EACR;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,aAAa;AAAA,MACzB;AAAA,IACD;AAAA,IACA,SAAS;AAAA,MACR;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,UACA;AAAA,YACC,MAAM;AAAA,YACN,aACC;AAAA,YACD,OAAO;AAAA,UACR;AAAA,QACD;AAAA,MACD;AAAA,MACA;AAAA,QACC,aAAa;AAAA,QACb,MAAM;AAAA,QACN,MAAM;AAAA,QACN,SAAS;AAAA,QACT,aACC;AAAA,QACD,SAAS;AAAA,UACR;AAAA,YACC,MAAM;AAAA,YACN,OAAO;AAAA,UACR;AAAA,UACA;AAAA,YACC,MAAM;AAAA,YACN,OAAO;AAAA,UACR;AAAA,UACA;AAAA,YACC,MAAM;AAAA,YACN,OAAO;AAAA,UACR;AAAA,UACA;AAAA,YACC,MAAM;AAAA,YACN,OAAO;AAAA,UACR;AAAA,QACD;AAAA,MACD;AAAA,IACD;AAAA,EACD;AACD;","names":[]}
1
+ {"version":3,"sources":["../../../../../nodes/Airtop/actions/interaction/Interaction.resource.ts"],"sourcesContent":["import type { INodeProperties } from 'n8n-workflow';\n\nimport * as click from './click.operation';\nimport * as fill from './fill.operation';\nimport * as hover from './hover.operation';\nimport * as scroll from './scroll.operation';\nimport * as type from './type.operation';\nimport { sessionIdField, windowIdField } from '../common/fields';\nexport { click, fill, hover, scroll, type };\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: ['interaction'],\n\t\t\t},\n\t\t},\n\t\toptions: [\n\t\t\t{\n\t\t\t\tname: 'Click an Element',\n\t\t\t\tvalue: 'click',\n\t\t\t\tdescription: 'Execute a click on an element given a description',\n\t\t\t\taction: 'Click an element',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'Fill Form',\n\t\t\t\tvalue: 'fill',\n\t\t\t\tdescription: 'Fill a form with the provided information',\n\t\t\t\taction: 'Fill form',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'Hover on an Element',\n\t\t\t\tvalue: 'hover',\n\t\t\t\tdescription: 'Execute a hover action on an element given a description',\n\t\t\t\taction: 'Hover on an element',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'Scroll',\n\t\t\t\tvalue: 'scroll',\n\t\t\t\tdescription: 'Execute a scroll action on the page',\n\t\t\t\taction: 'Scroll on page',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'Type',\n\t\t\t\tvalue: 'type',\n\t\t\t\tdescription: 'Execute a Type action on an element given a description',\n\t\t\t\taction: 'Type text',\n\t\t\t},\n\t\t],\n\t\tdefault: 'click',\n\t},\n\t{\n\t\t...sessionIdField,\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tresource: ['interaction'],\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: ['interaction'],\n\t\t\t},\n\t\t},\n\t},\n\t...click.description,\n\t...fill.description,\n\t...hover.description,\n\t...scroll.description,\n\t...type.description,\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: ['interaction'],\n\t\t\t\toperation: ['click', 'hover', 'type', 'scroll'],\n\t\t\t},\n\t\t},\n\t\toptions: [\n\t\t\t{\n\t\t\t\tdisplayName: 'Visual Scope',\n\t\t\t\tname: 'visualScope',\n\t\t\t\ttype: 'options',\n\t\t\t\tdefault: 'auto',\n\t\t\t\tdescription: 'Defines the strategy for visual analysis of the current window',\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: 'Provides the simplest out-of-the-box experience for most web pages',\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: 'Viewport',\n\t\t\t\t\t\tdescription: 'For analysis of the current browser view only',\n\t\t\t\t\t\tvalue: 'viewport',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Page',\n\t\t\t\t\t\tdescription: 'For analysis of the entire page',\n\t\t\t\t\t\tvalue: 'page',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Scan',\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\"For a full page analysis on sites that have compatibility issues with 'Page' mode\",\n\t\t\t\t\t\tvalue: 'scan',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Wait Until Event After Navigation',\n\t\t\t\tname: 'waitForNavigation',\n\t\t\t\ttype: 'options',\n\t\t\t\tdefault: 'load',\n\t\t\t\tdescription:\n\t\t\t\t\t\"The condition to wait for the navigation to complete after an interaction (click, type or hover). Defaults to 'Fully Loaded'.\",\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Fully Loaded (Slower)',\n\t\t\t\t\t\tvalue: 'load',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'DOM Only Loaded (Faster)',\n\t\t\t\t\t\tvalue: 'domcontentloaded',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'All Network Activity Has Stopped',\n\t\t\t\t\t\tvalue: 'networkidle0',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Most Network Activity Has Stopped',\n\t\t\t\t\t\tvalue: 'networkidle2',\n\t\t\t\t\t},\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;AAEA,YAAuB;AACvB,WAAsB;AACtB,YAAuB;AACvB,aAAwB;AACxB,WAAsB;AACtB,oBAA8C;AAGvC,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,aAAa;AAAA,MACzB;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;AAAA,IACC,GAAG;AAAA,IACH,gBAAgB;AAAA,MACf,MAAM;AAAA,QACL,UAAU,CAAC,aAAa;AAA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