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.
- package/dist/credentials/AirtopApi.credentials.js +2 -1
- package/dist/credentials/AirtopApi.credentials.js.map +1 -1
- package/dist/credentials/JinaAiApi.credentials.js +1 -1
- package/dist/credentials/JinaAiApi.credentials.js.map +1 -1
- package/dist/credentials/MicrosoftSharePointOAuth2Api.credentials.js +9 -0
- package/dist/credentials/MicrosoftSharePointOAuth2Api.credentials.js.map +1 -1
- package/dist/credentials/icons/microsoftSharePoint.svg +59 -0
- package/dist/known/nodes.json +0 -4
- package/dist/nodes/Airtop/Airtop.node.js +14 -8
- package/dist/nodes/Airtop/Airtop.node.js.map +1 -1
- package/dist/nodes/Airtop/GenericFunctions.js +87 -15
- package/dist/nodes/Airtop/GenericFunctions.js.map +1 -1
- package/dist/nodes/Airtop/actions/common/fields.js +9 -0
- package/dist/nodes/Airtop/actions/common/fields.js.map +1 -1
- package/dist/nodes/Airtop/actions/common/output.utils.js +79 -0
- package/dist/nodes/Airtop/actions/common/output.utils.js.map +1 -0
- package/dist/nodes/Airtop/actions/common/session.utils.js +2 -2
- package/dist/nodes/Airtop/actions/common/session.utils.js.map +1 -1
- package/dist/nodes/Airtop/actions/extraction/getPaginated.operation.js +13 -4
- package/dist/nodes/Airtop/actions/extraction/getPaginated.operation.js.map +1 -1
- package/dist/nodes/Airtop/actions/extraction/query.operation.js +21 -3
- package/dist/nodes/Airtop/actions/extraction/query.operation.js.map +1 -1
- package/dist/nodes/Airtop/actions/extraction/scrape.operation.js +2 -1
- package/dist/nodes/Airtop/actions/extraction/scrape.operation.js.map +1 -1
- package/dist/nodes/Airtop/actions/file/File.resource.js +104 -0
- package/dist/nodes/Airtop/actions/file/File.resource.js.map +1 -0
- package/dist/nodes/Airtop/actions/file/delete.operation.js +60 -0
- package/dist/nodes/Airtop/actions/file/delete.operation.js.map +1 -0
- package/dist/nodes/Airtop/actions/file/get.operation.js +91 -0
- package/dist/nodes/Airtop/actions/file/get.operation.js.map +1 -0
- package/dist/nodes/Airtop/actions/file/getMany.operation.js +100 -0
- package/dist/nodes/Airtop/actions/file/getMany.operation.js.map +1 -0
- package/dist/nodes/Airtop/actions/file/helpers.js +199 -0
- package/dist/nodes/Airtop/actions/file/helpers.js.map +1 -0
- package/dist/nodes/Airtop/actions/file/load.operation.js +85 -0
- package/dist/nodes/Airtop/actions/file/load.operation.js.map +1 -0
- package/dist/nodes/Airtop/actions/file/upload.operation.js +186 -0
- package/dist/nodes/Airtop/actions/file/upload.operation.js.map +1 -0
- package/dist/nodes/Airtop/actions/interaction/Interaction.resource.js +22 -1
- package/dist/nodes/Airtop/actions/interaction/Interaction.resource.js.map +1 -1
- package/dist/nodes/Airtop/actions/interaction/fill.operation.js +89 -0
- package/dist/nodes/Airtop/actions/interaction/fill.operation.js.map +1 -0
- package/dist/nodes/Airtop/actions/interaction/scroll.operation.js +219 -0
- package/dist/nodes/Airtop/actions/interaction/scroll.operation.js.map +1 -0
- package/dist/nodes/Airtop/actions/node.type.js.map +1 -1
- package/dist/nodes/Airtop/actions/router.js +13 -4
- package/dist/nodes/Airtop/actions/router.js.map +1 -1
- package/dist/nodes/Airtop/actions/session/create.operation.js +85 -32
- package/dist/nodes/Airtop/actions/session/create.operation.js.map +1 -1
- package/dist/nodes/Airtop/actions/window/Window.resource.js +2 -1
- package/dist/nodes/Airtop/actions/window/Window.resource.js.map +1 -1
- package/dist/nodes/Airtop/actions/window/create.operation.js +1 -1
- package/dist/nodes/Airtop/actions/window/create.operation.js.map +1 -1
- package/dist/nodes/Airtop/actions/window/takeScreenshot.operation.js +26 -3
- package/dist/nodes/Airtop/actions/window/takeScreenshot.operation.js.map +1 -1
- package/dist/nodes/Airtop/constants.js +38 -5
- package/dist/nodes/Airtop/constants.js.map +1 -1
- package/dist/nodes/Airtop/countries.js +1026 -0
- package/dist/nodes/Airtop/countries.js.map +1 -0
- package/dist/nodes/Airtop/transport/index.js +6 -3
- package/dist/nodes/Airtop/transport/index.js.map +1 -1
- package/dist/nodes/Airtop/transport/types.js.map +1 -1
- package/dist/nodes/Google/Drive/v2/actions/file/upload.operation.js +4 -1
- package/dist/nodes/Google/Drive/v2/actions/file/upload.operation.js.map +1 -1
- package/dist/nodes/Google/Firebase/CloudFirestore/GenericFunctions.js +1 -2
- package/dist/nodes/Google/Firebase/CloudFirestore/GenericFunctions.js.map +1 -1
- package/dist/nodes/HttpRequest/GenericFunctions.js +1 -1
- package/dist/nodes/HttpRequest/GenericFunctions.js.map +1 -1
- package/dist/nodes/Merge/Merge.node.js +3 -2
- package/dist/nodes/Merge/Merge.node.js.map +1 -1
- package/dist/nodes/Merge/v3/actions/mode/combineBySql.js +42 -4
- package/dist/nodes/Merge/v3/actions/mode/combineBySql.js.map +1 -1
- package/dist/nodes/Merge/v3/actions/versionDescription.js +1 -1
- package/dist/nodes/Merge/v3/actions/versionDescription.js.map +1 -1
- package/dist/nodes/Microsoft/SharePoint/descriptions/file/update.operation.js +2 -2
- package/dist/nodes/Microsoft/SharePoint/descriptions/file/update.operation.js.map +1 -1
- package/dist/nodes/Microsoft/SharePoint/descriptions/file/upload.operation.js +2 -2
- package/dist/nodes/Microsoft/SharePoint/descriptions/file/upload.operation.js.map +1 -1
- package/dist/nodes/Microsoft/SharePoint/descriptions/item/Item.resource.js +1 -1
- package/dist/nodes/Microsoft/SharePoint/descriptions/item/Item.resource.js.map +1 -1
- package/dist/nodes/Microsoft/SharePoint/descriptions/list/List.resource.js +1 -1
- package/dist/nodes/Microsoft/SharePoint/descriptions/list/List.resource.js.map +1 -1
- package/dist/nodes/MongoDb/GenericFunctions.js +9 -2
- package/dist/nodes/MongoDb/GenericFunctions.js.map +1 -1
- package/dist/nodes/MongoDb/MongoDb.node.js +25 -5
- package/dist/nodes/MongoDb/MongoDb.node.js.map +1 -1
- package/dist/nodes/Telegram/Telegram.node.js +5 -1
- package/dist/nodes/Telegram/Telegram.node.js.map +1 -1
- package/dist/nodes/Transform/Summarize/utils.js +2 -1
- package/dist/nodes/Transform/Summarize/utils.js.map +1 -1
- package/dist/test/setup.js +1 -0
- package/dist/test/setup.js.map +1 -1
- package/dist/types/credentials.json +2 -2
- package/dist/types/nodes.json +8 -9
- package/package.json +4 -5
- package/dist/nodes/EvaluationMetrics/EvaluationMetrics.node.js +0 -119
- package/dist/nodes/EvaluationMetrics/EvaluationMetrics.node.js.map +0 -1
- package/dist/nodes/EvaluationMetrics/EvaluationMetrics.node.json +0 -14
|
@@ -32,9 +32,9 @@ async function executeRequestWithSessionManagement(index, request) {
|
|
|
32
32
|
if (shouldTerminateSession) {
|
|
33
33
|
await import_transport.apiRequest.call(this, "DELETE", `/sessions/${sessionId}`);
|
|
34
34
|
this.logger.info(`[${this.getNode().name}] Session terminated.`);
|
|
35
|
-
return
|
|
35
|
+
return response;
|
|
36
36
|
}
|
|
37
|
-
return
|
|
37
|
+
return { sessionId, windowId, ...response };
|
|
38
38
|
}
|
|
39
39
|
// Annotate the CommonJS export names for ESM import in node:
|
|
40
40
|
0 && (module.exports = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../nodes/Airtop/actions/common/session.utils.ts"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"sources":["../../../../../nodes/Airtop/actions/common/session.utils.ts"],"sourcesContent":["import type { IExecuteFunctions, IDataObject } from 'n8n-workflow';\n\nimport {\n\tvalidateSessionAndWindowId,\n\tcreateSessionAndWindow,\n\tshouldCreateNewSession,\n\tvalidateAirtopApiResponse,\n} from '../../GenericFunctions';\nimport { apiRequest } from '../../transport';\nimport type { IAirtopResponse } from '../../transport/types';\n\n/**\n * Execute the node operation. Creates and terminates a new session if needed.\n * @param this - The execution context\n * @param index - The index of the node\n * @param request - The request to execute\n * @returns The response from the request\n */\nexport async function executeRequestWithSessionManagement(\n\tthis: IExecuteFunctions,\n\tindex: number,\n\trequest: {\n\t\tmethod: 'POST' | 'DELETE';\n\t\tpath: string;\n\t\tbody: IDataObject;\n\t},\n): Promise<IAirtopResponse> {\n\tconst { sessionId, windowId } = shouldCreateNewSession.call(this, index)\n\t\t? await createSessionAndWindow.call(this, index)\n\t\t: validateSessionAndWindowId.call(this, index);\n\n\tconst shouldTerminateSession = this.getNodeParameter('autoTerminateSession', index, false);\n\n\tconst endpoint = request.path.replace('{sessionId}', sessionId).replace('{windowId}', windowId);\n\tconst response = await apiRequest.call(this, request.method, endpoint, request.body);\n\n\tvalidateAirtopApiResponse(this.getNode(), response);\n\n\tif (shouldTerminateSession) {\n\t\tawait apiRequest.call(this, 'DELETE', `/sessions/${sessionId}`);\n\t\tthis.logger.info(`[${this.getNode().name}] Session terminated.`);\n\t\treturn response;\n\t}\n\n\treturn { sessionId, windowId, ...response };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,8BAKO;AACP,uBAA2B;AAU3B,eAAsB,oCAErB,OACA,SAK2B;AAC3B,QAAM,EAAE,WAAW,SAAS,IAAI,+CAAuB,KAAK,MAAM,KAAK,IACpE,MAAM,+CAAuB,KAAK,MAAM,KAAK,IAC7C,mDAA2B,KAAK,MAAM,KAAK;AAE9C,QAAM,yBAAyB,KAAK,iBAAiB,wBAAwB,OAAO,KAAK;AAEzF,QAAM,WAAW,QAAQ,KAAK,QAAQ,eAAe,SAAS,EAAE,QAAQ,cAAc,QAAQ;AAC9F,QAAM,WAAW,MAAM,4BAAW,KAAK,MAAM,QAAQ,QAAQ,UAAU,QAAQ,IAAI;AAEnF,yDAA0B,KAAK,QAAQ,GAAG,QAAQ;AAElD,MAAI,wBAAwB;AAC3B,UAAM,4BAAW,KAAK,MAAM,UAAU,aAAa,SAAS,EAAE;AAC9D,SAAK,OAAO,KAAK,IAAI,KAAK,QAAQ,EAAE,IAAI,uBAAuB;AAC/D,WAAO;AAAA,EACR;AAEA,SAAO,EAAE,WAAW,UAAU,GAAG,SAAS;AAC3C;","names":[]}
|
|
@@ -23,6 +23,7 @@ __export(getPaginated_operation_exports, {
|
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(getPaginated_operation_exports);
|
|
25
25
|
var import_fields = require("../common/fields");
|
|
26
|
+
var import_output = require("../common/output.utils");
|
|
26
27
|
var import_session = require("../common/session.utils");
|
|
27
28
|
const description = [
|
|
28
29
|
{
|
|
@@ -59,6 +60,9 @@ const description = [
|
|
|
59
60
|
{
|
|
60
61
|
...import_fields.outputSchemaField
|
|
61
62
|
},
|
|
63
|
+
{
|
|
64
|
+
...import_fields.parseJsonOutputField
|
|
65
|
+
},
|
|
62
66
|
{
|
|
63
67
|
displayName: "Interaction Mode",
|
|
64
68
|
name: "interactionMode",
|
|
@@ -113,16 +117,21 @@ const description = [
|
|
|
113
117
|
async function execute(index) {
|
|
114
118
|
const prompt = this.getNodeParameter("prompt", index, "");
|
|
115
119
|
const additionalFields = this.getNodeParameter("additionalFields", index);
|
|
116
|
-
|
|
120
|
+
const configFields = ["paginationMode", "interactionMode", "outputSchema"];
|
|
121
|
+
const configuration = configFields.reduce(
|
|
122
|
+
(config, key) => additionalFields[key] ? { ...config, [key]: additionalFields[key] } : config,
|
|
123
|
+
{}
|
|
124
|
+
);
|
|
125
|
+
const result = await import_session.executeRequestWithSessionManagement.call(this, index, {
|
|
117
126
|
method: "POST",
|
|
118
127
|
path: "/sessions/{sessionId}/windows/{windowId}/paginated-extraction",
|
|
119
128
|
body: {
|
|
120
129
|
prompt,
|
|
121
|
-
configuration
|
|
122
|
-
...additionalFields
|
|
123
|
-
}
|
|
130
|
+
configuration
|
|
124
131
|
}
|
|
125
132
|
});
|
|
133
|
+
const nodeOutput = import_output.parseJsonIfPresent.call(this, index, result);
|
|
134
|
+
return this.helpers.returnJsonArray(nodeOutput);
|
|
126
135
|
}
|
|
127
136
|
// Annotate the CommonJS export names for ESM import in node:
|
|
128
137
|
0 && (module.exports = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../nodes/Airtop/actions/extraction/getPaginated.operation.ts"],"sourcesContent":["import {\n\ttype IExecuteFunctions,\n\ttype INodeExecutionData,\n\ttype INodeProperties,\n} from 'n8n-workflow';\n\nimport { outputSchemaField } from '../common/fields';\nimport { executeRequestWithSessionManagement } from '../common/session.utils';\n\nexport const description: INodeProperties[] = [\n\t{\n\t\tdisplayName: 'Prompt',\n\t\tname: 'prompt',\n\t\ttype: 'string',\n\t\ttypeOptions: {\n\t\t\trows: 4,\n\t\t},\n\t\trequired: true,\n\t\tdefault: '',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tresource: ['extraction'],\n\t\t\t\toperation: ['getPaginated'],\n\t\t\t},\n\t\t},\n\t\tdescription: 'The prompt to extract data from the pages',\n\t\tplaceholder: 'e.g. Extract all the product names and prices',\n\t},\n\t{\n\t\tdisplayName: 'Additional Fields',\n\t\tname: 'additionalFields',\n\t\ttype: 'collection',\n\t\tplaceholder: 'Add Field',\n\t\tdefault: {},\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tresource: ['extraction'],\n\t\t\t\toperation: ['getPaginated'],\n\t\t\t},\n\t\t},\n\t\toptions: [\n\t\t\t{\n\t\t\t\t...outputSchemaField,\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Interaction Mode',\n\t\t\t\tname: 'interactionMode',\n\t\t\t\ttype: 'options',\n\t\t\t\tdefault: 'auto',\n\t\t\t\tdescription: 'The strategy for interacting with the page',\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Auto',\n\t\t\t\t\t\tdescription: 'Automatically choose the most cost-effective mode',\n\t\t\t\t\t\tvalue: 'auto',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Accurate',\n\t\t\t\t\t\tdescription: 'Prioritize accuracy over cost',\n\t\t\t\t\t\tvalue: 'accurate',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Cost Efficient',\n\t\t\t\t\t\tdescription: 'Minimize costs while ensuring effectiveness',\n\t\t\t\t\t\tvalue: 'cost-efficient',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Pagination Mode',\n\t\t\t\tname: 'paginationMode',\n\t\t\t\ttype: 'options',\n\t\t\t\tdefault: 'auto',\n\t\t\t\tdescription: 'The pagination approach to use',\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Auto',\n\t\t\t\t\t\tdescription: 'Look for pagination links first, then try infinite scrolling',\n\t\t\t\t\t\tvalue: 'auto',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Paginated',\n\t\t\t\t\t\tdescription: 'Only use pagination links',\n\t\t\t\t\t\tvalue: 'paginated',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Infinite Scroll',\n\t\t\t\t\t\tdescription: 'Scroll the page to load more content',\n\t\t\t\t\t\tvalue: 'infinite-scroll',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t},\n];\n\nexport async function execute(\n\tthis: IExecuteFunctions,\n\tindex: number,\n): Promise<INodeExecutionData[]> {\n\tconst prompt = this.getNodeParameter('prompt', index, '') as string;\n\tconst additionalFields = this.getNodeParameter('additionalFields', index);\n\n\
|
|
1
|
+
{"version":3,"sources":["../../../../../nodes/Airtop/actions/extraction/getPaginated.operation.ts"],"sourcesContent":["import {\n\ttype IExecuteFunctions,\n\ttype INodeExecutionData,\n\ttype INodeProperties,\n} from 'n8n-workflow';\n\nimport { outputSchemaField, parseJsonOutputField } from '../common/fields';\nimport { parseJsonIfPresent } from '../common/output.utils';\nimport { executeRequestWithSessionManagement } from '../common/session.utils';\n\nexport const description: INodeProperties[] = [\n\t{\n\t\tdisplayName: 'Prompt',\n\t\tname: 'prompt',\n\t\ttype: 'string',\n\t\ttypeOptions: {\n\t\t\trows: 4,\n\t\t},\n\t\trequired: true,\n\t\tdefault: '',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tresource: ['extraction'],\n\t\t\t\toperation: ['getPaginated'],\n\t\t\t},\n\t\t},\n\t\tdescription: 'The prompt to extract data from the pages',\n\t\tplaceholder: 'e.g. Extract all the product names and prices',\n\t},\n\t{\n\t\tdisplayName: 'Additional Fields',\n\t\tname: 'additionalFields',\n\t\ttype: 'collection',\n\t\tplaceholder: 'Add Field',\n\t\tdefault: {},\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tresource: ['extraction'],\n\t\t\t\toperation: ['getPaginated'],\n\t\t\t},\n\t\t},\n\t\toptions: [\n\t\t\t{\n\t\t\t\t...outputSchemaField,\n\t\t\t},\n\t\t\t{\n\t\t\t\t...parseJsonOutputField,\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Interaction Mode',\n\t\t\t\tname: 'interactionMode',\n\t\t\t\ttype: 'options',\n\t\t\t\tdefault: 'auto',\n\t\t\t\tdescription: 'The strategy for interacting with the page',\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Auto',\n\t\t\t\t\t\tdescription: 'Automatically choose the most cost-effective mode',\n\t\t\t\t\t\tvalue: 'auto',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Accurate',\n\t\t\t\t\t\tdescription: 'Prioritize accuracy over cost',\n\t\t\t\t\t\tvalue: 'accurate',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Cost Efficient',\n\t\t\t\t\t\tdescription: 'Minimize costs while ensuring effectiveness',\n\t\t\t\t\t\tvalue: 'cost-efficient',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Pagination Mode',\n\t\t\t\tname: 'paginationMode',\n\t\t\t\ttype: 'options',\n\t\t\t\tdefault: 'auto',\n\t\t\t\tdescription: 'The pagination approach to use',\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Auto',\n\t\t\t\t\t\tdescription: 'Look for pagination links first, then try infinite scrolling',\n\t\t\t\t\t\tvalue: 'auto',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Paginated',\n\t\t\t\t\t\tdescription: 'Only use pagination links',\n\t\t\t\t\t\tvalue: 'paginated',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Infinite Scroll',\n\t\t\t\t\t\tdescription: 'Scroll the page to load more content',\n\t\t\t\t\t\tvalue: 'infinite-scroll',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t},\n];\n\nexport async function execute(\n\tthis: IExecuteFunctions,\n\tindex: number,\n): Promise<INodeExecutionData[]> {\n\tconst prompt = this.getNodeParameter('prompt', index, '') as string;\n\tconst additionalFields = this.getNodeParameter('additionalFields', index);\n\n\tconst configFields = ['paginationMode', 'interactionMode', 'outputSchema'];\n\tconst configuration = configFields.reduce(\n\t\t(config, key) => (additionalFields[key] ? { ...config, [key]: additionalFields[key] } : config),\n\t\t{},\n\t);\n\n\tconst result = await executeRequestWithSessionManagement.call(this, index, {\n\t\tmethod: 'POST',\n\t\tpath: '/sessions/{sessionId}/windows/{windowId}/paginated-extraction',\n\t\tbody: {\n\t\t\tprompt,\n\t\t\tconfiguration,\n\t\t},\n\t});\n\n\tconst nodeOutput = parseJsonIfPresent.call(this, index, result);\n\treturn this.helpers.returnJsonArray(nodeOutput);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA,oBAAwD;AACxD,oBAAmC;AACnC,qBAAoD;AAE7C,MAAM,cAAiC;AAAA,EAC7C;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,aAAa;AAAA,MACZ,MAAM;AAAA,IACP;AAAA,IACA,UAAU;AAAA,IACV,SAAS;AAAA,IACT,gBAAgB;AAAA,MACf,MAAM;AAAA,QACL,UAAU,CAAC,YAAY;AAAA,QACvB,WAAW,CAAC,cAAc;AAAA,MAC3B;AAAA,IACD;AAAA,IACA,aAAa;AAAA,IACb,aAAa;AAAA,EACd;AAAA,EACA;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,aAAa;AAAA,IACb,SAAS,CAAC;AAAA,IACV,gBAAgB;AAAA,MACf,MAAM;AAAA,QACL,UAAU,CAAC,YAAY;AAAA,QACvB,WAAW,CAAC,cAAc;AAAA,MAC3B;AAAA,IACD;AAAA,IACA,SAAS;AAAA,MACR;AAAA,QACC,GAAG;AAAA,MACJ;AAAA,MACA;AAAA,QACC,GAAG;AAAA,MACJ;AAAA,MACA;AAAA,QACC,aAAa;AAAA,QACb,MAAM;AAAA,QACN,MAAM;AAAA,QACN,SAAS;AAAA,QACT,aAAa;AAAA,QACb,SAAS;AAAA,UACR;AAAA,YACC,MAAM;AAAA,YACN,aAAa;AAAA,YACb,OAAO;AAAA,UACR;AAAA,UACA;AAAA,YACC,MAAM;AAAA,YACN,aAAa;AAAA,YACb,OAAO;AAAA,UACR;AAAA,UACA;AAAA,YACC,MAAM;AAAA,YACN,aAAa;AAAA,YACb,OAAO;AAAA,UACR;AAAA,QACD;AAAA,MACD;AAAA,MACA;AAAA,QACC,aAAa;AAAA,QACb,MAAM;AAAA,QACN,MAAM;AAAA,QACN,SAAS;AAAA,QACT,aAAa;AAAA,QACb,SAAS;AAAA,UACR;AAAA,YACC,MAAM;AAAA,YACN,aAAa;AAAA,YACb,OAAO;AAAA,UACR;AAAA,UACA;AAAA,YACC,MAAM;AAAA,YACN,aAAa;AAAA,YACb,OAAO;AAAA,UACR;AAAA,UACA;AAAA,YACC,MAAM;AAAA,YACN,aAAa;AAAA,YACb,OAAO;AAAA,UACR;AAAA,QACD;AAAA,MACD;AAAA,IACD;AAAA,EACD;AACD;AAEA,eAAsB,QAErB,OACgC;AAChC,QAAM,SAAS,KAAK,iBAAiB,UAAU,OAAO,EAAE;AACxD,QAAM,mBAAmB,KAAK,iBAAiB,oBAAoB,KAAK;AAExE,QAAM,eAAe,CAAC,kBAAkB,mBAAmB,cAAc;AACzE,QAAM,gBAAgB,aAAa;AAAA,IAClC,CAAC,QAAQ,QAAS,iBAAiB,GAAG,IAAI,EAAE,GAAG,QAAQ,CAAC,GAAG,GAAG,iBAAiB,GAAG,EAAE,IAAI;AAAA,IACxF,CAAC;AAAA,EACF;AAEA,QAAM,SAAS,MAAM,mDAAoC,KAAK,MAAM,OAAO;AAAA,IAC1E,QAAQ;AAAA,IACR,MAAM;AAAA,IACN,MAAM;AAAA,MACL;AAAA,MACA;AAAA,IACD;AAAA,EACD,CAAC;AAED,QAAM,aAAa,iCAAmB,KAAK,MAAM,OAAO,MAAM;AAC9D,SAAO,KAAK,QAAQ,gBAAgB,UAAU;AAC/C;","names":[]}
|
|
@@ -23,6 +23,7 @@ __export(query_operation_exports, {
|
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(query_operation_exports);
|
|
25
25
|
var import_fields = require("../common/fields");
|
|
26
|
+
var import_output = require("../common/output.utils");
|
|
26
27
|
var import_session = require("../common/session.utils");
|
|
27
28
|
const description = [
|
|
28
29
|
{
|
|
@@ -58,23 +59,40 @@ const description = [
|
|
|
58
59
|
options: [
|
|
59
60
|
{
|
|
60
61
|
...import_fields.outputSchemaField
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
...import_fields.parseJsonOutputField
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
displayName: "Include Visual Analysis",
|
|
68
|
+
name: "includeVisualAnalysis",
|
|
69
|
+
type: "boolean",
|
|
70
|
+
default: false,
|
|
71
|
+
description: "Whether to analyze the web page visually when fulfilling the request"
|
|
61
72
|
}
|
|
62
73
|
]
|
|
63
74
|
}
|
|
64
75
|
];
|
|
65
76
|
async function execute(index) {
|
|
66
77
|
const prompt = this.getNodeParameter("prompt", index, "");
|
|
67
|
-
const additionalFields = this.getNodeParameter("additionalFields", index);
|
|
68
|
-
|
|
78
|
+
const additionalFields = this.getNodeParameter("additionalFields", index, {});
|
|
79
|
+
const outputSchema = additionalFields.outputSchema;
|
|
80
|
+
const includeVisualAnalysis = additionalFields.includeVisualAnalysis;
|
|
81
|
+
const result = await import_session.executeRequestWithSessionManagement.call(this, index, {
|
|
69
82
|
method: "POST",
|
|
70
83
|
path: "/sessions/{sessionId}/windows/{windowId}/page-query",
|
|
71
84
|
body: {
|
|
72
85
|
prompt,
|
|
73
86
|
configuration: {
|
|
74
|
-
|
|
87
|
+
experimental: {
|
|
88
|
+
includeVisualAnalysis: includeVisualAnalysis ? "enabled" : "disabled"
|
|
89
|
+
},
|
|
90
|
+
...outputSchema ? { outputSchema } : {}
|
|
75
91
|
}
|
|
76
92
|
}
|
|
77
93
|
});
|
|
94
|
+
const nodeOutput = import_output.parseJsonIfPresent.call(this, index, result);
|
|
95
|
+
return this.helpers.returnJsonArray(nodeOutput);
|
|
78
96
|
}
|
|
79
97
|
// Annotate the CommonJS export names for ESM import in node:
|
|
80
98
|
0 && (module.exports = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../nodes/Airtop/actions/extraction/query.operation.ts"],"sourcesContent":["import {\n\ttype IExecuteFunctions,\n\ttype INodeExecutionData,\n\ttype INodeProperties,\n} from 'n8n-workflow';\n\nimport { outputSchemaField } from '../common/fields';\nimport { executeRequestWithSessionManagement } from '../common/session.utils';\n\nexport const description: INodeProperties[] = [\n\t{\n\t\tdisplayName: 'Prompt',\n\t\tname: 'prompt',\n\t\ttype: 'string',\n\t\ttypeOptions: {\n\t\t\trows: 4,\n\t\t},\n\t\trequired: true,\n\t\tdefault: '',\n\t\tplaceholder: 'e.g. Is there a login form in this page?',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tresource: ['extraction'],\n\t\t\t\toperation: ['query'],\n\t\t\t},\n\t\t},\n\t\tdescription: 'The prompt to query the page content',\n\t},\n\t{\n\t\tdisplayName: 'Additional Fields',\n\t\tname: 'additionalFields',\n\t\ttype: 'collection',\n\t\tplaceholder: 'Add Field',\n\t\tdefault: {},\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tresource: ['extraction'],\n\t\t\t\toperation: ['query'],\n\t\t\t},\n\t\t},\n\t\toptions: [\n\t\t\t{\n\t\t\t\t...outputSchemaField,\n\t\t\t},\n\t\t],\n\t},\n];\n\nexport async function execute(\n\tthis: IExecuteFunctions,\n\tindex: number,\n): Promise<INodeExecutionData[]> {\n\tconst prompt = this.getNodeParameter('prompt', index, '') as string;\n\tconst additionalFields = this.getNodeParameter('additionalFields', index);\n\n\
|
|
1
|
+
{"version":3,"sources":["../../../../../nodes/Airtop/actions/extraction/query.operation.ts"],"sourcesContent":["import {\n\ttype IExecuteFunctions,\n\ttype INodeExecutionData,\n\ttype INodeProperties,\n} from 'n8n-workflow';\n\nimport { outputSchemaField, parseJsonOutputField } from '../common/fields';\nimport { parseJsonIfPresent } from '../common/output.utils';\nimport { executeRequestWithSessionManagement } from '../common/session.utils';\n\nexport const description: INodeProperties[] = [\n\t{\n\t\tdisplayName: 'Prompt',\n\t\tname: 'prompt',\n\t\ttype: 'string',\n\t\ttypeOptions: {\n\t\t\trows: 4,\n\t\t},\n\t\trequired: true,\n\t\tdefault: '',\n\t\tplaceholder: 'e.g. Is there a login form in this page?',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tresource: ['extraction'],\n\t\t\t\toperation: ['query'],\n\t\t\t},\n\t\t},\n\t\tdescription: 'The prompt to query the page content',\n\t},\n\t{\n\t\tdisplayName: 'Additional Fields',\n\t\tname: 'additionalFields',\n\t\ttype: 'collection',\n\t\tplaceholder: 'Add Field',\n\t\tdefault: {},\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tresource: ['extraction'],\n\t\t\t\toperation: ['query'],\n\t\t\t},\n\t\t},\n\t\toptions: [\n\t\t\t{\n\t\t\t\t...outputSchemaField,\n\t\t\t},\n\t\t\t{\n\t\t\t\t...parseJsonOutputField,\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Include Visual Analysis',\n\t\t\t\tname: 'includeVisualAnalysis',\n\t\t\t\ttype: 'boolean',\n\t\t\t\tdefault: false,\n\t\t\t\tdescription: 'Whether to analyze the web page visually when fulfilling the request',\n\t\t\t},\n\t\t],\n\t},\n];\n\nexport async function execute(\n\tthis: IExecuteFunctions,\n\tindex: number,\n): Promise<INodeExecutionData[]> {\n\tconst prompt = this.getNodeParameter('prompt', index, '') as string;\n\tconst additionalFields = this.getNodeParameter('additionalFields', index, {});\n\tconst outputSchema = additionalFields.outputSchema;\n\tconst includeVisualAnalysis = additionalFields.includeVisualAnalysis;\n\n\tconst result = await executeRequestWithSessionManagement.call(this, index, {\n\t\tmethod: 'POST',\n\t\tpath: '/sessions/{sessionId}/windows/{windowId}/page-query',\n\t\tbody: {\n\t\t\tprompt,\n\t\t\tconfiguration: {\n\t\t\t\texperimental: {\n\t\t\t\t\tincludeVisualAnalysis: includeVisualAnalysis ? 'enabled' : 'disabled',\n\t\t\t\t},\n\t\t\t\t...(outputSchema ? { outputSchema } : {}),\n\t\t\t},\n\t\t},\n\t});\n\n\tconst nodeOutput = parseJsonIfPresent.call(this, index, result);\n\treturn this.helpers.returnJsonArray(nodeOutput);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA,oBAAwD;AACxD,oBAAmC;AACnC,qBAAoD;AAE7C,MAAM,cAAiC;AAAA,EAC7C;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,aAAa;AAAA,MACZ,MAAM;AAAA,IACP;AAAA,IACA,UAAU;AAAA,IACV,SAAS;AAAA,IACT,aAAa;AAAA,IACb,gBAAgB;AAAA,MACf,MAAM;AAAA,QACL,UAAU,CAAC,YAAY;AAAA,QACvB,WAAW,CAAC,OAAO;AAAA,MACpB;AAAA,IACD;AAAA,IACA,aAAa;AAAA,EACd;AAAA,EACA;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,aAAa;AAAA,IACb,SAAS,CAAC;AAAA,IACV,gBAAgB;AAAA,MACf,MAAM;AAAA,QACL,UAAU,CAAC,YAAY;AAAA,QACvB,WAAW,CAAC,OAAO;AAAA,MACpB;AAAA,IACD;AAAA,IACA,SAAS;AAAA,MACR;AAAA,QACC,GAAG;AAAA,MACJ;AAAA,MACA;AAAA,QACC,GAAG;AAAA,MACJ;AAAA,MACA;AAAA,QACC,aAAa;AAAA,QACb,MAAM;AAAA,QACN,MAAM;AAAA,QACN,SAAS;AAAA,QACT,aAAa;AAAA,MACd;AAAA,IACD;AAAA,EACD;AACD;AAEA,eAAsB,QAErB,OACgC;AAChC,QAAM,SAAS,KAAK,iBAAiB,UAAU,OAAO,EAAE;AACxD,QAAM,mBAAmB,KAAK,iBAAiB,oBAAoB,OAAO,CAAC,CAAC;AAC5E,QAAM,eAAe,iBAAiB;AACtC,QAAM,wBAAwB,iBAAiB;AAE/C,QAAM,SAAS,MAAM,mDAAoC,KAAK,MAAM,OAAO;AAAA,IAC1E,QAAQ;AAAA,IACR,MAAM;AAAA,IACN,MAAM;AAAA,MACL;AAAA,MACA,eAAe;AAAA,QACd,cAAc;AAAA,UACb,uBAAuB,wBAAwB,YAAY;AAAA,QAC5D;AAAA,QACA,GAAI,eAAe,EAAE,aAAa,IAAI,CAAC;AAAA,MACxC;AAAA,IACD;AAAA,EACD,CAAC;AAED,QAAM,aAAa,iCAAmB,KAAK,MAAM,OAAO,MAAM;AAC9D,SAAO,KAAK,QAAQ,gBAAgB,UAAU;AAC/C;","names":[]}
|
|
@@ -23,11 +23,12 @@ __export(scrape_operation_exports, {
|
|
|
23
23
|
module.exports = __toCommonJS(scrape_operation_exports);
|
|
24
24
|
var import_session = require("../common/session.utils");
|
|
25
25
|
async function execute(index) {
|
|
26
|
-
|
|
26
|
+
const result = await import_session.executeRequestWithSessionManagement.call(this, index, {
|
|
27
27
|
method: "POST",
|
|
28
28
|
path: "/sessions/{sessionId}/windows/{windowId}/scrape-content",
|
|
29
29
|
body: {}
|
|
30
30
|
});
|
|
31
|
+
return this.helpers.returnJsonArray({ ...result });
|
|
31
32
|
}
|
|
32
33
|
// Annotate the CommonJS export names for ESM import in node:
|
|
33
34
|
0 && (module.exports = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../nodes/Airtop/actions/extraction/scrape.operation.ts"],"sourcesContent":["import type { IExecuteFunctions, INodeExecutionData } from 'n8n-workflow';\n\nimport { executeRequestWithSessionManagement } from '../common/session.utils';\n\nexport async function execute(\n\tthis: IExecuteFunctions,\n\tindex: number,\n): Promise<INodeExecutionData[]> {\n\
|
|
1
|
+
{"version":3,"sources":["../../../../../nodes/Airtop/actions/extraction/scrape.operation.ts"],"sourcesContent":["import type { IExecuteFunctions, INodeExecutionData } from 'n8n-workflow';\n\nimport { executeRequestWithSessionManagement } from '../common/session.utils';\n\nexport async function execute(\n\tthis: IExecuteFunctions,\n\tindex: number,\n): Promise<INodeExecutionData[]> {\n\tconst result = await executeRequestWithSessionManagement.call(this, index, {\n\t\tmethod: 'POST',\n\t\tpath: '/sessions/{sessionId}/windows/{windowId}/scrape-content',\n\t\tbody: {},\n\t});\n\n\treturn this.helpers.returnJsonArray({ ...result });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,qBAAoD;AAEpD,eAAsB,QAErB,OACgC;AAChC,QAAM,SAAS,MAAM,mDAAoC,KAAK,MAAM,OAAO;AAAA,IAC1E,QAAQ;AAAA,IACR,MAAM;AAAA,IACN,MAAM,CAAC;AAAA,EACR,CAAC;AAED,SAAO,KAAK,QAAQ,gBAAgB,EAAE,GAAG,OAAO,CAAC;AAClD;","names":[]}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var File_resource_exports = {};
|
|
30
|
+
__export(File_resource_exports, {
|
|
31
|
+
deleteFile: () => deleteFile,
|
|
32
|
+
description: () => description,
|
|
33
|
+
get: () => get,
|
|
34
|
+
getMany: () => getMany,
|
|
35
|
+
load: () => load,
|
|
36
|
+
upload: () => upload
|
|
37
|
+
});
|
|
38
|
+
module.exports = __toCommonJS(File_resource_exports);
|
|
39
|
+
var deleteFile = __toESM(require("./delete.operation"));
|
|
40
|
+
var get = __toESM(require("./get.operation"));
|
|
41
|
+
var getMany = __toESM(require("./getMany.operation"));
|
|
42
|
+
var load = __toESM(require("./load.operation"));
|
|
43
|
+
var upload = __toESM(require("./upload.operation"));
|
|
44
|
+
const description = [
|
|
45
|
+
{
|
|
46
|
+
displayName: "Operation",
|
|
47
|
+
name: "operation",
|
|
48
|
+
type: "options",
|
|
49
|
+
noDataExpression: true,
|
|
50
|
+
displayOptions: {
|
|
51
|
+
show: {
|
|
52
|
+
resource: ["file"]
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
options: [
|
|
56
|
+
{
|
|
57
|
+
name: "Delete",
|
|
58
|
+
value: "deleteFile",
|
|
59
|
+
description: "Delete an uploaded file",
|
|
60
|
+
action: "Delete a file"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
name: "Get",
|
|
64
|
+
value: "get",
|
|
65
|
+
description: "Get a details of an uploaded file",
|
|
66
|
+
action: "Get a file"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
name: "Get Many",
|
|
70
|
+
value: "getMany",
|
|
71
|
+
description: "Get details of multiple uploaded files",
|
|
72
|
+
action: "Get many files"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
name: "Load",
|
|
76
|
+
value: "load",
|
|
77
|
+
description: "Load a file into a session",
|
|
78
|
+
action: "Load a file"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
name: "Upload",
|
|
82
|
+
value: "upload",
|
|
83
|
+
description: "Upload a file into a session",
|
|
84
|
+
action: "Upload a file"
|
|
85
|
+
}
|
|
86
|
+
],
|
|
87
|
+
default: "getMany"
|
|
88
|
+
},
|
|
89
|
+
...deleteFile.description,
|
|
90
|
+
...get.description,
|
|
91
|
+
...getMany.description,
|
|
92
|
+
...load.description,
|
|
93
|
+
...upload.description
|
|
94
|
+
];
|
|
95
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
96
|
+
0 && (module.exports = {
|
|
97
|
+
deleteFile,
|
|
98
|
+
description,
|
|
99
|
+
get,
|
|
100
|
+
getMany,
|
|
101
|
+
load,
|
|
102
|
+
upload
|
|
103
|
+
});
|
|
104
|
+
//# sourceMappingURL=File.resource.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../nodes/Airtop/actions/file/File.resource.ts"],"sourcesContent":["import type { INodeProperties } from 'n8n-workflow';\n\nimport * as deleteFile from './delete.operation';\nimport * as get from './get.operation';\nimport * as getMany from './getMany.operation';\nimport * as load from './load.operation';\nimport * as upload from './upload.operation';\n\nexport { deleteFile, get, getMany, upload, load };\n\nexport const description: INodeProperties[] = [\n\t{\n\t\tdisplayName: 'Operation',\n\t\tname: 'operation',\n\t\ttype: 'options',\n\t\tnoDataExpression: true,\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tresource: ['file'],\n\t\t\t},\n\t\t},\n\t\toptions: [\n\t\t\t{\n\t\t\t\tname: 'Delete',\n\t\t\t\tvalue: 'deleteFile',\n\t\t\t\tdescription: 'Delete an uploaded file',\n\t\t\t\taction: 'Delete a file',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'Get',\n\t\t\t\tvalue: 'get',\n\t\t\t\tdescription: 'Get a details of an uploaded file',\n\t\t\t\taction: 'Get a file',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'Get Many',\n\t\t\t\tvalue: 'getMany',\n\t\t\t\tdescription: 'Get details of multiple uploaded files',\n\t\t\t\taction: 'Get many files',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'Load',\n\t\t\t\tvalue: 'load',\n\t\t\t\tdescription: 'Load a file into a session',\n\t\t\t\taction: 'Load a file',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'Upload',\n\t\t\t\tvalue: 'upload',\n\t\t\t\tdescription: 'Upload a file into a session',\n\t\t\t\taction: 'Upload a file',\n\t\t\t},\n\t\t],\n\t\tdefault: 'getMany',\n\t},\n\t...deleteFile.description,\n\t...get.description,\n\t...getMany.description,\n\t...load.description,\n\t...upload.description,\n];\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,iBAA4B;AAC5B,UAAqB;AACrB,cAAyB;AACzB,WAAsB;AACtB,aAAwB;AAIjB,MAAM,cAAiC;AAAA,EAC7C;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,kBAAkB;AAAA,IAClB,gBAAgB;AAAA,MACf,MAAM;AAAA,QACL,UAAU,CAAC,MAAM;AAAA,MAClB;AAAA,IACD;AAAA,IACA,SAAS;AAAA,MACR;AAAA,QACC,MAAM;AAAA,QACN,OAAO;AAAA,QACP,aAAa;AAAA,QACb,QAAQ;AAAA,MACT;AAAA,MACA;AAAA,QACC,MAAM;AAAA,QACN,OAAO;AAAA,QACP,aAAa;AAAA,QACb,QAAQ;AAAA,MACT;AAAA,MACA;AAAA,QACC,MAAM;AAAA,QACN,OAAO;AAAA,QACP,aAAa;AAAA,QACb,QAAQ;AAAA,MACT;AAAA,MACA;AAAA,QACC,MAAM;AAAA,QACN,OAAO;AAAA,QACP,aAAa;AAAA,QACb,QAAQ;AAAA,MACT;AAAA,MACA;AAAA,QACC,MAAM;AAAA,QACN,OAAO;AAAA,QACP,aAAa;AAAA,QACb,QAAQ;AAAA,MACT;AAAA,IACD;AAAA,IACA,SAAS;AAAA,EACV;AAAA,EACA,GAAG,WAAW;AAAA,EACd,GAAG,IAAI;AAAA,EACP,GAAG,QAAQ;AAAA,EACX,GAAG,KAAK;AAAA,EACR,GAAG,OAAO;AACX;","names":[]}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var delete_operation_exports = {};
|
|
20
|
+
__export(delete_operation_exports, {
|
|
21
|
+
description: () => description,
|
|
22
|
+
execute: () => execute
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(delete_operation_exports);
|
|
25
|
+
var import_n8n_workflow = require("n8n-workflow");
|
|
26
|
+
var import_constants = require("../../constants");
|
|
27
|
+
var import_transport = require("../../transport");
|
|
28
|
+
const description = [
|
|
29
|
+
{
|
|
30
|
+
displayName: "File ID",
|
|
31
|
+
name: "fileId",
|
|
32
|
+
type: "string",
|
|
33
|
+
default: "",
|
|
34
|
+
required: true,
|
|
35
|
+
description: "ID of the file to delete",
|
|
36
|
+
displayOptions: {
|
|
37
|
+
show: {
|
|
38
|
+
resource: ["file"],
|
|
39
|
+
operation: ["deleteFile"]
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
];
|
|
44
|
+
async function execute(index) {
|
|
45
|
+
const fileId = this.getNodeParameter("fileId", index, "");
|
|
46
|
+
if (!fileId) {
|
|
47
|
+
throw new import_n8n_workflow.NodeOperationError(
|
|
48
|
+
this.getNode(),
|
|
49
|
+
import_constants.ERROR_MESSAGES.REQUIRED_PARAMETER.replace("{{field}}", "File ID")
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
await import_transport.apiRequest.call(this, "DELETE", `/files/${fileId}`);
|
|
53
|
+
return this.helpers.returnJsonArray({ data: { message: "File deleted successfully" } });
|
|
54
|
+
}
|
|
55
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
56
|
+
0 && (module.exports = {
|
|
57
|
+
description,
|
|
58
|
+
execute
|
|
59
|
+
});
|
|
60
|
+
//# sourceMappingURL=delete.operation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../nodes/Airtop/actions/file/delete.operation.ts"],"sourcesContent":["import type { IExecuteFunctions, INodeExecutionData, INodeProperties } from 'n8n-workflow';\nimport { NodeOperationError } from 'n8n-workflow';\n\nimport { ERROR_MESSAGES } from '../../constants';\nimport { apiRequest } from '../../transport';\n\nexport const description: INodeProperties[] = [\n\t{\n\t\tdisplayName: 'File ID',\n\t\tname: 'fileId',\n\t\ttype: 'string',\n\t\tdefault: '',\n\t\trequired: true,\n\t\tdescription: 'ID of the file to delete',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tresource: ['file'],\n\t\t\t\toperation: ['deleteFile'],\n\t\t\t},\n\t\t},\n\t},\n];\n\nexport async function execute(\n\tthis: IExecuteFunctions,\n\tindex: number,\n): Promise<INodeExecutionData[]> {\n\tconst fileId = this.getNodeParameter('fileId', index, '') as string;\n\n\tif (!fileId) {\n\t\tthrow new NodeOperationError(\n\t\t\tthis.getNode(),\n\t\t\tERROR_MESSAGES.REQUIRED_PARAMETER.replace('{{field}}', 'File ID'),\n\t\t);\n\t}\n\n\tawait apiRequest.call(this, 'DELETE', `/files/${fileId}`);\n\n\treturn this.helpers.returnJsonArray({ data: { message: 'File deleted successfully' } });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,0BAAmC;AAEnC,uBAA+B;AAC/B,uBAA2B;AAEpB,MAAM,cAAiC;AAAA,EAC7C;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,IACT,UAAU;AAAA,IACV,aAAa;AAAA,IACb,gBAAgB;AAAA,MACf,MAAM;AAAA,QACL,UAAU,CAAC,MAAM;AAAA,QACjB,WAAW,CAAC,YAAY;AAAA,MACzB;AAAA,IACD;AAAA,EACD;AACD;AAEA,eAAsB,QAErB,OACgC;AAChC,QAAM,SAAS,KAAK,iBAAiB,UAAU,OAAO,EAAE;AAExD,MAAI,CAAC,QAAQ;AACZ,UAAM,IAAI;AAAA,MACT,KAAK,QAAQ;AAAA,MACb,gCAAe,mBAAmB,QAAQ,aAAa,SAAS;AAAA,IACjE;AAAA,EACD;AAEA,QAAM,4BAAW,KAAK,MAAM,UAAU,UAAU,MAAM,EAAE;AAExD,SAAO,KAAK,QAAQ,gBAAgB,EAAE,MAAM,EAAE,SAAS,4BAA4B,EAAE,CAAC;AACvF;","names":[]}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var get_operation_exports = {};
|
|
20
|
+
__export(get_operation_exports, {
|
|
21
|
+
description: () => description,
|
|
22
|
+
execute: () => execute
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(get_operation_exports);
|
|
25
|
+
var import_n8n_workflow = require("n8n-workflow");
|
|
26
|
+
var import_constants = require("../../constants");
|
|
27
|
+
var import_transport = require("../../transport");
|
|
28
|
+
const displayOptions = {
|
|
29
|
+
show: {
|
|
30
|
+
resource: ["file"],
|
|
31
|
+
operation: ["get"]
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
const description = [
|
|
35
|
+
{
|
|
36
|
+
displayName: "File ID",
|
|
37
|
+
name: "fileId",
|
|
38
|
+
type: "string",
|
|
39
|
+
default: "",
|
|
40
|
+
required: true,
|
|
41
|
+
description: "ID of the file to retrieve",
|
|
42
|
+
displayOptions
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
displayName: "Output Binary File",
|
|
46
|
+
name: "outputBinaryFile",
|
|
47
|
+
type: "boolean",
|
|
48
|
+
default: false,
|
|
49
|
+
description: "Whether to output the file in binary format if the file is ready for download",
|
|
50
|
+
displayOptions
|
|
51
|
+
}
|
|
52
|
+
];
|
|
53
|
+
async function execute(index) {
|
|
54
|
+
const fileId = this.getNodeParameter("fileId", index, "");
|
|
55
|
+
const outputBinaryFile = this.getNodeParameter("outputBinaryFile", index, false);
|
|
56
|
+
if (!fileId) {
|
|
57
|
+
throw new import_n8n_workflow.NodeOperationError(
|
|
58
|
+
this.getNode(),
|
|
59
|
+
import_constants.ERROR_MESSAGES.REQUIRED_PARAMETER.replace("{{field}}", "File ID")
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
const response = await import_transport.apiRequest.call(
|
|
63
|
+
this,
|
|
64
|
+
"GET",
|
|
65
|
+
`/files/${fileId}`
|
|
66
|
+
);
|
|
67
|
+
const { fileName = "", downloadUrl = "", status = "" } = response?.data ?? {};
|
|
68
|
+
if (outputBinaryFile && downloadUrl && status === "available") {
|
|
69
|
+
const buffer = await this.helpers.httpRequest({
|
|
70
|
+
url: downloadUrl,
|
|
71
|
+
json: false,
|
|
72
|
+
encoding: "arraybuffer"
|
|
73
|
+
});
|
|
74
|
+
const file = await this.helpers.prepareBinaryData(buffer, fileName);
|
|
75
|
+
return [
|
|
76
|
+
{
|
|
77
|
+
json: {
|
|
78
|
+
...response
|
|
79
|
+
},
|
|
80
|
+
binary: { data: file }
|
|
81
|
+
}
|
|
82
|
+
];
|
|
83
|
+
}
|
|
84
|
+
return this.helpers.returnJsonArray({ ...response });
|
|
85
|
+
}
|
|
86
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
87
|
+
0 && (module.exports = {
|
|
88
|
+
description,
|
|
89
|
+
execute
|
|
90
|
+
});
|
|
91
|
+
//# sourceMappingURL=get.operation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../nodes/Airtop/actions/file/get.operation.ts"],"sourcesContent":["import { NodeOperationError } from 'n8n-workflow';\nimport type { IExecuteFunctions, INodeExecutionData, INodeProperties } from 'n8n-workflow';\n\nimport { ERROR_MESSAGES } from '../../constants';\nimport { apiRequest } from '../../transport';\nimport type { IAirtopResponseWithFiles } from '../../transport/types';\n\nconst displayOptions = {\n\tshow: {\n\t\tresource: ['file'],\n\t\toperation: ['get'],\n\t},\n};\n\nexport const description: INodeProperties[] = [\n\t{\n\t\tdisplayName: 'File ID',\n\t\tname: 'fileId',\n\t\ttype: 'string',\n\t\tdefault: '',\n\t\trequired: true,\n\t\tdescription: 'ID of the file to retrieve',\n\t\tdisplayOptions,\n\t},\n\t{\n\t\tdisplayName: 'Output Binary File',\n\t\tname: 'outputBinaryFile',\n\t\ttype: 'boolean',\n\t\tdefault: false,\n\t\tdescription: 'Whether to output the file in binary format if the file is ready for download',\n\t\tdisplayOptions,\n\t},\n];\n\nexport async function execute(\n\tthis: IExecuteFunctions,\n\tindex: number,\n): Promise<INodeExecutionData[]> {\n\tconst fileId = this.getNodeParameter('fileId', index, '') as string;\n\tconst outputBinaryFile = this.getNodeParameter('outputBinaryFile', index, false);\n\n\tif (!fileId) {\n\t\tthrow new NodeOperationError(\n\t\t\tthis.getNode(),\n\t\t\tERROR_MESSAGES.REQUIRED_PARAMETER.replace('{{field}}', 'File ID'),\n\t\t);\n\t}\n\n\tconst response = (await apiRequest.call(\n\t\tthis,\n\t\t'GET',\n\t\t`/files/${fileId}`,\n\t)) as IAirtopResponseWithFiles;\n\n\tconst { fileName = '', downloadUrl = '', status = '' } = response?.data ?? {};\n\n\t// Handle binary file output\n\tif (outputBinaryFile && downloadUrl && status === 'available') {\n\t\tconst buffer = (await this.helpers.httpRequest({\n\t\t\turl: downloadUrl,\n\t\t\tjson: false,\n\t\t\tencoding: 'arraybuffer',\n\t\t})) as Buffer;\n\t\tconst file = await this.helpers.prepareBinaryData(buffer, fileName);\n\t\treturn [\n\t\t\t{\n\t\t\t\tjson: {\n\t\t\t\t\t...response,\n\t\t\t\t},\n\t\t\t\tbinary: { data: file },\n\t\t\t},\n\t\t];\n\t}\n\n\treturn this.helpers.returnJsonArray({ ...response });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAmC;AAGnC,uBAA+B;AAC/B,uBAA2B;AAG3B,MAAM,iBAAiB;AAAA,EACtB,MAAM;AAAA,IACL,UAAU,CAAC,MAAM;AAAA,IACjB,WAAW,CAAC,KAAK;AAAA,EAClB;AACD;AAEO,MAAM,cAAiC;AAAA,EAC7C;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,IACT,UAAU;AAAA,IACV,aAAa;AAAA,IACb;AAAA,EACD;AAAA,EACA;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,IACT,aAAa;AAAA,IACb;AAAA,EACD;AACD;AAEA,eAAsB,QAErB,OACgC;AAChC,QAAM,SAAS,KAAK,iBAAiB,UAAU,OAAO,EAAE;AACxD,QAAM,mBAAmB,KAAK,iBAAiB,oBAAoB,OAAO,KAAK;AAE/E,MAAI,CAAC,QAAQ;AACZ,UAAM,IAAI;AAAA,MACT,KAAK,QAAQ;AAAA,MACb,gCAAe,mBAAmB,QAAQ,aAAa,SAAS;AAAA,IACjE;AAAA,EACD;AAEA,QAAM,WAAY,MAAM,4BAAW;AAAA,IAClC;AAAA,IACA;AAAA,IACA,UAAU,MAAM;AAAA,EACjB;AAEA,QAAM,EAAE,WAAW,IAAI,cAAc,IAAI,SAAS,GAAG,IAAI,UAAU,QAAQ,CAAC;AAG5E,MAAI,oBAAoB,eAAe,WAAW,aAAa;AAC9D,UAAM,SAAU,MAAM,KAAK,QAAQ,YAAY;AAAA,MAC9C,KAAK;AAAA,MACL,MAAM;AAAA,MACN,UAAU;AAAA,IACX,CAAC;AACD,UAAM,OAAO,MAAM,KAAK,QAAQ,kBAAkB,QAAQ,QAAQ;AAClE,WAAO;AAAA,MACN;AAAA,QACC,MAAM;AAAA,UACL,GAAG;AAAA,QACJ;AAAA,QACA,QAAQ,EAAE,MAAM,KAAK;AAAA,MACtB;AAAA,IACD;AAAA,EACD;AAEA,SAAO,KAAK,QAAQ,gBAAgB,EAAE,GAAG,SAAS,CAAC;AACpD;","names":[]}
|
|
@@ -0,0 +1,100 @@
|
|
|
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 getMany_operation_exports = {};
|
|
20
|
+
__export(getMany_operation_exports, {
|
|
21
|
+
description: () => description,
|
|
22
|
+
execute: () => execute
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(getMany_operation_exports);
|
|
25
|
+
var import_helpers = require("./helpers");
|
|
26
|
+
var import_utilities = require("../../../../utils/utilities");
|
|
27
|
+
var import_transport = require("../../transport");
|
|
28
|
+
const displayOptions = {
|
|
29
|
+
show: {
|
|
30
|
+
resource: ["file"],
|
|
31
|
+
operation: ["getMany"]
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
const description = [
|
|
35
|
+
{
|
|
36
|
+
displayName: "Return All",
|
|
37
|
+
name: "returnAll",
|
|
38
|
+
type: "boolean",
|
|
39
|
+
default: false,
|
|
40
|
+
description: "Whether to return all results or only up to a given limit",
|
|
41
|
+
displayOptions
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
displayName: "Limit",
|
|
45
|
+
name: "limit",
|
|
46
|
+
type: "number",
|
|
47
|
+
displayOptions: {
|
|
48
|
+
show: {
|
|
49
|
+
resource: ["file"],
|
|
50
|
+
operation: ["getMany"],
|
|
51
|
+
returnAll: [false]
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
typeOptions: {
|
|
55
|
+
minValue: 1,
|
|
56
|
+
maxValue: 100
|
|
57
|
+
},
|
|
58
|
+
default: 10,
|
|
59
|
+
description: "Max number of results to return"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
displayName: "Session IDs",
|
|
63
|
+
name: "sessionIds",
|
|
64
|
+
type: "string",
|
|
65
|
+
default: "",
|
|
66
|
+
description: 'Comma-separated list of <a href="https://docs.airtop.ai/api-reference/airtop-api/sessions/create" target="_blank">Session IDs</a> to filter files by. When empty, all files from all sessions will be returned.',
|
|
67
|
+
placeholder: "e.g. 6aac6f73-bd89-4a76-ab32-5a6c422e8b0b, a13c6f73-bd89-4a76-ab32-5a6c422e8224",
|
|
68
|
+
displayOptions
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
displayName: "Output Files in Single Item",
|
|
72
|
+
name: "outputSingleItem",
|
|
73
|
+
type: "boolean",
|
|
74
|
+
default: true,
|
|
75
|
+
description: "Whether to output one item containing all files or output each file as a separate item",
|
|
76
|
+
displayOptions
|
|
77
|
+
}
|
|
78
|
+
];
|
|
79
|
+
async function execute(index) {
|
|
80
|
+
const returnAll = this.getNodeParameter("returnAll", index, false);
|
|
81
|
+
const limit = this.getNodeParameter("limit", index, 10);
|
|
82
|
+
const sessionIds = this.getNodeParameter("sessionIds", index, "");
|
|
83
|
+
const outputSingleItem = this.getNodeParameter("outputSingleItem", index, true);
|
|
84
|
+
const endpoint = "/files";
|
|
85
|
+
let files = [];
|
|
86
|
+
const responseData = returnAll ? await import_helpers.requestAllFiles.call(this, sessionIds) : await import_transport.apiRequest.call(this, "GET", endpoint, {}, { sessionIds, limit });
|
|
87
|
+
if (responseData.data?.files && Array.isArray(responseData.data?.files)) {
|
|
88
|
+
files = responseData.data.files;
|
|
89
|
+
}
|
|
90
|
+
if (outputSingleItem) {
|
|
91
|
+
return this.helpers.returnJsonArray({ ...responseData });
|
|
92
|
+
}
|
|
93
|
+
return (0, import_utilities.wrapData)(files);
|
|
94
|
+
}
|
|
95
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
96
|
+
0 && (module.exports = {
|
|
97
|
+
description,
|
|
98
|
+
execute
|
|
99
|
+
});
|
|
100
|
+
//# sourceMappingURL=getMany.operation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../nodes/Airtop/actions/file/getMany.operation.ts"],"sourcesContent":["import {\n\ttype IExecuteFunctions,\n\ttype INodeExecutionData,\n\ttype INodeProperties,\n} from 'n8n-workflow';\n\nimport { requestAllFiles } from './helpers';\nimport { wrapData } from '../../../../utils/utilities';\nimport { apiRequest } from '../../transport';\nimport type { IAirtopResponse } from '../../transport/types';\n\nconst displayOptions = {\n\tshow: {\n\t\tresource: ['file'],\n\t\toperation: ['getMany'],\n\t},\n};\n\nexport const description: INodeProperties[] = [\n\t{\n\t\tdisplayName: 'Return All',\n\t\tname: 'returnAll',\n\t\ttype: 'boolean',\n\t\tdefault: false,\n\t\tdescription: 'Whether to return all results or only up to a given limit',\n\t\tdisplayOptions,\n\t},\n\t{\n\t\tdisplayName: 'Limit',\n\t\tname: 'limit',\n\t\ttype: 'number',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tresource: ['file'],\n\t\t\t\toperation: ['getMany'],\n\t\t\t\treturnAll: [false],\n\t\t\t},\n\t\t},\n\t\ttypeOptions: {\n\t\t\tminValue: 1,\n\t\t\tmaxValue: 100,\n\t\t},\n\t\tdefault: 10,\n\t\tdescription: 'Max number of results to return',\n\t},\n\t{\n\t\tdisplayName: 'Session IDs',\n\t\tname: 'sessionIds',\n\t\ttype: 'string',\n\t\tdefault: '',\n\t\tdescription:\n\t\t\t'Comma-separated list of <a href=\"https://docs.airtop.ai/api-reference/airtop-api/sessions/create\" target=\"_blank\">Session IDs</a> to filter files by. When empty, all files from all sessions will be returned.',\n\t\tplaceholder: 'e.g. 6aac6f73-bd89-4a76-ab32-5a6c422e8b0b, a13c6f73-bd89-4a76-ab32-5a6c422e8224',\n\t\tdisplayOptions,\n\t},\n\t{\n\t\tdisplayName: 'Output Files in Single Item',\n\t\tname: 'outputSingleItem',\n\t\ttype: 'boolean',\n\t\tdefault: true,\n\t\tdescription:\n\t\t\t'Whether to output one item containing all files or output each file as a separate item',\n\t\tdisplayOptions,\n\t},\n];\n\nexport async function execute(\n\tthis: IExecuteFunctions,\n\tindex: number,\n): Promise<INodeExecutionData[]> {\n\tconst returnAll = this.getNodeParameter('returnAll', index, false) as boolean;\n\tconst limit = this.getNodeParameter('limit', index, 10);\n\tconst sessionIds = this.getNodeParameter('sessionIds', index, '') as string;\n\tconst outputSingleItem = this.getNodeParameter('outputSingleItem', index, true) as boolean;\n\n\tconst endpoint = '/files';\n\tlet files: IAirtopResponse[] = [];\n\n\tconst responseData = returnAll\n\t\t? await requestAllFiles.call(this, sessionIds)\n\t\t: await apiRequest.call(this, 'GET', endpoint, {}, { sessionIds, limit });\n\n\tif (responseData.data?.files && Array.isArray(responseData.data?.files)) {\n\t\tfiles = responseData.data.files;\n\t}\n\n\t/**\n\t * Returns the files in one of two formats:\n\t * - A single JSON item containing an array of all files (when outputSingleItem = true)\n\t * - Multiple JSON items, one per file\n\t * Data structure reference: https://docs.n8n.io/courses/level-two/chapter-1/#data-structure-of-n8n\n\t */\n\tif (outputSingleItem) {\n\t\treturn this.helpers.returnJsonArray({ ...responseData });\n\t}\n\treturn wrapData(files);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA,qBAAgC;AAChC,uBAAyB;AACzB,uBAA2B;AAG3B,MAAM,iBAAiB;AAAA,EACtB,MAAM;AAAA,IACL,UAAU,CAAC,MAAM;AAAA,IACjB,WAAW,CAAC,SAAS;AAAA,EACtB;AACD;AAEO,MAAM,cAAiC;AAAA,EAC7C;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,IACT,aAAa;AAAA,IACb;AAAA,EACD;AAAA,EACA;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,gBAAgB;AAAA,MACf,MAAM;AAAA,QACL,UAAU,CAAC,MAAM;AAAA,QACjB,WAAW,CAAC,SAAS;AAAA,QACrB,WAAW,CAAC,KAAK;AAAA,MAClB;AAAA,IACD;AAAA,IACA,aAAa;AAAA,MACZ,UAAU;AAAA,MACV,UAAU;AAAA,IACX;AAAA,IACA,SAAS;AAAA,IACT,aAAa;AAAA,EACd;AAAA,EACA;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,IACT,aACC;AAAA,IACD,aAAa;AAAA,IACb;AAAA,EACD;AAAA,EACA;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,IACT,aACC;AAAA,IACD;AAAA,EACD;AACD;AAEA,eAAsB,QAErB,OACgC;AAChC,QAAM,YAAY,KAAK,iBAAiB,aAAa,OAAO,KAAK;AACjE,QAAM,QAAQ,KAAK,iBAAiB,SAAS,OAAO,EAAE;AACtD,QAAM,aAAa,KAAK,iBAAiB,cAAc,OAAO,EAAE;AAChE,QAAM,mBAAmB,KAAK,iBAAiB,oBAAoB,OAAO,IAAI;AAE9E,QAAM,WAAW;AACjB,MAAI,QAA2B,CAAC;AAEhC,QAAM,eAAe,YAClB,MAAM,+BAAgB,KAAK,MAAM,UAAU,IAC3C,MAAM,4BAAW,KAAK,MAAM,OAAO,UAAU,CAAC,GAAG,EAAE,YAAY,MAAM,CAAC;AAEzE,MAAI,aAAa,MAAM,SAAS,MAAM,QAAQ,aAAa,MAAM,KAAK,GAAG;AACxE,YAAQ,aAAa,KAAK;AAAA,EAC3B;AAQA,MAAI,kBAAkB;AACrB,WAAO,KAAK,QAAQ,gBAAgB,EAAE,GAAG,aAAa,CAAC;AAAA,EACxD;AACA,aAAO,2BAAS,KAAK;AACtB;","names":[]}
|