diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b8f0ef..fad9561 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,20 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). ## [Unreleased] +### Added +- Add the APIs of the following add-ons: + - Client Side Integration version 0.20.0; + - Postman Support version 0.7.0. + +### Changed +- Update dependencies. +- Update core APIs for 2.17. +- Update the APIs of the following add-ons: + - Automation Framework version 0.58.0; + - OpenAPI Support version 48; + - Passive Scanner version 0.6.0; + - Selenium version 15.43.0; + - Spider version 0.18.0. ## [2.0.0-rc.6] - 2025-01-20 ### Added diff --git a/src/alert.js b/src/alert.js index 8d3ca07..6e0a692 100644 --- a/src/alert.js +++ b/src/alert.js @@ -41,6 +41,7 @@ Alert.prototype.alert = function (args) { * @param {string} count * @param {string} riskid * @param {string} contextname - Optionally, the Context name which the Alerts' URLs are associated with. + * @param {string} falsepositive - Optionally, a boolean indicating whether the results should include False Positive alerts. **/ Alert.prototype.alerts = function (args) { const params = { } @@ -59,6 +60,9 @@ Alert.prototype.alerts = function (args) { if (args.contextname && args.contextname !== null) { params.contextName = args.contextname } + if (args.falsepositive && args.falsepositive !== null) { + params.falsePositive = args.falsepositive + } return this.api.request('/alert/view/alerts/', params) } diff --git a/src/alertFilter.js b/src/alertFilter.js index 30d7620..c575835 100644 --- a/src/alertFilter.js +++ b/src/alertFilter.js @@ -29,7 +29,7 @@ function AlertFilter (clientApi) { /** * Lists the alert filters of the context with the given ID. * This component is optional and therefore the API will only work if it is installed - * @param {string} contextid + * @param {string} contextid - The numeric ID of the context for which the filters should be listed. **/ AlertFilter.prototype.alertFilterList = function (args) { return this.api.request('/alertFilter/view/alertFilterList/', { contextId: args.contextid }) @@ -46,19 +46,19 @@ AlertFilter.prototype.globalAlertFilterList = function () { /** * Adds a new alert filter for the context with the given ID. * This component is optional and therefore the API will only work if it is installed - * @param {string} contextid - * @param {string} ruleid - * @param {string} newlevel - * @param {string} url - * @param {string} urlisregex - * @param {string} parameter - * @param {string} enabled - * @param {string} parameterisregex - * @param {string} attack - * @param {string} attackisregex - * @param {string} evidence - * @param {string} evidenceisregex - * @param {string} methods + * @param {string} contextid - The numeric ID of the context for which the filter should be added. + * @param {string} ruleid - The numeric ID of the rule for which the filter should apply. + * @param {string} newlevel - The numeric risk representation ('0 - Informational' through '3 - High') ['-1 - False Positive']. + * @param {string} url - The URL for which the filter should apply (can be regex). + * @param {string} urlisregex - A boolean indicating whether or not the URL is a regex. + * @param {string} parameter - The parameter name for which the filter should apply (can be regex). + * @param {string} enabled - A boolean indicating whether or not the filter should be enabled. + * @param {string} parameterisregex - A boolean indicating whether or not the parameter name is a regex. + * @param {string} attack - The attack value for which the filter should apply (can be regex). + * @param {string} attackisregex - A boolean indicating whether or not the attack value is a regex. + * @param {string} evidence - The evidence value for which the filter should apply (can be regex). + * @param {string} evidenceisregex - A boolean indicating whether or not the evidence value is a regex. + * @param {string} methods - The HTTP methods (comma separated) for which the filter should apply. **/ AlertFilter.prototype.addAlertFilter = function (args) { const params = { contextId: args.contextid, ruleId: args.ruleid, newLevel: args.newlevel } @@ -98,19 +98,19 @@ AlertFilter.prototype.addAlertFilter = function (args) { /** * Removes an alert filter from the context with the given ID. * This component is optional and therefore the API will only work if it is installed - * @param {string} contextid - * @param {string} ruleid - * @param {string} newlevel - * @param {string} url - * @param {string} urlisregex - * @param {string} parameter - * @param {string} enabled - * @param {string} parameterisregex - * @param {string} attack - * @param {string} attackisregex - * @param {string} evidence - * @param {string} evidenceisregex - * @param {string} methods + * @param {string} contextid - The numeric ID of the context for which the filter should be removed. + * @param {string} ruleid - The numeric ID of the rule for which the filter applies. + * @param {string} newlevel - The numeric risk representation ('0 - Informational' through '3 - High') ['-1 - False Positive']. + * @param {string} url - The URL for which the filter applies (can be regex). + * @param {string} urlisregex - A boolean indicating whether or not the URL is a regex. + * @param {string} parameter - The parameter name for which the filter applies (can be regex). + * @param {string} enabled - A boolean indicating whether or not the filter should be enabled. + * @param {string} parameterisregex - A boolean indicating whether or not the parameter name is a regex. + * @param {string} attack - The attack value for which the filter applies (can be regex). + * @param {string} attackisregex - A boolean indicating whether or not the attack value is a regex. + * @param {string} evidence - The evidence value for which the filter applies (can be regex). + * @param {string} evidenceisregex - A boolean indicating whether or not the evidence value is a regex. + * @param {string} methods - The HTTP methods (comma separated) for which the filter applies. **/ AlertFilter.prototype.removeAlertFilter = function (args) { const params = { contextId: args.contextid, ruleId: args.ruleid, newLevel: args.newlevel } @@ -150,18 +150,18 @@ AlertFilter.prototype.removeAlertFilter = function (args) { /** * Adds a new global alert filter. * This component is optional and therefore the API will only work if it is installed - * @param {string} ruleid - * @param {string} newlevel - * @param {string} url - * @param {string} urlisregex - * @param {string} parameter - * @param {string} enabled - * @param {string} parameterisregex - * @param {string} attack - * @param {string} attackisregex - * @param {string} evidence - * @param {string} evidenceisregex - * @param {string} methods + * @param {string} ruleid - The numeric ID of the rule for which the filter should apply. + * @param {string} newlevel - The numeric risk representation ('0 - Informational' through '3 - High') ['-1 - False Positive']. + * @param {string} url - The URL for which the filter should apply (can be regex). + * @param {string} urlisregex - A boolean indicating whether or not the URL is a regex. + * @param {string} parameter - The parameter name for which the filter should apply (can be regex). + * @param {string} enabled - A boolean indicating whether or not the filter should be enabled. + * @param {string} parameterisregex - A boolean indicating whether or not the parameter name is a regex. + * @param {string} attack - The attack value for which the filter should apply (can be regex). + * @param {string} attackisregex - A boolean indicating whether or not the attack value is a regex. + * @param {string} evidence - The evidence value for which the filter should apply (can be regex). + * @param {string} evidenceisregex - A boolean indicating whether or not the evidence value is a regex. + * @param {string} methods - The HTTP methods (comma separated) for which the filter should apply. **/ AlertFilter.prototype.addGlobalAlertFilter = function (args) { const params = { ruleId: args.ruleid, newLevel: args.newlevel } @@ -201,18 +201,18 @@ AlertFilter.prototype.addGlobalAlertFilter = function (args) { /** * Removes a global alert filter. * This component is optional and therefore the API will only work if it is installed - * @param {string} ruleid - * @param {string} newlevel - * @param {string} url - * @param {string} urlisregex - * @param {string} parameter - * @param {string} enabled - * @param {string} parameterisregex - * @param {string} attack - * @param {string} attackisregex - * @param {string} evidence - * @param {string} evidenceisregex - * @param {string} methods + * @param {string} ruleid - The numeric ID of the rule for which the filter applies. + * @param {string} newlevel - The numeric risk representation ('0 - Informational' through '3 - High') ['-1 - False Positive']. + * @param {string} url - The URL for which the filter applies (can be regex). + * @param {string} urlisregex - A boolean indicating whether or not the URL is a regex. + * @param {string} parameter - The parameter name for which the filter applies (can be regex). + * @param {string} enabled - A boolean indicating whether or not the filter should be enabled. + * @param {string} parameterisregex - A boolean indicating whether or not the parameter name is a regex. + * @param {string} attack - The attack value for which the filter applies (can be regex). + * @param {string} attackisregex - A boolean indicating whether or not the attack value is a regex. + * @param {string} evidence - The evidence value for which the filter applies (can be regex). + * @param {string} evidenceisregex - A boolean indicating whether or not the evidence value is a regex. + * @param {string} methods - The HTTP methods (comma separated) for which the filter applies. **/ AlertFilter.prototype.removeGlobalAlertFilter = function (args) { const params = { ruleId: args.ruleid, newLevel: args.newlevel } diff --git a/src/ascan.js b/src/ascan.js index 7363366..1f69814 100644 --- a/src/ascan.js +++ b/src/ascan.js @@ -266,6 +266,13 @@ Ascan.prototype.optionEncodeCookieValues = function () { return this.api.request('/ascan/view/optionEncodeCookieValues/') } +/** + * Tells whether or not the active scanner should exclude anti-csrf tokens from the scan. + **/ +Ascan.prototype.optionExcludeAntiCsrfTokens = function () { + return this.api.request('/ascan/view/optionExcludeAntiCsrfTokens/') +} + /** * Tells whether or not the active scanner should inject the HTTP request header X-ZAP-Scan-ID, with the ID of the scan rule that's sending the requests. **/ @@ -273,6 +280,13 @@ Ascan.prototype.optionInjectPluginIdInHeader = function () { return this.api.request('/ascan/view/optionInjectPluginIdInHeader/') } +/** + * Tells whether or not the temporary HTTP messages sent while active scanning should be persisted. + **/ +Ascan.prototype.optionPersistTemporaryMessages = function () { + return this.api.request('/ascan/view/optionPersistTemporaryMessages/') +} + /** * **/ @@ -734,6 +748,14 @@ Ascan.prototype.setOptionEncodeCookieValues = function (args) { return this.api.request('/ascan/action/setOptionEncodeCookieValues/', { Boolean: args.bool }) } +/** + * Sets whether or not the active scanner should exclude anti-csrf tokens from the scan. + * @param {string} bool - true if anti-csrf tokens should be excluded, false otherwise. + **/ +Ascan.prototype.setOptionExcludeAntiCsrfTokens = function (args) { + return this.api.request('/ascan/action/setOptionExcludeAntiCsrfTokens/', { Boolean: args.bool }) +} + /** * * @param {string} bool @@ -806,6 +828,14 @@ Ascan.prototype.setOptionMaxScansInUI = function (args) { return this.api.request('/ascan/action/setOptionMaxScansInUI/', { Integer: args.integer }) } +/** + * Sets whether or not the temporary HTTP messages sent while active scanning should be persisted. + * @param {string} bool - true if the temporary HTTP messages should be persisted, false otherwise. + **/ +Ascan.prototype.setOptionPersistTemporaryMessages = function (args) { + return this.api.request('/ascan/action/setOptionPersistTemporaryMessages/', { Boolean: args.bool }) +} + /** * * @param {string} bool diff --git a/src/automation.js b/src/automation.js index 6951ab4..6078ffe 100644 --- a/src/automation.js +++ b/src/automation.js @@ -27,20 +27,34 @@ function Automation (clientApi) { } /** + * Returns the progress details for the specified planId * This component is optional and therefore the API will only work if it is installed + * @param {string} planid **/ Automation.prototype.planProgress = function (args) { return this.api.request('/automation/view/planProgress/', { planId: args.planid }) } /** + * Loads and asynchronously runs the plan in the specified file, returning a planId * This component is optional and therefore the API will only work if it is installed + * @param {string} filepath **/ Automation.prototype.runPlan = function (args) { return this.api.request('/automation/action/runPlan/', { filePath: args.filepath }) } /** + * Stops the running plan identified by the planId + * This component is optional and therefore the API will only work if it is installed + * @param {string} planid + **/ +Automation.prototype.stopPlan = function (args) { + return this.api.request('/automation/action/stopPlan/', { planId: args.planid }) +} + +/** + * Ends the currently running delay job, if any * This component is optional and therefore the API will only work if it is installed **/ Automation.prototype.endDelayJob = function () { diff --git a/src/client.js b/src/client.js new file mode 100644 index 0000000..1732b7d --- /dev/null +++ b/src/client.js @@ -0,0 +1,66 @@ +/* Zed Attack Proxy (ZAP) and its related class files. + * + * ZAP is an HTTP/HTTPS proxy for assessing web application security. + * + * Copyright 2025 the ZAP development team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +'use strict' + +/** + * This file was automatically generated. + */ +function Client (clientApi) { + this.api = clientApi +} + +/** + * This component is optional and therefore the API will only work if it is installed + **/ +Client.prototype.reportObject = function (args) { + return this.api.request('/client/action/reportObject/', { objectJson: args.objectjson }) +} + +/** + * This component is optional and therefore the API will only work if it is installed + **/ +Client.prototype.reportEvent = function (args) { + return this.api.request('/client/action/reportEvent/', { eventJson: args.eventjson }) +} + +/** + * This component is optional and therefore the API will only work if it is installed + **/ +Client.prototype.reportZestStatement = function (args) { + return this.api.request('/client/action/reportZestStatement/', { statementJson: args.statementjson }) +} + +/** + * This component is optional and therefore the API will only work if it is installed + **/ +Client.prototype.reportZestScript = function (args) { + return this.api.request('/client/action/reportZestScript/', { scriptJson: args.scriptjson }) +} + +/** + * Exports the Client Map to a file. + * This component is optional and therefore the API will only work if it is installed + * @param {string} pathyaml - The file system path to the file. + **/ +Client.prototype.exportClientMap = function (args) { + return this.api.request('/client/action/exportClientMap/', { pathYaml: args.pathyaml }) +} + +module.exports = Client diff --git a/src/clientSpider.js b/src/clientSpider.js new file mode 100644 index 0000000..76c5c20 --- /dev/null +++ b/src/clientSpider.js @@ -0,0 +1,92 @@ +/* Zed Attack Proxy (ZAP) and its related class files. + * + * ZAP is an HTTP/HTTPS proxy for assessing web application security. + * + * Copyright 2025 the ZAP development team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +'use strict' + +/** + * This file was automatically generated. + */ +function ClientSpider (clientApi) { + this.api = clientApi +} + +/** + * Gets the status of a client spider scan. + * This component is optional and therefore the API will only work if it is installed + * @param {string} scanid - The ID of the client spider scan. + **/ +ClientSpider.prototype.status = function (args) { + return this.api.request('/clientSpider/view/status/', { scanId: args.scanid }) +} + +/** + * Starts a client spider scan. + * This component is optional and therefore the API will only work if it is installed + * @param {string} browser - The ID of the browser. See Selenium documentation for valid IDs. + * @param {string} url - The URL from where to start the spider. + * @param {string} contextname - The name of the context. + * @param {string} username - The name of the user. + * @param {string} subtreeonly - true to spider only under the subtree, false otherwise. + * @param {string} maxcrawldepth - Maximum Crawl Depth (0 is unlimited). + * @param {string} pageloadtime - Page Load Time (seconds). + * @param {string} numberofbrowsers - Number of Browser Windows to Open (concurrency). + * @param {string} scopecheck - Scope Check (FLEXIBLE or STRICT). + **/ +ClientSpider.prototype.scan = function (args) { + const params = { } + if (args.browser && args.browser !== null) { + params.browser = args.browser + } + if (args.url && args.url !== null) { + params.url = args.url + } + if (args.contextname && args.contextname !== null) { + params.contextName = args.contextname + } + if (args.username && args.username !== null) { + params.userName = args.username + } + if (args.subtreeonly && args.subtreeonly !== null) { + params.subtreeOnly = args.subtreeonly + } + if (args.maxcrawldepth && args.maxcrawldepth !== null) { + params.maxCrawlDepth = args.maxcrawldepth + } + if (args.pageloadtime && args.pageloadtime !== null) { + params.pageLoadTime = args.pageloadtime + } + if (args.numberofbrowsers && args.numberofbrowsers !== null) { + params.numberOfBrowsers = args.numberofbrowsers + } + if (args.scopecheck && args.scopecheck !== null) { + params.scopeCheck = args.scopecheck + } + return this.api.request('/clientSpider/action/scan/', params) +} + +/** + * Stops a client spider scan. + * This component is optional and therefore the API will only work if it is installed + * @param {string} scanid - The ID of the client spider scan. + **/ +ClientSpider.prototype.stop = function (args) { + return this.api.request('/clientSpider/action/stop/', { scanId: args.scanid }) +} + +module.exports = ClientSpider diff --git a/src/index.js b/src/index.js index 93f6511..129fb02 100644 --- a/src/index.js +++ b/src/index.js @@ -29,6 +29,8 @@ const Authorization = require('./authorization') const Automation = require('./automation') const Autoupdate = require('./autoupdate') const Brk = require('./brk') +const Client = require('./client') +const ClientSpider = require('./clientSpider') const Context = require('./context') const Core = require('./core') const Exim = require('./exim') @@ -40,6 +42,7 @@ const Oast = require('./oast') const Openapi = require('./openapi') const Params = require('./params') const Pnh = require('./pnh') +const Postman = require('./postman') const Pscan = require('./pscan') const Reports = require('./reports') const Replacer = require('./replacer') @@ -81,6 +84,8 @@ function ClientApi (options) { this.automation = new Automation(this) this.autoupdate = new Autoupdate(this) this.brk = new Brk(this) + this.client = new Client(this) + this.clientSpider = new ClientSpider(this) this.context = new Context(this) this.core = new Core(this) this.exim = new Exim(this) @@ -92,6 +97,7 @@ function ClientApi (options) { this.openapi = new Openapi(this) this.params = new Params(this) this.pnh = new Pnh(this) + this.postman = new Postman(this) this.pscan = new Pscan(this) this.replacer = new Replacer(this) this.reports = new Reports(this) diff --git a/src/postman.js b/src/postman.js new file mode 100644 index 0000000..e27585d --- /dev/null +++ b/src/postman.js @@ -0,0 +1,47 @@ +/* Zed Attack Proxy (ZAP) and its related class files. + * + * ZAP is an HTTP/HTTPS proxy for assessing web application security. + * + * Copyright 2025 the ZAP development team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +'use strict' + +/** + * This file was automatically generated. + */ +function Postman (clientApi) { + this.api = clientApi +} + +/** + * Imports a Postman collection from a file. + * This component is optional and therefore the API will only work if it is installed + * @param {string} file - The path to the file to be imported. + **/ +Postman.prototype.importFile = function (args) { + return this.api.request('/postman/action/importFile/', { file: args.file }) +} + +/** + * Imports a Postman collection from a URL. + * This component is optional and therefore the API will only work if it is installed + * @param {string} url - The URL from which to retrieve the collection to be imported. + **/ +Postman.prototype.importUrl = function (args) { + return this.api.request('/postman/action/importUrl/', { url: args.url }) +} + +module.exports = Postman diff --git a/src/pscan.js b/src/pscan.js index 200f0ce..3b4075d 100644 --- a/src/pscan.js +++ b/src/pscan.js @@ -74,6 +74,14 @@ Pscan.prototype.maxAlertsPerRule = function () { return this.api.request('/pscan/view/maxAlertsPerRule/') } +/** + * Gets the maximum body size in bytes that the passive scanner will scan. + * This component is optional and therefore the API will only work if it is installed + **/ +Pscan.prototype.maxBodySizeInBytes = function () { + return this.api.request('/pscan/view/maxBodySizeInBytes/') +} + /** * Sets whether or not the passive scanning is enabled (Note: the enabled state is not persisted). * This component is optional and therefore the API will only work if it is installed @@ -145,6 +153,15 @@ Pscan.prototype.setMaxAlertsPerRule = function (args) { return this.api.request('/pscan/action/setMaxAlertsPerRule/', { maxAlerts: args.maxalerts }) } +/** + * Sets the maximum body size in bytes that the passive scanner will scan. + * This component is optional and therefore the API will only work if it is installed + * @param {string} maxsize - The maximum size in bytes, 0 to unset. + **/ +Pscan.prototype.setMaxBodySizeInBytes = function (args) { + return this.api.request('/pscan/action/setMaxBodySizeInBytes/', { maxSize: args.maxsize }) +} + /** * Disables all passive scan tags. * This component is optional and therefore the API will only work if it is installed diff --git a/src/selenium.js b/src/selenium.js index e98689a..3af6ddb 100644 --- a/src/selenium.js +++ b/src/selenium.js @@ -49,6 +49,22 @@ Selenium.prototype.optionChromeDriverPath = function () { return this.api.request('/selenium/view/optionChromeDriverPath/') } +/** + * Returns the current path to Edge binary + * This component is optional and therefore the API will only work if it is installed + **/ +Selenium.prototype.optionEdgeBinaryPath = function () { + return this.api.request('/selenium/view/optionEdgeBinaryPath/') +} + +/** + * Returns the current path to EdgeDriver + * This component is optional and therefore the API will only work if it is installed + **/ +Selenium.prototype.optionEdgeDriverPath = function () { + return this.api.request('/selenium/view/optionEdgeDriverPath/') +} + /** * Returns the current path to Firefox binary * This component is optional and therefore the API will only work if it is installed @@ -96,7 +112,7 @@ Selenium.prototype.optionPhantomJsBinaryPath = function () { /** * Gets the browser arguments. * This component is optional and therefore the API will only work if it is installed - * @param {string} browser - The browser, chrome or firefox. + * @param {string} browser - The browser, chrome, edge, or firefox. **/ Selenium.prototype.getBrowserArguments = function (args) { return this.api.request('/selenium/view/getBrowserArguments/', { browser: args.browser }) @@ -120,6 +136,24 @@ Selenium.prototype.setOptionChromeDriverPath = function (args) { return this.api.request('/selenium/action/setOptionChromeDriverPath/', { String: args.string }) } +/** + * Sets the current path to Edge binary + * This component is optional and therefore the API will only work if it is installed + * @param {string} string + **/ +Selenium.prototype.setOptionEdgeBinaryPath = function (args) { + return this.api.request('/selenium/action/setOptionEdgeBinaryPath/', { String: args.string }) +} + +/** + * Sets the current path to EdgeDriver + * This component is optional and therefore the API will only work if it is installed + * @param {string} string + **/ +Selenium.prototype.setOptionEdgeDriverPath = function (args) { + return this.api.request('/selenium/action/setOptionEdgeDriverPath/', { String: args.string }) +} + /** * Sets the current path to Firefox binary * This component is optional and therefore the API will only work if it is installed @@ -169,7 +203,7 @@ Selenium.prototype.setOptionPhantomJsBinaryPath = function (args) { /** * Adds a browser argument. * This component is optional and therefore the API will only work if it is installed - * @param {string} browser - The browser, chrome or firefox. + * @param {string} browser - The browser, chrome, edge, or firefox. * @param {string} argument - The argument. * @param {string} enabled - The enabled state, true or false. **/ @@ -184,7 +218,7 @@ Selenium.prototype.addBrowserArgument = function (args) { /** * Launches a browser proxying through ZAP, for manual usage. * This component is optional and therefore the API will only work if it is installed - * @param {string} browser - The browser, chrome or firefox. + * @param {string} browser - The browser, chrome, edge, or firefox. **/ Selenium.prototype.launchBrowser = function (args) { return this.api.request('/selenium/action/launchBrowser/', { browser: args.browser }) @@ -193,7 +227,7 @@ Selenium.prototype.launchBrowser = function (args) { /** * Removes a browser argument. * This component is optional and therefore the API will only work if it is installed - * @param {string} browser - The browser, chrome or firefox. + * @param {string} browser - The browser, chrome, edge, or firefox. * @param {string} argument - The argument. **/ Selenium.prototype.removeBrowserArgument = function (args) { @@ -203,7 +237,7 @@ Selenium.prototype.removeBrowserArgument = function (args) { /** * Sets whether or not a browser argument is enabled. * This component is optional and therefore the API will only work if it is installed - * @param {string} browser - The browser, chrome or firefox. + * @param {string} browser - The browser, chrome, edge, or firefox. * @param {string} argument - The argument. * @param {string} enabled - The enabled state, true or false. **/ diff --git a/src/spider.js b/src/spider.js index 4a29c0e..351acfa 100644 --- a/src/spider.js +++ b/src/spider.js @@ -155,7 +155,7 @@ Spider.prototype.optionMaxDuration = function () { } /** - * Gets the maximum size, in bytes, that a response might have to be parsed. + * Gets the maximum size, in bytes, that a response might have to be parsed, or 0 for unlimited. * This component is optional and therefore the API will only work if it is installed **/ Spider.prototype.optionMaxParseSizeBytes = function () { @@ -210,6 +210,14 @@ Spider.prototype.optionHandleODataParametersVisited = function () { return this.api.request('/spider/view/optionHandleODataParametersVisited/') } +/** + * Gets whether or not the spider should attempt to avoid logout related paths/functionality. + * This component is optional and therefore the API will only work if it is installed + **/ +Spider.prototype.optionLogoutAvoidance = function () { + return this.api.request('/spider/view/optionLogoutAvoidance/') +} + /** * * This component is optional and therefore the API will only work if it is installed @@ -544,6 +552,15 @@ Spider.prototype.setOptionHandleODataParametersVisited = function (args) { return this.api.request('/spider/action/setOptionHandleODataParametersVisited/', { Boolean: args.bool }) } +/** + * Sets whether or not the Spider should attempt to avoid logout related paths/functionality. + * This component is optional and therefore the API will only work if it is installed + * @param {string} bool - A boolean (true/false) indicating if seeming logout paths/functionality should be avoided (default is false). + **/ +Spider.prototype.setOptionLogoutAvoidance = function (args) { + return this.api.request('/spider/action/setOptionLogoutAvoidance/', { Boolean: args.bool }) +} + /** * Sets the maximum number of child nodes (per node) that can be crawled, 0 means no limit. * This component is optional and therefore the API will only work if it is installed @@ -574,7 +591,7 @@ Spider.prototype.setOptionMaxDuration = function (args) { /** * Sets the maximum size, in bytes, that a response might have to be parsed. This allows the spider to skip big responses/files. * This component is optional and therefore the API will only work if it is installed - * @param {string} integer + * @param {string} integer - The maximum size or 0 for unlimited. **/ Spider.prototype.setOptionMaxParseSizeBytes = function (args) { return this.api.request('/spider/action/setOptionMaxParseSizeBytes/', { Integer: args.integer })