Skip to content

Commit 81f05b4

Browse files
authored
Merge pull request #97 from thc202/rel/v2.0.0-rc.5
2 parents 20a97a9 + 54c0c41 commit 81f05b4

File tree

8 files changed

+108
-7
lines changed

8 files changed

+108
-7
lines changed

CHANGELOG.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ All notable changes to this project will be documented in this file.
33

44
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
55

6-
## [Unreleased]
6+
## [2.0.0-rc.5] - 2024-04-10
7+
### Changed
8+
* Update core APIs for 2.15.
79

810
## [2.0.0-rc.4] - 2023-11-24
911
### Added
@@ -100,7 +102,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
100102
## 0.3.0 - 2017-12-04
101103

102104

103-
[Unreleased]: https://github.com/zaproxy/zap-api-nodejs/compare/v2.0.0-rc.4...HEAD
105+
[2.0.0-rc.5]: https://github.com/zaproxy/zap-api-nodejs/compare/v2.0.0-rc.4...v2.0.0-rc.5
104106
[2.0.0-rc.4]: https://github.com/zaproxy/zap-api-nodejs/compare/v2.0.0-rc.3...v2.0.0-rc.4
105107
[2.0.0-rc.3]: https://github.com/zaproxy/zap-api-nodejs/compare/v2.0.0-rc.2...v2.0.0-rc.3
106108
[2.0.0-rc.2]: https://github.com/zaproxy/zap-api-nodejs/compare/v2.0.0-rc.1...v2.0.0-rc.2

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "zaproxy",
33
"description": "ZAP API Client for Node.js",
4-
"version": "2.0.0-rc.4",
4+
"version": "2.0.0-rc.5",
55
"homepage": "https://github.com/zaproxy/zap-api-nodejs",
66
"author": {
77
"name": "Najam Ul Saqib",

src/ajaxSpider.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ AjaxSpider.prototype.setOptionBrowserId = function (args) {
337337
}
338338

339339
/**
340-
* Sets whether or not the the AJAX Spider will only click on the default HTML elements.
340+
* Sets whether or not the AJAX Spider will only click on the default HTML elements.
341341
* This component is optional and therefore the API will only work if it is installed
342342
* @param {string} bool - A boolean (true/false) indicating if only default elements such as 'a' 'button' 'input' should be clicked (default is true).
343343
**/

src/ascan.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,13 @@ Ascan.prototype.optionAllowAttackOnStart = function () {
259259
return this.api.request('/ascan/view/optionAllowAttackOnStart/')
260260
}
261261

262+
/**
263+
* Tells whether or not the active scanner should encode cookie values.
264+
**/
265+
Ascan.prototype.optionEncodeCookieValues = function () {
266+
return this.api.request('/ascan/view/optionEncodeCookieValues/')
267+
}
268+
262269
/**
263270
* 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.
264271
**/
@@ -719,6 +726,14 @@ Ascan.prototype.setOptionDelayInMs = function (args) {
719726
return this.api.request('/ascan/action/setOptionDelayInMs/', { Integer: args.integer })
720727
}
721728

729+
/**
730+
* Sets whether or not the active scanner should encode cookie values.
731+
* @param {string} bool
732+
**/
733+
Ascan.prototype.setOptionEncodeCookieValues = function (args) {
734+
return this.api.request('/ascan/action/setOptionEncodeCookieValues/', { Boolean: args.bool })
735+
}
736+
722737
/**
723738
*
724739
* @param {string} bool

src/core.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,18 @@ Core.prototype.numberOfAlerts = function (args) {
263263
return this.api.request('/core/view/numberOfAlerts/', params)
264264
}
265265

266+
/**
267+
* The detailed logging config, optionally filtered based on a name (ex: starts with).
268+
* @param {string} name - The name for which the logger details should be provided (this value will be used as a case insensitive starts with filter).
269+
**/
270+
Core.prototype.getLogLevel = function (args) {
271+
const params = { }
272+
if (args.name && args.name !== null) {
273+
params.name = args.name
274+
}
275+
return this.api.request('/core/view/getLogLevel/', params)
276+
}
277+
266278
/**
267279
* Gets the user agent that ZAP should use when creating HTTP messages (for example, spider messages or CONNECT requests to outgoing proxy).
268280
**/
@@ -648,6 +660,15 @@ Core.prototype.deleteAlert = function (args) {
648660
return this.api.request('/core/action/deleteAlert/', { id: args.id })
649661
}
650662

663+
/**
664+
* Sets the logging level for a given logger name.
665+
* @param {string} name - The logger name for which the logging level should be set.
666+
* @param {string} loglevel - The logging level which should be set.
667+
**/
668+
Core.prototype.setLogLevel = function (args) {
669+
return this.api.request('/core/action/setLogLevel/', { name: args.name, logLevel: args.loglevel })
670+
}
671+
651672
/**
652673
* Sets the user agent that ZAP should use when creating HTTP messages (for example, spider messages or CONNECT requests to outgoing proxy).
653674
* @param {string} string

src/search.js

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,27 @@ Search.prototype.urlsByUrlRegex = function (args) {
4747
return this.api.request('/search/view/urlsByUrlRegex/', params)
4848
}
4949

50+
/**
51+
* Returns the URLs of the HTTP messages that match the given regular expression in their history Tags optionally filtered by URL and paginated with 'start' position and 'count' of messages.
52+
* @param {string} regex
53+
* @param {string} baseurl - The highest URL in the Sites tree under which URLs should be included.
54+
* @param {string} start
55+
* @param {string} count
56+
**/
57+
Search.prototype.urlsByTagRegex = function (args) {
58+
const params = { regex: args.regex }
59+
if (args.baseurl && args.baseurl !== null) {
60+
params.baseurl = args.baseurl
61+
}
62+
if (args.start && args.start !== null) {
63+
params.start = args.start
64+
}
65+
if (args.count && args.count !== null) {
66+
params.count = args.count
67+
}
68+
return this.api.request('/search/view/urlsByTagRegex/', params)
69+
}
70+
5071
/**
5172
* Returns the URLs of the HTTP messages that match the given regular expression in the request optionally filtered by URL and paginated with 'start' position and 'count' of messages.
5273
* @param {string} regex
@@ -131,6 +152,27 @@ Search.prototype.messagesByUrlRegex = function (args) {
131152
return this.api.request('/search/view/messagesByUrlRegex/', params)
132153
}
133154

155+
/**
156+
* Returns the HTTP messages that match the given regular expression in their history Tags optionally filtered by URL and paginated with 'start' position and 'count' of messages.
157+
* @param {string} regex
158+
* @param {string} baseurl - The highest URL in the Sites tree under which messages should be included.
159+
* @param {string} start
160+
* @param {string} count
161+
**/
162+
Search.prototype.messagesByTagRegex = function (args) {
163+
const params = { regex: args.regex }
164+
if (args.baseurl && args.baseurl !== null) {
165+
params.baseurl = args.baseurl
166+
}
167+
if (args.start && args.start !== null) {
168+
params.start = args.start
169+
}
170+
if (args.count && args.count !== null) {
171+
params.count = args.count
172+
}
173+
return this.api.request('/search/view/messagesByTagRegex/', params)
174+
}
175+
134176
/**
135177
* Returns the HTTP messages that match the given regular expression in the request optionally filtered by URL and paginated with 'start' position and 'count' of messages.
136178
* @param {string} regex
@@ -215,6 +257,27 @@ Search.prototype.harByUrlRegex = function (args) {
215257
return this.api.request('/search/other/harByUrlRegex/', params, 'other')
216258
}
217259

260+
/**
261+
* Returns the HTTP messages, in HAR format, that match the given regular expression in their history Tags optionally filtered by URL and paginated with 'start' position and 'count' of messages.
262+
* @param {string} regex
263+
* @param {string} baseurl - The highest URL in the Sites tree under which URLs should be included.
264+
* @param {string} start
265+
* @param {string} count
266+
**/
267+
Search.prototype.harByTagRegex = function (args) {
268+
const params = { regex: args.regex }
269+
if (args.baseurl && args.baseurl !== null) {
270+
params.baseurl = args.baseurl
271+
}
272+
if (args.start && args.start !== null) {
273+
params.start = args.start
274+
}
275+
if (args.count && args.count !== null) {
276+
params.count = args.count
277+
}
278+
return this.api.request('/search/other/harByTagRegex/', params, 'other')
279+
}
280+
218281
/**
219282
* Returns the HTTP messages, in HAR format, that match the given regular expression in the request optionally filtered by URL and paginated with 'start' position and 'count' of messages.
220283
* @param {string} regex

src/wappalyzer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function Wappalyzer (clientApi) {
2727
}
2828

2929
/**
30-
* Lists all the sites recognized by the wappalyzer addon.
30+
* Lists all the sites recognized by the Technology Detection add-on.
3131
* This component is optional and therefore the API will only work if it is installed
3232
**/
3333
Wappalyzer.prototype.listSites = function () {

0 commit comments

Comments
 (0)