n8n-nodes-base 1.93.0 → 1.94.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/credentials/AirtopApi.credentials.js +2 -1
- package/dist/credentials/AirtopApi.credentials.js.map +1 -1
- package/dist/credentials/JinaAiApi.credentials.js +1 -1
- package/dist/credentials/JinaAiApi.credentials.js.map +1 -1
- package/dist/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/Jira/Jira.node.js +34 -15
- package/dist/nodes/Jira/Jira.node.js.map +1 -1
- package/dist/nodes/Merge/Merge.node.js +3 -2
- package/dist/nodes/Merge/Merge.node.js.map +1 -1
- package/dist/nodes/Merge/v3/actions/mode/combineBySql.js +42 -4
- package/dist/nodes/Merge/v3/actions/mode/combineBySql.js.map +1 -1
- package/dist/nodes/Merge/v3/actions/versionDescription.js +1 -1
- package/dist/nodes/Merge/v3/actions/versionDescription.js.map +1 -1
- package/dist/nodes/Microsoft/SharePoint/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 +1 -1
- package/dist/types/nodes.json +8 -9
- package/package.json +6 -7
- 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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../nodes/Airtop/actions/window/Window.resource.ts"],"sourcesContent":["import type { INodeProperties } from 'n8n-workflow';\n\nimport * as close from './close.operation';\nimport * as create from './create.operation';\nimport * as load from './load.operation';\nimport * as takeScreenshot from './takeScreenshot.operation';\nimport { sessionIdField, windowIdField } from '../common/fields';\n\nexport { create, close, takeScreenshot, load };\n\nexport const description: INodeProperties[] = [\n\t{\n\t\tdisplayName: 'Operation',\n\t\tname: 'operation',\n\t\ttype: 'options',\n\t\tnoDataExpression: true,\n\t\ttypeOptions: {\n\t\t\tsortable: false,\n\t\t},\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tresource: ['window'],\n\t\t\t},\n\t\t},\n\t\toptions: [\n\t\t\t{\n\t\t\t\tname: 'Create a New Browser Window',\n\t\t\t\tvalue: 'create',\n\t\t\t\tdescription: 'Create a new browser window inside a session. Can load a URL when created.',\n\t\t\t\taction: 'Create a window',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'Load URL',\n\t\t\t\tvalue: 'load',\n\t\t\t\tdescription: 'Load a URL in an existing window',\n\t\t\t\taction: 'Load a page',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'Take Screenshot',\n\t\t\t\tvalue: 'takeScreenshot',\n\t\t\t\tdescription: 'Take a screenshot of the current window',\n\t\t\t\taction: 'Take screenshot',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'Close Window',\n\t\t\t\tvalue: 'close',\n\t\t\t\tdescription: 'Close a window inside a session',\n\t\t\t\taction: 'Close a window',\n\t\t\t},\n\t\t],\n\t\tdefault: 'create',\n\t},\n\t{\n\t\t...sessionIdField,\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tresource: ['window'],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\t...windowIdField,\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tresource: ['window'],\n\t\t\t\toperation: ['close', 'takeScreenshot', 'load'],\n\t\t\t},\n\t\t},\n\t},\n\t...create.description,\n\t...load.description,\n];\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,YAAuB;AACvB,aAAwB;AACxB,WAAsB;AACtB,qBAAgC;AAChC,oBAA8C;AAIvC,MAAM,cAAiC;AAAA,EAC7C;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,kBAAkB;AAAA,IAClB,aAAa;AAAA,MACZ,UAAU;AAAA,IACX;AAAA,IACA,gBAAgB;AAAA,MACf,MAAM;AAAA,QACL,UAAU,CAAC,QAAQ;AAAA,MACpB;AAAA,IACD;AAAA,IACA,SAAS;AAAA,MACR;AAAA,QACC,MAAM;AAAA,QACN,OAAO;AAAA,QACP,aAAa;AAAA,QACb,QAAQ;AAAA,MACT;AAAA,MACA;AAAA,QACC,MAAM;AAAA,QACN,OAAO;AAAA,QACP,aAAa;AAAA,QACb,QAAQ;AAAA,MACT;AAAA,MACA;AAAA,QACC,MAAM;AAAA,QACN,OAAO;AAAA,QACP,aAAa;AAAA,QACb,QAAQ;AAAA,MACT;AAAA,MACA;AAAA,QACC,MAAM;AAAA,QACN,OAAO;AAAA,QACP,aAAa;AAAA,QACb,QAAQ;AAAA,MACT;AAAA,IACD;AAAA,IACA,SAAS;AAAA,EACV;AAAA,EACA;AAAA,IACC,GAAG;AAAA,IACH,gBAAgB;AAAA,MACf,MAAM;AAAA,QACL,UAAU,CAAC,QAAQ;AAAA,MACpB;AAAA,IACD;AAAA,EACD;AAAA,EACA;AAAA,IACC,GAAG;AAAA,IACH,gBAAgB;AAAA,MACf,MAAM;AAAA,QACL,UAAU,CAAC,QAAQ;AAAA,QACnB,WAAW,CAAC,SAAS,kBAAkB,MAAM;AAAA,MAC9C;AAAA,IACD;AAAA,EACD;AAAA,EACA,GAAG,OAAO;AAAA,EACV,GAAG,KAAK;
|
|
1
|
+
{"version":3,"sources":["../../../../../nodes/Airtop/actions/window/Window.resource.ts"],"sourcesContent":["import type { INodeProperties } from 'n8n-workflow';\n\nimport * as close from './close.operation';\nimport * as create from './create.operation';\nimport * as load from './load.operation';\nimport * as takeScreenshot from './takeScreenshot.operation';\nimport { sessionIdField, windowIdField } from '../common/fields';\n\nexport { create, close, takeScreenshot, load };\n\nexport const description: INodeProperties[] = [\n\t{\n\t\tdisplayName: 'Operation',\n\t\tname: 'operation',\n\t\ttype: 'options',\n\t\tnoDataExpression: true,\n\t\ttypeOptions: {\n\t\t\tsortable: false,\n\t\t},\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tresource: ['window'],\n\t\t\t},\n\t\t},\n\t\toptions: [\n\t\t\t{\n\t\t\t\tname: 'Create a New Browser Window',\n\t\t\t\tvalue: 'create',\n\t\t\t\tdescription: 'Create a new browser window inside a session. Can load a URL when created.',\n\t\t\t\taction: 'Create a window',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'Load URL',\n\t\t\t\tvalue: 'load',\n\t\t\t\tdescription: 'Load a URL in an existing window',\n\t\t\t\taction: 'Load a page',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'Take Screenshot',\n\t\t\t\tvalue: 'takeScreenshot',\n\t\t\t\tdescription: 'Take a screenshot of the current window',\n\t\t\t\taction: 'Take screenshot',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'Close Window',\n\t\t\t\tvalue: 'close',\n\t\t\t\tdescription: 'Close a window inside a session',\n\t\t\t\taction: 'Close a window',\n\t\t\t},\n\t\t],\n\t\tdefault: 'create',\n\t},\n\t{\n\t\t...sessionIdField,\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tresource: ['window'],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\t...windowIdField,\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tresource: ['window'],\n\t\t\t\toperation: ['close', 'takeScreenshot', 'load'],\n\t\t\t},\n\t\t},\n\t},\n\t...create.description,\n\t...load.description,\n\t...takeScreenshot.description,\n];\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,YAAuB;AACvB,aAAwB;AACxB,WAAsB;AACtB,qBAAgC;AAChC,oBAA8C;AAIvC,MAAM,cAAiC;AAAA,EAC7C;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,kBAAkB;AAAA,IAClB,aAAa;AAAA,MACZ,UAAU;AAAA,IACX;AAAA,IACA,gBAAgB;AAAA,MACf,MAAM;AAAA,QACL,UAAU,CAAC,QAAQ;AAAA,MACpB;AAAA,IACD;AAAA,IACA,SAAS;AAAA,MACR;AAAA,QACC,MAAM;AAAA,QACN,OAAO;AAAA,QACP,aAAa;AAAA,QACb,QAAQ;AAAA,MACT;AAAA,MACA;AAAA,QACC,MAAM;AAAA,QACN,OAAO;AAAA,QACP,aAAa;AAAA,QACb,QAAQ;AAAA,MACT;AAAA,MACA;AAAA,QACC,MAAM;AAAA,QACN,OAAO;AAAA,QACP,aAAa;AAAA,QACb,QAAQ;AAAA,MACT;AAAA,MACA;AAAA,QACC,MAAM;AAAA,QACN,OAAO;AAAA,QACP,aAAa;AAAA,QACb,QAAQ;AAAA,MACT;AAAA,IACD;AAAA,IACA,SAAS;AAAA,EACV;AAAA,EACA;AAAA,IACC,GAAG;AAAA,IACH,gBAAgB;AAAA,MACf,MAAM;AAAA,QACL,UAAU,CAAC,QAAQ;AAAA,MACpB;AAAA,IACD;AAAA,EACD;AAAA,EACA;AAAA,IACC,GAAG;AAAA,IACH,gBAAgB;AAAA,MACf,MAAM;AAAA,QACL,UAAU,CAAC,QAAQ;AAAA,QACnB,WAAW,CAAC,SAAS,kBAAkB,MAAM;AAAA,MAC9C;AAAA,IACD;AAAA,EACD;AAAA,EACA,GAAG,OAAO;AAAA,EACV,GAAG,KAAK;AAAA,EACR,GAAG,eAAe;AACnB;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../nodes/Airtop/actions/window/create.operation.ts"],"sourcesContent":["import type {\n\tIExecuteFunctions,\n\tINodeExecutionData,\n\tIDataObject,\n\tINodeProperties,\n} from 'n8n-workflow';\nimport { NodeApiError } from 'n8n-workflow';\n\nimport {\n\tvalidateAirtopApiResponse,\n\tvalidateSessionId,\n\tvalidateUrl,\n\tvalidateScreenResolution,\n} from '../../GenericFunctions';\nimport { apiRequest } from '../../transport';\nimport type { IAirtopResponse } from '../../transport/types';\nimport { urlField } from '../common/fields';\n\nexport const description: INodeProperties[] = [\n\t{\n\t\t...urlField,\n\t\tdescription: 'Initial URL to load in the window. Defaults to https://www.google.com.',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tresource: ['window'],\n\t\t\t\toperation: ['create'],\n\t\t\t},\n\t\t},\n\t},\n\t// Live View Options\n\t{\n\t\tdisplayName: 'Get Live View',\n\t\tname: 'getLiveView',\n\t\ttype: 'boolean',\n\t\tdefault: false,\n\t\tdescription:\n\t\t\t'Whether to get the URL of the window\\'s <a href=\"https://docs.airtop.ai/guides/how-to/creating-a-live-view\" target=\"_blank\">Live View</a>',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tresource: ['window'],\n\t\t\t\toperation: ['create'],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tdisplayName: 'Include Navigation Bar',\n\t\tname: 'includeNavigationBar',\n\t\ttype: 'boolean',\n\t\tdefault: false,\n\t\tdescription:\n\t\t\t'Whether to include the navigation bar in the Live View. When enabled, the navigation bar will be visible allowing you to navigate between pages.',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tresource: ['window'],\n\t\t\t\toperation: ['create'],\n\t\t\t\tgetLiveView: [true],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tdisplayName: 'Screen Resolution',\n\t\tname: 'screenResolution',\n\t\ttype: 'string',\n\t\tdefault: '',\n\t\tdescription:\n\t\t\t'The screen resolution of the Live View. Setting a resolution will force the window to open at that specific size.',\n\t\tplaceholder: 'e.g. 1280x720',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tresource: ['window'],\n\t\t\t\toperation: ['create'],\n\t\t\t\tgetLiveView: [true],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tdisplayName: 'Disable Resize',\n\t\tname: 'disableResize',\n\t\ttype: 'boolean',\n\t\tdefault: false,\n\t\tdescription: 'Whether to disable the window from being resized in the Live View',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tresource: ['window'],\n\t\t\t\toperation: ['create'],\n\t\t\t\tgetLiveView: [true],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tdisplayName: 'Additional Fields',\n\t\tname: 'additionalFields',\n\t\ttype: 'collection',\n\t\tplaceholder: 'Add Field',\n\t\tdefault: {},\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tresource: ['window'],\n\t\t\t\toperation: ['create'],\n\t\t\t},\n\t\t},\n\t\toptions: [\n\t\t\t{\n\t\t\t\tdisplayName: 'Wait Until',\n\t\t\t\tname: 'waitUntil',\n\t\t\t\ttype: 'options',\n\t\t\t\tdescription: 'Wait until the specified loading event occurs',\n\t\t\t\tdefault: 'load',\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Load',\n\t\t\t\t\t\tvalue: 'load',\n\t\t\t\t\t\tdescription:
|
|
1
|
+
{"version":3,"sources":["../../../../../nodes/Airtop/actions/window/create.operation.ts"],"sourcesContent":["import type {\n\tIExecuteFunctions,\n\tINodeExecutionData,\n\tIDataObject,\n\tINodeProperties,\n} from 'n8n-workflow';\nimport { NodeApiError } from 'n8n-workflow';\n\nimport {\n\tvalidateAirtopApiResponse,\n\tvalidateSessionId,\n\tvalidateUrl,\n\tvalidateScreenResolution,\n} from '../../GenericFunctions';\nimport { apiRequest } from '../../transport';\nimport type { IAirtopResponse } from '../../transport/types';\nimport { urlField } from '../common/fields';\n\nexport const description: INodeProperties[] = [\n\t{\n\t\t...urlField,\n\t\tdescription: 'Initial URL to load in the window. Defaults to https://www.google.com.',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tresource: ['window'],\n\t\t\t\toperation: ['create'],\n\t\t\t},\n\t\t},\n\t},\n\t// Live View Options\n\t{\n\t\tdisplayName: 'Get Live View',\n\t\tname: 'getLiveView',\n\t\ttype: 'boolean',\n\t\tdefault: false,\n\t\tdescription:\n\t\t\t'Whether to get the URL of the window\\'s <a href=\"https://docs.airtop.ai/guides/how-to/creating-a-live-view\" target=\"_blank\">Live View</a>',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tresource: ['window'],\n\t\t\t\toperation: ['create'],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tdisplayName: 'Include Navigation Bar',\n\t\tname: 'includeNavigationBar',\n\t\ttype: 'boolean',\n\t\tdefault: false,\n\t\tdescription:\n\t\t\t'Whether to include the navigation bar in the Live View. When enabled, the navigation bar will be visible allowing you to navigate between pages.',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tresource: ['window'],\n\t\t\t\toperation: ['create'],\n\t\t\t\tgetLiveView: [true],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tdisplayName: 'Screen Resolution',\n\t\tname: 'screenResolution',\n\t\ttype: 'string',\n\t\tdefault: '',\n\t\tdescription:\n\t\t\t'The screen resolution of the Live View. Setting a resolution will force the window to open at that specific size.',\n\t\tplaceholder: 'e.g. 1280x720',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tresource: ['window'],\n\t\t\t\toperation: ['create'],\n\t\t\t\tgetLiveView: [true],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tdisplayName: 'Disable Resize',\n\t\tname: 'disableResize',\n\t\ttype: 'boolean',\n\t\tdefault: false,\n\t\tdescription: 'Whether to disable the window from being resized in the Live View',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tresource: ['window'],\n\t\t\t\toperation: ['create'],\n\t\t\t\tgetLiveView: [true],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tdisplayName: 'Additional Fields',\n\t\tname: 'additionalFields',\n\t\ttype: 'collection',\n\t\tplaceholder: 'Add Field',\n\t\tdefault: {},\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tresource: ['window'],\n\t\t\t\toperation: ['create'],\n\t\t\t},\n\t\t},\n\t\toptions: [\n\t\t\t{\n\t\t\t\tdisplayName: 'Wait Until',\n\t\t\t\tname: 'waitUntil',\n\t\t\t\ttype: 'options',\n\t\t\t\tdescription: 'Wait until the specified loading event occurs',\n\t\t\t\tdefault: 'load',\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Load',\n\t\t\t\t\t\tvalue: 'load',\n\t\t\t\t\t\tdescription: 'Wait until the page dom and its assets have loaded',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'DOM Content Loaded',\n\t\t\t\t\t\tvalue: 'domContentLoaded',\n\t\t\t\t\t\tdescription: 'Wait until the page DOM has loaded',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Complete',\n\t\t\t\t\t\tvalue: 'complete',\n\t\t\t\t\t\tdescription: 'Wait until all iframes in the page have loaded',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'No Wait',\n\t\t\t\t\t\tvalue: 'noWait',\n\t\t\t\t\t\tdescription: 'Do not wait for any loading event and it will return immediately',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t},\n];\n\nexport async function execute(\n\tthis: IExecuteFunctions,\n\tindex: number,\n): Promise<INodeExecutionData[]> {\n\tconst sessionId = validateSessionId.call(this, index);\n\tconst url = validateUrl.call(this, index);\n\tconst additionalFields = this.getNodeParameter('additionalFields', index);\n\t// Live View Options\n\tconst getLiveView = this.getNodeParameter('getLiveView', index, false);\n\tconst includeNavigationBar = this.getNodeParameter('includeNavigationBar', index, false);\n\tconst screenResolution = validateScreenResolution.call(this, index);\n\tconst disableResize = this.getNodeParameter('disableResize', index, false);\n\n\tlet response: IAirtopResponse;\n\n\tconst body: IDataObject = {\n\t\turl,\n\t\t...additionalFields,\n\t};\n\n\tresponse = await apiRequest.call(this, 'POST', `/sessions/${sessionId}/windows`, body);\n\n\tif (!response?.data?.windowId) {\n\t\tthrow new NodeApiError(this.getNode(), {\n\t\t\tmessage: 'Failed to create window',\n\t\t\tcode: 500,\n\t\t});\n\t}\n\n\tconst windowId = String(response.data.windowId);\n\n\tif (getLiveView) {\n\t\t// Get Window info\n\t\tresponse = await apiRequest.call(\n\t\t\tthis,\n\t\t\t'GET',\n\t\t\t`/sessions/${sessionId}/windows/${windowId}`,\n\t\t\tundefined,\n\t\t\t{\n\t\t\t\t...(includeNavigationBar && { includeNavigationBar: true }),\n\t\t\t\t...(screenResolution && { screenResolution }),\n\t\t\t\t...(disableResize && { disableResize: true }),\n\t\t\t},\n\t\t);\n\t}\n\n\t// validate response\n\tvalidateAirtopApiResponse(this.getNode(), response);\n\n\treturn this.helpers.returnJsonArray({ sessionId, windowId, ...response });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA,0BAA6B;AAE7B,8BAKO;AACP,uBAA2B;AAE3B,oBAAyB;AAElB,MAAM,cAAiC;AAAA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,GAAG;AAAA,MACtC,SAAS;AAAA,MACT,MAAM;AAAA,IACP,CAAC;AAAA,EACF;AAEA,QAAM,WAAW,OAAO,SAAS,KAAK,QAAQ;AAE9C,MAAI,aAAa;AAEhB,eAAW,MAAM,4BAAW;AAAA,MAC3B;AAAA,MACA;AAAA,MACA,aAAa,SAAS,YAAY,QAAQ;AAAA,MAC1C;AAAA,MACA;AAAA,QACC,GAAI,wBAAwB,EAAE,sBAAsB,KAAK;AAAA,QACzD,GAAI,oBAAoB,EAAE,iBAAiB;AAAA,QAC3C,GAAI,iBAAiB,EAAE,eAAe,KAAK;AAAA,MAC5C;AAAA,IACD;AAAA,EACD;AAGA,yDAA0B,KAAK,QAAQ,GAAG,QAAQ;AAElD,SAAO,KAAK,QAAQ,gBAAgB,EAAE,WAAW,UAAU,GAAG,SAAS,CAAC;AACzE;","names":[]}
|
|
@@ -18,14 +18,32 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var takeScreenshot_operation_exports = {};
|
|
20
20
|
__export(takeScreenshot_operation_exports, {
|
|
21
|
+
description: () => description,
|
|
21
22
|
execute: () => execute
|
|
22
23
|
});
|
|
23
24
|
module.exports = __toCommonJS(takeScreenshot_operation_exports);
|
|
24
25
|
var import_GenericFunctions = require("../../GenericFunctions");
|
|
25
26
|
var import_transport = require("../../transport");
|
|
27
|
+
const description = [
|
|
28
|
+
{
|
|
29
|
+
displayName: "Output Binary Image",
|
|
30
|
+
description: "Whether to output the image as a binary file instead of a base64 encoded string",
|
|
31
|
+
name: "outputImageAsBinary",
|
|
32
|
+
type: "boolean",
|
|
33
|
+
default: false,
|
|
34
|
+
displayOptions: {
|
|
35
|
+
show: {
|
|
36
|
+
resource: ["window"],
|
|
37
|
+
operation: ["takeScreenshot"]
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
];
|
|
26
42
|
async function execute(index) {
|
|
27
43
|
const { sessionId, windowId } = import_GenericFunctions.validateSessionAndWindowId.call(this, index);
|
|
44
|
+
const outputImageAsBinary = this.getNodeParameter("outputImageAsBinary", index, false);
|
|
28
45
|
let data;
|
|
46
|
+
let image = "";
|
|
29
47
|
const response = await import_transport.apiRequest.call(
|
|
30
48
|
this,
|
|
31
49
|
"POST",
|
|
@@ -33,15 +51,19 @@ async function execute(index) {
|
|
|
33
51
|
);
|
|
34
52
|
(0, import_GenericFunctions.validateAirtopApiResponse)(this.getNode(), response);
|
|
35
53
|
if (response.meta?.screenshots?.length) {
|
|
36
|
-
|
|
37
|
-
|
|
54
|
+
if (outputImageAsBinary) {
|
|
55
|
+
const buffer = (0, import_GenericFunctions.convertScreenshotToBinary)(response.meta.screenshots[0]);
|
|
56
|
+
data = await this.helpers.prepareBinaryData(buffer, "screenshot.jpg", "image/jpeg");
|
|
57
|
+
} else {
|
|
58
|
+
image = response?.meta?.screenshots?.[0].dataUrl;
|
|
59
|
+
}
|
|
38
60
|
}
|
|
39
61
|
return [
|
|
40
62
|
{
|
|
41
63
|
json: {
|
|
42
64
|
sessionId,
|
|
43
65
|
windowId,
|
|
44
|
-
|
|
66
|
+
image
|
|
45
67
|
},
|
|
46
68
|
...data ? { binary: { data } } : {}
|
|
47
69
|
}
|
|
@@ -49,6 +71,7 @@ async function execute(index) {
|
|
|
49
71
|
}
|
|
50
72
|
// Annotate the CommonJS export names for ESM import in node:
|
|
51
73
|
0 && (module.exports = {
|
|
74
|
+
description,
|
|
52
75
|
execute
|
|
53
76
|
});
|
|
54
77
|
//# sourceMappingURL=takeScreenshot.operation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../nodes/Airtop/actions/window/takeScreenshot.operation.ts"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"sources":["../../../../../nodes/Airtop/actions/window/takeScreenshot.operation.ts"],"sourcesContent":["import type {\n\tIExecuteFunctions,\n\tINodeExecutionData,\n\tIBinaryData,\n\tINodeProperties,\n} from 'n8n-workflow';\n\nimport {\n\tvalidateSessionAndWindowId,\n\tvalidateAirtopApiResponse,\n\tconvertScreenshotToBinary,\n} from '../../GenericFunctions';\nimport { apiRequest } from '../../transport';\n\nexport const description: INodeProperties[] = [\n\t{\n\t\tdisplayName: 'Output Binary Image',\n\t\tdescription: 'Whether to output the image as a binary file instead of a base64 encoded string',\n\t\tname: 'outputImageAsBinary',\n\t\ttype: 'boolean',\n\t\tdefault: false,\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tresource: ['window'],\n\t\t\t\toperation: ['takeScreenshot'],\n\t\t\t},\n\t\t},\n\t},\n];\n\nexport async function execute(\n\tthis: IExecuteFunctions,\n\tindex: number,\n): Promise<INodeExecutionData[]> {\n\tconst { sessionId, windowId } = validateSessionAndWindowId.call(this, index);\n\tconst outputImageAsBinary = this.getNodeParameter('outputImageAsBinary', index, false) as boolean;\n\n\tlet data: IBinaryData | undefined; // for storing the binary data\n\tlet image = ''; // for storing the base64 encoded image\n\n\tconst response = await apiRequest.call(\n\t\tthis,\n\t\t'POST',\n\t\t`/sessions/${sessionId}/windows/${windowId}/screenshot`,\n\t);\n\n\t// validate response\n\tvalidateAirtopApiResponse(this.getNode(), response);\n\n\t// process screenshot on success\n\tif (response.meta?.screenshots?.length) {\n\t\tif (outputImageAsBinary) {\n\t\t\tconst buffer = convertScreenshotToBinary(response.meta.screenshots[0]);\n\t\t\tdata = await this.helpers.prepareBinaryData(buffer, 'screenshot.jpg', 'image/jpeg');\n\t\t} else {\n\t\t\timage = response?.meta?.screenshots?.[0].dataUrl;\n\t\t}\n\t}\n\n\treturn [\n\t\t{\n\t\t\tjson: {\n\t\t\t\tsessionId,\n\t\t\t\twindowId,\n\t\t\t\timage,\n\t\t\t},\n\t\t\t...(data ? { binary: { data } } : {}),\n\t\t},\n\t];\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAO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|
|
26
|
-
MIN_TIMEOUT_MINUTES: () => MIN_TIMEOUT_MINUTES
|
|
26
|
+
MIN_TIMEOUT_MINUTES: () => MIN_TIMEOUT_MINUTES,
|
|
27
|
+
N8N_VERSION: () => N8N_VERSION,
|
|
28
|
+
OPERATION_TIMEOUT: () => OPERATION_TIMEOUT,
|
|
29
|
+
SESSION_STATUS: () => SESSION_STATUS,
|
|
30
|
+
getN8NVersion: () => getN8NVersion
|
|
27
31
|
});
|
|
28
32
|
module.exports = __toCommonJS(constants_exports);
|
|
29
|
-
|
|
30
|
-
|
|
33
|
+
var import_fs = require("fs");
|
|
34
|
+
var import_n8n_workflow = require("n8n-workflow");
|
|
35
|
+
var import_path = require("path");
|
|
36
|
+
const getN8NVersion = () => {
|
|
37
|
+
if (process.env.N8N_VERSION) {
|
|
38
|
+
return process.env.N8N_VERSION;
|
|
39
|
+
}
|
|
40
|
+
try {
|
|
41
|
+
const PACKAGE_DIR = (0, import_path.resolve)(__dirname, "../../../");
|
|
42
|
+
const packageJsonPath = (0, import_path.join)(PACKAGE_DIR, "package.json");
|
|
43
|
+
const n8nPackageJson = (0, import_n8n_workflow.jsonParse)((0, import_fs.readFileSync)(packageJsonPath, "utf8"));
|
|
44
|
+
return n8nPackageJson.version;
|
|
45
|
+
} catch (error) {
|
|
46
|
+
return "0.0.0";
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
const N8N_VERSION = getN8NVersion();
|
|
50
|
+
const BASE_URL = process.env.AIRTOP_BASE_URL ?? "https://api.airtop.ai/api/v1";
|
|
51
|
+
const INTEGRATION_URL = process.env.AIRTOP_INTEGRATION_URL ?? "https://portal-api.airtop.ai/integrations/v1/no-code";
|
|
31
52
|
const DEFAULT_TIMEOUT_MINUTES = 10;
|
|
32
53
|
const MIN_TIMEOUT_MINUTES = 1;
|
|
33
54
|
const MAX_TIMEOUT_MINUTES = 10080;
|
|
55
|
+
const SESSION_STATUS = {
|
|
56
|
+
INITIALIZING: "initializing",
|
|
57
|
+
RUNNING: "running"
|
|
58
|
+
};
|
|
59
|
+
const OPERATION_TIMEOUT = 5 * 60 * 1e3;
|
|
34
60
|
const ERROR_MESSAGES = {
|
|
35
61
|
SESSION_ID_REQUIRED: "Please fill the 'Session ID' parameter",
|
|
36
62
|
WINDOW_ID_REQUIRED: "Please fill the 'Window ID' parameter",
|
|
37
63
|
URL_REQUIRED: "Please fill the 'URL' parameter",
|
|
38
64
|
PROFILE_NAME_INVALID: "'Profile Name' should only contain letters, numbers and dashes",
|
|
39
65
|
TIMEOUT_MINUTES_INVALID: `Timeout must be between ${MIN_TIMEOUT_MINUTES} and ${MAX_TIMEOUT_MINUTES} minutes`,
|
|
66
|
+
TIMEOUT_REACHED: "Timeout reached while waiting for the operation to complete",
|
|
40
67
|
URL_INVALID: "'URL' must start with 'http' or 'https'",
|
|
41
68
|
PROFILE_NAME_REQUIRED: "'Profile Name' is required when 'Save Profile' is enabled",
|
|
42
69
|
REQUIRED_PARAMETER: "Please fill the '{{field}}' parameter",
|
|
43
70
|
PROXY_URL_REQUIRED: "Please fill the 'Proxy URL' parameter",
|
|
44
71
|
PROXY_URL_INVALID: "'Proxy URL' must start with 'http' or 'https'",
|
|
45
|
-
SCREEN_RESOLUTION_INVALID: "'Screen Resolution' must be in the format 'width x height' (e.g. '1280x720')"
|
|
72
|
+
SCREEN_RESOLUTION_INVALID: "'Screen Resolution' must be in the format 'width x height' (e.g. '1280x720')",
|
|
73
|
+
SCROLL_BY_AMOUNT_INVALID: "'Scroll By' amount must be a number and either a percentage or pixels (e.g. '100px' or '100%')",
|
|
74
|
+
SCROLL_MODE_INVALID: "Please fill any of the 'Scroll To Edge' or 'Scroll By' parameters"
|
|
46
75
|
};
|
|
47
76
|
// Annotate the CommonJS export names for ESM import in node:
|
|
48
77
|
0 && (module.exports = {
|
|
@@ -51,6 +80,10 @@ const ERROR_MESSAGES = {
|
|
|
51
80
|
ERROR_MESSAGES,
|
|
52
81
|
INTEGRATION_URL,
|
|
53
82
|
MAX_TIMEOUT_MINUTES,
|
|
54
|
-
MIN_TIMEOUT_MINUTES
|
|
83
|
+
MIN_TIMEOUT_MINUTES,
|
|
84
|
+
N8N_VERSION,
|
|
85
|
+
OPERATION_TIMEOUT,
|
|
86
|
+
SESSION_STATUS,
|
|
87
|
+
getN8NVersion
|
|
55
88
|
});
|
|
56
89
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../nodes/Airtop/constants.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"sources":["../../../nodes/Airtop/constants.ts"],"sourcesContent":["import { readFileSync } from 'fs';\nimport type { n8n } from 'n8n-core';\nimport { jsonParse } from 'n8n-workflow';\nimport { join, resolve } from 'path';\n\n// Helper function to get n8n version that can be mocked in tests\nexport const getN8NVersion = (): string => {\n\tif (process.env.N8N_VERSION) {\n\t\treturn process.env.N8N_VERSION;\n\t}\n\n\ttry {\n\t\tconst PACKAGE_DIR = resolve(__dirname, '../../../');\n\t\tconst packageJsonPath = join(PACKAGE_DIR, 'package.json');\n\t\tconst n8nPackageJson = jsonParse<n8n.PackageJson>(readFileSync(packageJsonPath, 'utf8'));\n\t\treturn n8nPackageJson.version;\n\t} catch (error) {\n\t\t// Fallback version\n\t\treturn '0.0.0';\n\t}\n};\n\nexport const N8N_VERSION = getN8NVersion();\n\nexport const BASE_URL = process.env.AIRTOP_BASE_URL ?? 'https://api.airtop.ai/api/v1';\nexport const INTEGRATION_URL =\n\tprocess.env.AIRTOP_INTEGRATION_URL ?? 'https://portal-api.airtop.ai/integrations/v1/no-code';\n\n// Session operations\nexport const DEFAULT_TIMEOUT_MINUTES = 10;\nexport const MIN_TIMEOUT_MINUTES = 1;\nexport const MAX_TIMEOUT_MINUTES = 10080;\nexport const SESSION_STATUS = {\n\tINITIALIZING: 'initializing',\n\tRUNNING: 'running',\n} as const;\n\n// Operations\nexport const OPERATION_TIMEOUT = 5 * 60 * 1000; // 5 mins\n\n// Scroll operation\nexport type TScrollingMode = 'manual' | 'automatic';\n\n// Error messages\nexport const ERROR_MESSAGES = {\n\tSESSION_ID_REQUIRED: \"Please fill the 'Session ID' parameter\",\n\tWINDOW_ID_REQUIRED: \"Please fill the 'Window ID' parameter\",\n\tURL_REQUIRED: \"Please fill the 'URL' parameter\",\n\tPROFILE_NAME_INVALID: \"'Profile Name' should only contain letters, numbers and dashes\",\n\tTIMEOUT_MINUTES_INVALID: `Timeout must be between ${MIN_TIMEOUT_MINUTES} and ${MAX_TIMEOUT_MINUTES} minutes`,\n\tTIMEOUT_REACHED: 'Timeout reached while waiting for the operation to complete',\n\tURL_INVALID: \"'URL' must start with 'http' or 'https'\",\n\tPROFILE_NAME_REQUIRED: \"'Profile Name' is required when 'Save Profile' is enabled\",\n\tREQUIRED_PARAMETER: \"Please fill the '{{field}}' parameter\",\n\tPROXY_URL_REQUIRED: \"Please fill the 'Proxy URL' parameter\",\n\tPROXY_URL_INVALID: \"'Proxy URL' must start with 'http' or 'https'\",\n\tSCREEN_RESOLUTION_INVALID:\n\t\t\"'Screen Resolution' must be in the format 'width x height' (e.g. '1280x720')\",\n\tSCROLL_BY_AMOUNT_INVALID:\n\t\t\"'Scroll By' amount must be a number and either a percentage or pixels (e.g. '100px' or '100%')\",\n\tSCROLL_MODE_INVALID: \"Please fill any of the 'Scroll To Edge' or 'Scroll By' parameters\",\n} as const;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAA6B;AAE7B,0BAA0B;AAC1B,kBAA8B;AAGvB,MAAM,gBAAgB,MAAc;AAC1C,MAAI,QAAQ,IAAI,aAAa;AAC5B,WAAO,QAAQ,IAAI;AAAA,EACpB;AAEA,MAAI;AACH,UAAM,kBAAc,qBAAQ,WAAW,WAAW;AAClD,UAAM,sBAAkB,kBAAK,aAAa,cAAc;AACxD,UAAM,qBAAiB,mCAA2B,wBAAa,iBAAiB,MAAM,CAAC;AACvF,WAAO,eAAe;AAAA,EACvB,SAAS,OAAO;AAEf,WAAO;AAAA,EACR;AACD;AAEO,MAAM,cAAc,cAAc;AAElC,MAAM,WAAW,QAAQ,IAAI,mBAAmB;AAChD,MAAM,kBACZ,QAAQ,IAAI,0BAA0B;AAGhC,MAAM,0BAA0B;AAChC,MAAM,sBAAsB;AAC5B,MAAM,sBAAsB;AAC5B,MAAM,iBAAiB;AAAA,EAC7B,cAAc;AAAA,EACd,SAAS;AACV;AAGO,MAAM,oBAAoB,IAAI,KAAK;AAMnC,MAAM,iBAAiB;AAAA,EAC7B,qBAAqB;AAAA,EACrB,oBAAoB;AAAA,EACpB,cAAc;AAAA,EACd,sBAAsB;AAAA,EACtB,yBAAyB,2BAA2B,mBAAmB,QAAQ,mBAAmB;AAAA,EAClG,iBAAiB;AAAA,EACjB,aAAa;AAAA,EACb,uBAAuB;AAAA,EACvB,oBAAoB;AAAA,EACpB,oBAAoB;AAAA,EACpB,mBAAmB;AAAA,EACnB,2BACC;AAAA,EACD,0BACC;AAAA,EACD,qBAAqB;AACtB;","names":[]}
|