|
| 1 | +/* Zed Attack Proxy (ZAP) and its related class files. |
| 2 | + * |
| 3 | + * ZAP is an HTTP/HTTPS proxy for assessing web application security. |
| 4 | + * |
| 5 | + * Copyright 2023 the ZAP development team |
| 6 | + * |
| 7 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 8 | + * you may not use this file except in compliance with the License. |
| 9 | + * You may obtain a copy of the License at |
| 10 | + * |
| 11 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 12 | + * |
| 13 | + * Unless required by applicable law or agreed to in writing, software |
| 14 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 15 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 16 | + * See the License for the specific language governing permissions and |
| 17 | + * limitations under the License. |
| 18 | + */ |
| 19 | + |
| 20 | +'use strict' |
| 21 | + |
| 22 | +/** |
| 23 | + * This file was automatically generated. |
| 24 | + */ |
| 25 | +function Custompayloads (clientApi) { |
| 26 | + this.api = clientApi |
| 27 | +} |
| 28 | + |
| 29 | +/** |
| 30 | + * Lists all available categories. |
| 31 | + * This component is optional and therefore the API will only work if it is installed |
| 32 | + **/ |
| 33 | +Custompayloads.prototype.customPayloadsCategories = function () { |
| 34 | + return this.api.request('/custompayloads/view/customPayloadsCategories/') |
| 35 | +} |
| 36 | + |
| 37 | +/** |
| 38 | + * Lists all the payloads currently loaded (category, payload, enabled state). Optionally filtered by category. |
| 39 | + * This component is optional and therefore the API will only work if it is installed |
| 40 | + * @param {string} category - The category for which the payloads should be displayed. |
| 41 | + **/ |
| 42 | +Custompayloads.prototype.customPayloads = function (args) { |
| 43 | + const params = { } |
| 44 | + if (args.category && args.category !== null) { |
| 45 | + params.category = args.category |
| 46 | + } |
| 47 | + return this.api.request('/custompayloads/view/customPayloads/', params) |
| 48 | +} |
| 49 | + |
| 50 | +/** |
| 51 | + * Disables payloads for a given category. |
| 52 | + * This component is optional and therefore the API will only work if it is installed |
| 53 | + * @param {string} category - The category for which the payloads should be disabled (leave empty for all). |
| 54 | + **/ |
| 55 | +Custompayloads.prototype.disableCustomPayloads = function (args) { |
| 56 | + const params = { } |
| 57 | + if (args.category && args.category !== null) { |
| 58 | + params.category = args.category |
| 59 | + } |
| 60 | + return this.api.request('/custompayloads/action/disableCustomPayloads/', params) |
| 61 | +} |
| 62 | + |
| 63 | +/** |
| 64 | + * Enables payloads for a given category. |
| 65 | + * This component is optional and therefore the API will only work if it is installed |
| 66 | + * @param {string} category - The category for which the payloads should be enabled (leave empty for all). |
| 67 | + **/ |
| 68 | +Custompayloads.prototype.enableCustomPayloads = function (args) { |
| 69 | + const params = { } |
| 70 | + if (args.category && args.category !== null) { |
| 71 | + params.category = args.category |
| 72 | + } |
| 73 | + return this.api.request('/custompayloads/action/enableCustomPayloads/', params) |
| 74 | +} |
| 75 | + |
| 76 | +/** |
| 77 | + * Removes a payload. |
| 78 | + * This component is optional and therefore the API will only work if it is installed |
| 79 | + * @param {string} category - The category of the payload being removed. |
| 80 | + * @param {string} payload - The payload being removed. |
| 81 | + **/ |
| 82 | +Custompayloads.prototype.removeCustomPayload = function (args) { |
| 83 | + const params = { category: args.category } |
| 84 | + if (args.payload && args.payload !== null) { |
| 85 | + params.payload = args.payload |
| 86 | + } |
| 87 | + return this.api.request('/custompayloads/action/removeCustomPayload/', params) |
| 88 | +} |
| 89 | + |
| 90 | +/** |
| 91 | + * Adds a new payload. |
| 92 | + * This component is optional and therefore the API will only work if it is installed |
| 93 | + * @param {string} category - The category for the new payload. |
| 94 | + * @param {string} payload - The payload to be added. |
| 95 | + **/ |
| 96 | +Custompayloads.prototype.addCustomPayload = function (args) { |
| 97 | + const params = { category: args.category } |
| 98 | + if (args.payload && args.payload !== null) { |
| 99 | + params.payload = args.payload |
| 100 | + } |
| 101 | + return this.api.request('/custompayloads/action/addCustomPayload/', params) |
| 102 | +} |
| 103 | + |
| 104 | +/** |
| 105 | + * Enables a given payload. |
| 106 | + * This component is optional and therefore the API will only work if it is installed |
| 107 | + * @param {string} category - The category for the payload being enabled. |
| 108 | + * @param {string} payload - The payload being enabled. |
| 109 | + **/ |
| 110 | +Custompayloads.prototype.enableCustomPayload = function (args) { |
| 111 | + const params = { category: args.category } |
| 112 | + if (args.payload && args.payload !== null) { |
| 113 | + params.payload = args.payload |
| 114 | + } |
| 115 | + return this.api.request('/custompayloads/action/enableCustomPayload/', params) |
| 116 | +} |
| 117 | + |
| 118 | +/** |
| 119 | + * Disables a given payload. |
| 120 | + * This component is optional and therefore the API will only work if it is installed |
| 121 | + * @param {string} category - The category for the payload being disabled. |
| 122 | + * @param {string} payload - The payload being disabled. |
| 123 | + **/ |
| 124 | +Custompayloads.prototype.disableCustomPayload = function (args) { |
| 125 | + const params = { category: args.category } |
| 126 | + if (args.payload && args.payload !== null) { |
| 127 | + params.payload = args.payload |
| 128 | + } |
| 129 | + return this.api.request('/custompayloads/action/disableCustomPayload/', params) |
| 130 | +} |
| 131 | + |
| 132 | +module.exports = Custompayloads |
0 commit comments