@itentialopensource/adapter-zscaler 0.10.7 → 0.10.8
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/CALLS.md +14 -2
- package/CHANGELOG.md +8 -0
- package/adapter.js +182 -2
- package/entities/URLCategories/action.json +40 -0
- package/entities/URLCategories/schema.json +3 -1
- package/package.json +1 -1
- package/pronghorn.json +102 -0
- package/refs?service=git-upload-pack +0 -0
- package/report/adapterInfo.json +7 -7
- package/test/integration/adapterTestIntegration.js +85 -0
- package/test/unit/adapterTestUnit.js +70 -0
package/CALLS.md
CHANGED
|
@@ -395,8 +395,8 @@ Specific adapter calls are built based on the API of the Adapter for Zscaler. Th
|
|
|
395
395
|
<td style="padding:15px">Yes</td>
|
|
396
396
|
</tr>
|
|
397
397
|
<tr>
|
|
398
|
-
<td style="padding:15px">
|
|
399
|
-
<td style="padding:15px">Gets information about all or custom URL categories</td>
|
|
398
|
+
<td style="padding:15px">getUrlCategoriesWithOptions(queryData, callback)</td>
|
|
399
|
+
<td style="padding:15px">Gets information about all or custom URL categories with query data</td>
|
|
400
400
|
<td style="padding:15px">{base_path}/{version}/urlCategories?{query}</td>
|
|
401
401
|
<td style="padding:15px">Yes</td>
|
|
402
402
|
</tr>
|
|
@@ -1660,5 +1660,17 @@ Specific adapter calls are built based on the API of the Adapter for Zscaler. Th
|
|
|
1660
1660
|
<td style="padding:15px">{base_path}/{version}/locations/groups?{query}</td>
|
|
1661
1661
|
<td style="padding:15px">Yes</td>
|
|
1662
1662
|
</tr>
|
|
1663
|
+
<tr>
|
|
1664
|
+
<td style="padding:15px">postUrlCategoriesReviewDomain(body, callback)</td>
|
|
1665
|
+
<td style="padding:15px">URL Categories - Review Domain</td>
|
|
1666
|
+
<td style="padding:15px">{base_path}/{version}/urlCategories/review/domains?{query}</td>
|
|
1667
|
+
<td style="padding:15px">Yes</td>
|
|
1668
|
+
</tr>
|
|
1669
|
+
<tr>
|
|
1670
|
+
<td style="padding:15px">putUrlCategoriesReviewDomainAddURLs(body, callback)</td>
|
|
1671
|
+
<td style="padding:15px">URL Categories - Review Domain - Add URLs</td>
|
|
1672
|
+
<td style="padding:15px">{base_path}/{version}/urlCategories/review/domains?{query}</td>
|
|
1673
|
+
<td style="padding:15px">Yes</td>
|
|
1674
|
+
</tr>
|
|
1663
1675
|
</table>
|
|
1664
1676
|
<br>
|
package/CHANGELOG.md
CHANGED
package/adapter.js
CHANGED
|
@@ -2716,7 +2716,20 @@ class Zscaler extends AdapterBaseCl {
|
|
|
2716
2716
|
*/
|
|
2717
2717
|
/* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
|
|
2718
2718
|
getUrlCategories(customOnly, callback) {
|
|
2719
|
-
const
|
|
2719
|
+
const queryData = { customOnly };
|
|
2720
|
+
this.getUrlCategoriesWithOptions(queryData, callback);
|
|
2721
|
+
}
|
|
2722
|
+
|
|
2723
|
+
/**
|
|
2724
|
+
* @summary Gets information about all or custom URL categories
|
|
2725
|
+
*
|
|
2726
|
+
* @function getUrlCategoriesWithOptions
|
|
2727
|
+
* @param {object} queryData - object of query data - includeOnlyUrlKeywordCounts, customOnly
|
|
2728
|
+
* @param {getCallback} callback - a callback function to return the result
|
|
2729
|
+
*/
|
|
2730
|
+
/* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
|
|
2731
|
+
getUrlCategoriesWithOptions(queryData, callback) {
|
|
2732
|
+
const meth = 'adapter-getUrlCategoriesWithOptions';
|
|
2720
2733
|
const origin = `${this.id}-${meth}`;
|
|
2721
2734
|
log.trace(origin);
|
|
2722
2735
|
|
|
@@ -2729,7 +2742,10 @@ class Zscaler extends AdapterBaseCl {
|
|
|
2729
2742
|
/* HERE IS WHERE YOU VALIDATE DATA */
|
|
2730
2743
|
|
|
2731
2744
|
/* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
|
|
2732
|
-
|
|
2745
|
+
let queryParamsAvailable = {};
|
|
2746
|
+
if (queryData) {
|
|
2747
|
+
queryParamsAvailable = queryData;
|
|
2748
|
+
}
|
|
2733
2749
|
const queryParams = {};
|
|
2734
2750
|
const pathVars = [];
|
|
2735
2751
|
const bodyVars = {};
|
|
@@ -19478,6 +19494,170 @@ class Zscaler extends AdapterBaseCl {
|
|
|
19478
19494
|
return callback(null, errorObj);
|
|
19479
19495
|
}
|
|
19480
19496
|
}
|
|
19497
|
+
|
|
19498
|
+
/**
|
|
19499
|
+
* @function postUrlCategoriesReviewDomain
|
|
19500
|
+
* @pronghornType method
|
|
19501
|
+
* @name postUrlCategoriesReviewDomain
|
|
19502
|
+
* @summary URL Categories - Review Domain
|
|
19503
|
+
*
|
|
19504
|
+
* @param {array} body - body param
|
|
19505
|
+
* @param {getCallback} callback - a callback function to return the result
|
|
19506
|
+
* @return {object} results - An object containing the response of the action
|
|
19507
|
+
*
|
|
19508
|
+
* @route {POST} /postUrlCategoriesReviewDomain
|
|
19509
|
+
* @roles admin
|
|
19510
|
+
* @task true
|
|
19511
|
+
*/
|
|
19512
|
+
/* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
|
|
19513
|
+
postUrlCategoriesReviewDomain(body, callback) {
|
|
19514
|
+
const meth = 'adapter-postUrlCategoriesReviewDomain';
|
|
19515
|
+
const origin = `${this.id}-${meth}`;
|
|
19516
|
+
log.trace(origin);
|
|
19517
|
+
|
|
19518
|
+
if (this.suspended && this.suspendMode === 'error') {
|
|
19519
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
|
|
19520
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
19521
|
+
return callback(null, errorObj);
|
|
19522
|
+
}
|
|
19523
|
+
|
|
19524
|
+
/* HERE IS WHERE YOU VALIDATE DATA */
|
|
19525
|
+
if (body === undefined || body === null || body === '') {
|
|
19526
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], null, null, null);
|
|
19527
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
19528
|
+
return callback(null, errorObj);
|
|
19529
|
+
}
|
|
19530
|
+
|
|
19531
|
+
/* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
|
|
19532
|
+
const queryParamsAvailable = {};
|
|
19533
|
+
const queryParams = {};
|
|
19534
|
+
const pathVars = [];
|
|
19535
|
+
const bodyVars = body;
|
|
19536
|
+
|
|
19537
|
+
// loop in template. long callback arg name to avoid identifier conflicts
|
|
19538
|
+
Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
|
|
19539
|
+
if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
|
|
19540
|
+
&& queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
|
|
19541
|
+
queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
|
|
19542
|
+
}
|
|
19543
|
+
});
|
|
19544
|
+
|
|
19545
|
+
// set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
|
|
19546
|
+
// see adapter code documentation for more information on the request object's fields
|
|
19547
|
+
const reqObj = {
|
|
19548
|
+
payload: bodyVars,
|
|
19549
|
+
uriPathVars: pathVars,
|
|
19550
|
+
uriQuery: queryParams
|
|
19551
|
+
};
|
|
19552
|
+
|
|
19553
|
+
try {
|
|
19554
|
+
// Make the call -
|
|
19555
|
+
// identifyRequest(entity, action, requestObj, returnDataFlag, callback)
|
|
19556
|
+
return this.requestHandlerInst.identifyRequest('URLCategories', 'postUrlCategoriesReviewDomain', reqObj, true, (irReturnData, irReturnError) => {
|
|
19557
|
+
// if we received an error or their is no response on the results
|
|
19558
|
+
// return an error
|
|
19559
|
+
if (irReturnError) {
|
|
19560
|
+
/* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
|
|
19561
|
+
return callback(null, irReturnError);
|
|
19562
|
+
}
|
|
19563
|
+
if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
|
|
19564
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['postUrlCategoriesReviewDomain'], null, null, null);
|
|
19565
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
19566
|
+
return callback(null, errorObj);
|
|
19567
|
+
}
|
|
19568
|
+
|
|
19569
|
+
/* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
|
|
19570
|
+
// return the response
|
|
19571
|
+
return callback(irReturnData, null);
|
|
19572
|
+
});
|
|
19573
|
+
} catch (ex) {
|
|
19574
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
|
|
19575
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
19576
|
+
return callback(null, errorObj);
|
|
19577
|
+
}
|
|
19578
|
+
}
|
|
19579
|
+
|
|
19580
|
+
/**
|
|
19581
|
+
* @function putUrlCategoriesReviewDomainAddURLs
|
|
19582
|
+
* @pronghornType method
|
|
19583
|
+
* @name putUrlCategoriesReviewDomainAddURLs
|
|
19584
|
+
* @summary URL Categories - Review Domain - Add URLs
|
|
19585
|
+
*
|
|
19586
|
+
* @param {array} body - body param
|
|
19587
|
+
* @param {getCallback} callback - a callback function to return the result
|
|
19588
|
+
* @return {object} results - An object containing the response of the action
|
|
19589
|
+
*
|
|
19590
|
+
* @route {POST} /putUrlCategoriesReviewDomainAddURLs
|
|
19591
|
+
* @roles admin
|
|
19592
|
+
* @task true
|
|
19593
|
+
*/
|
|
19594
|
+
/* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
|
|
19595
|
+
putUrlCategoriesReviewDomainAddURLs(body, callback) {
|
|
19596
|
+
const meth = 'adapter-putUrlCategoriesReviewDomainAddURLs';
|
|
19597
|
+
const origin = `${this.id}-${meth}`;
|
|
19598
|
+
log.trace(origin);
|
|
19599
|
+
|
|
19600
|
+
if (this.suspended && this.suspendMode === 'error') {
|
|
19601
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
|
|
19602
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
19603
|
+
return callback(null, errorObj);
|
|
19604
|
+
}
|
|
19605
|
+
|
|
19606
|
+
/* HERE IS WHERE YOU VALIDATE DATA */
|
|
19607
|
+
if (body === undefined || body === null || body === '') {
|
|
19608
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], null, null, null);
|
|
19609
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
19610
|
+
return callback(null, errorObj);
|
|
19611
|
+
}
|
|
19612
|
+
|
|
19613
|
+
/* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
|
|
19614
|
+
const queryParamsAvailable = {};
|
|
19615
|
+
const queryParams = {};
|
|
19616
|
+
const pathVars = [];
|
|
19617
|
+
const bodyVars = body;
|
|
19618
|
+
|
|
19619
|
+
// loop in template. long callback arg name to avoid identifier conflicts
|
|
19620
|
+
Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
|
|
19621
|
+
if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
|
|
19622
|
+
&& queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
|
|
19623
|
+
queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
|
|
19624
|
+
}
|
|
19625
|
+
});
|
|
19626
|
+
|
|
19627
|
+
// set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
|
|
19628
|
+
// see adapter code documentation for more information on the request object's fields
|
|
19629
|
+
const reqObj = {
|
|
19630
|
+
payload: bodyVars,
|
|
19631
|
+
uriPathVars: pathVars,
|
|
19632
|
+
uriQuery: queryParams
|
|
19633
|
+
};
|
|
19634
|
+
|
|
19635
|
+
try {
|
|
19636
|
+
// Make the call -
|
|
19637
|
+
// identifyRequest(entity, action, requestObj, returnDataFlag, callback)
|
|
19638
|
+
return this.requestHandlerInst.identifyRequest('URLCategories', 'putUrlCategoriesReviewDomainAddURLs', reqObj, false, (irReturnData, irReturnError) => {
|
|
19639
|
+
// if we received an error or their is no response on the results
|
|
19640
|
+
// return an error
|
|
19641
|
+
if (irReturnError) {
|
|
19642
|
+
/* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
|
|
19643
|
+
return callback(null, irReturnError);
|
|
19644
|
+
}
|
|
19645
|
+
if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
|
|
19646
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['putUrlCategoriesReviewDomainAddURLs'], null, null, null);
|
|
19647
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
19648
|
+
return callback(null, errorObj);
|
|
19649
|
+
}
|
|
19650
|
+
|
|
19651
|
+
/* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
|
|
19652
|
+
// return the response
|
|
19653
|
+
return callback(irReturnData, null);
|
|
19654
|
+
});
|
|
19655
|
+
} catch (ex) {
|
|
19656
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
|
|
19657
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
19658
|
+
return callback(null, errorObj);
|
|
19659
|
+
}
|
|
19660
|
+
}
|
|
19481
19661
|
}
|
|
19482
19662
|
|
|
19483
19663
|
module.exports = Zscaler;
|
|
@@ -167,6 +167,46 @@
|
|
|
167
167
|
"mockFile": "mockdatafiles/postUrlLookup-default.json"
|
|
168
168
|
}
|
|
169
169
|
]
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
"name": "postUrlCategoriesReviewDomain",
|
|
173
|
+
"protocol": "REST",
|
|
174
|
+
"method": "POST",
|
|
175
|
+
"entitypath": "{base_path}/{version}/urlCategories/review/domains?{query}",
|
|
176
|
+
"requestSchema": "schema.json",
|
|
177
|
+
"responseSchema": "schema.json",
|
|
178
|
+
"timeout": 0,
|
|
179
|
+
"sendEmpty": false,
|
|
180
|
+
"requestDatatype": "JSON",
|
|
181
|
+
"responseDatatype": "JSON",
|
|
182
|
+
"headers": {},
|
|
183
|
+
"responseObjects": [
|
|
184
|
+
{
|
|
185
|
+
"type": "default",
|
|
186
|
+
"key": "",
|
|
187
|
+
"mockFile": ""
|
|
188
|
+
}
|
|
189
|
+
]
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
"name": "putUrlCategoriesReviewDomainAddURLs",
|
|
193
|
+
"protocol": "REST",
|
|
194
|
+
"method": "PUT",
|
|
195
|
+
"entitypath": "{base_path}/{version}/urlCategories/review/domains?{query}",
|
|
196
|
+
"requestSchema": "schema.json",
|
|
197
|
+
"responseSchema": "schema.json",
|
|
198
|
+
"timeout": 0,
|
|
199
|
+
"sendEmpty": false,
|
|
200
|
+
"requestDatatype": "JSON",
|
|
201
|
+
"responseDatatype": "JSON",
|
|
202
|
+
"headers": {},
|
|
203
|
+
"responseObjects": [
|
|
204
|
+
{
|
|
205
|
+
"type": "default",
|
|
206
|
+
"key": "",
|
|
207
|
+
"mockFile": ""
|
|
208
|
+
}
|
|
209
|
+
]
|
|
170
210
|
}
|
|
171
211
|
]
|
|
172
212
|
}
|
|
@@ -17,7 +17,9 @@
|
|
|
17
17
|
"getUrlCategoriescategoryId",
|
|
18
18
|
"putUrlCategoriescategoryId",
|
|
19
19
|
"deleteUrlCategoriescategoryId",
|
|
20
|
-
"postUrlLookup"
|
|
20
|
+
"postUrlLookup",
|
|
21
|
+
"postUrlCategoriesReviewDomain",
|
|
22
|
+
"putUrlCategoriesReviewDomainAddURLs"
|
|
21
23
|
],
|
|
22
24
|
"external_name": "ph_request_type"
|
|
23
25
|
}
|
package/package.json
CHANGED
package/pronghorn.json
CHANGED
|
@@ -2016,6 +2016,40 @@
|
|
|
2016
2016
|
},
|
|
2017
2017
|
"task": true
|
|
2018
2018
|
},
|
|
2019
|
+
{
|
|
2020
|
+
"name": "getUrlCategoriesWithOptions",
|
|
2021
|
+
"summary": "Gets information about all or custom URL categories with query data",
|
|
2022
|
+
"description": "Gets information about all or custom URL categories with query data",
|
|
2023
|
+
"input": [
|
|
2024
|
+
{
|
|
2025
|
+
"name": "queryData",
|
|
2026
|
+
"type": "object",
|
|
2027
|
+
"info": "Query data: includeOnlyUrlKeywordCounts, customOnly",
|
|
2028
|
+
"required": false,
|
|
2029
|
+
"schema": {
|
|
2030
|
+
"title": "queryData",
|
|
2031
|
+
"type": "object"
|
|
2032
|
+
}
|
|
2033
|
+
}
|
|
2034
|
+
],
|
|
2035
|
+
"output": {
|
|
2036
|
+
"name": "result",
|
|
2037
|
+
"type": "object",
|
|
2038
|
+
"description": "A JSON Object containing status, code and the result",
|
|
2039
|
+
"schema": {
|
|
2040
|
+
"title": "result",
|
|
2041
|
+
"type": "object"
|
|
2042
|
+
}
|
|
2043
|
+
},
|
|
2044
|
+
"roles": [
|
|
2045
|
+
"admin"
|
|
2046
|
+
],
|
|
2047
|
+
"route": {
|
|
2048
|
+
"verb": "POST",
|
|
2049
|
+
"path": "/getUrlCategoriesWithOptions"
|
|
2050
|
+
},
|
|
2051
|
+
"task": true
|
|
2052
|
+
},
|
|
2019
2053
|
{
|
|
2020
2054
|
"name": "postUrlCategories",
|
|
2021
2055
|
"summary": "Adds a new custom URL category",
|
|
@@ -20232,6 +20266,74 @@
|
|
|
20232
20266
|
"path": "/getLocationGroups"
|
|
20233
20267
|
},
|
|
20234
20268
|
"task": true
|
|
20269
|
+
},
|
|
20270
|
+
{
|
|
20271
|
+
"name": "postUrlCategoriesReviewDomain",
|
|
20272
|
+
"summary": "URL Categories - Review Domain",
|
|
20273
|
+
"description": "URL Categories - Review Domain",
|
|
20274
|
+
"input": [
|
|
20275
|
+
{
|
|
20276
|
+
"name": "body",
|
|
20277
|
+
"type": "array",
|
|
20278
|
+
"info": "The list of URLs that must be matched against the entries present in existing custom URL categories",
|
|
20279
|
+
"required": true,
|
|
20280
|
+
"schema": {
|
|
20281
|
+
"title": "body",
|
|
20282
|
+
"type": "array"
|
|
20283
|
+
}
|
|
20284
|
+
}
|
|
20285
|
+
],
|
|
20286
|
+
"output": {
|
|
20287
|
+
"name": "result",
|
|
20288
|
+
"type": "object",
|
|
20289
|
+
"description": "A JSON Object containing status, code and the result",
|
|
20290
|
+
"schema": {
|
|
20291
|
+
"title": "result",
|
|
20292
|
+
"type": "object"
|
|
20293
|
+
}
|
|
20294
|
+
},
|
|
20295
|
+
"roles": [
|
|
20296
|
+
"admin"
|
|
20297
|
+
],
|
|
20298
|
+
"route": {
|
|
20299
|
+
"verb": "POST",
|
|
20300
|
+
"path": "/postUrlCategoriesReviewDomain"
|
|
20301
|
+
},
|
|
20302
|
+
"task": true
|
|
20303
|
+
},
|
|
20304
|
+
{
|
|
20305
|
+
"name": "putUrlCategoriesReviewDomainAddURLs",
|
|
20306
|
+
"summary": "URL Categories - Review Domain - Add URLs",
|
|
20307
|
+
"description": "URL Categories - Review Domain - Add URLs",
|
|
20308
|
+
"input": [
|
|
20309
|
+
{
|
|
20310
|
+
"name": "body",
|
|
20311
|
+
"type": "array",
|
|
20312
|
+
"info": "Information about the URLs (of Subdomain type) and the respective custom categories to which they must be added.",
|
|
20313
|
+
"required": true,
|
|
20314
|
+
"schema": {
|
|
20315
|
+
"title": "body",
|
|
20316
|
+
"type": "array"
|
|
20317
|
+
}
|
|
20318
|
+
}
|
|
20319
|
+
],
|
|
20320
|
+
"output": {
|
|
20321
|
+
"name": "result",
|
|
20322
|
+
"type": "object",
|
|
20323
|
+
"description": "A JSON Object containing status, code and the result",
|
|
20324
|
+
"schema": {
|
|
20325
|
+
"title": "result",
|
|
20326
|
+
"type": "object"
|
|
20327
|
+
}
|
|
20328
|
+
},
|
|
20329
|
+
"roles": [
|
|
20330
|
+
"admin"
|
|
20331
|
+
],
|
|
20332
|
+
"route": {
|
|
20333
|
+
"verb": "POST",
|
|
20334
|
+
"path": "/putUrlCategoriesReviewDomainAddURLs"
|
|
20335
|
+
},
|
|
20336
|
+
"task": true
|
|
20235
20337
|
}
|
|
20236
20338
|
]
|
|
20237
20339
|
}
|
|
Binary file
|
package/report/adapterInfo.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.10.
|
|
3
|
-
"configLines":
|
|
2
|
+
"version": "0.10.7",
|
|
3
|
+
"configLines": 22200,
|
|
4
4
|
"scriptLines": 1783,
|
|
5
|
-
"codeLines":
|
|
6
|
-
"testLines":
|
|
7
|
-
"testCases":
|
|
8
|
-
"totalCodeLines":
|
|
9
|
-
"wfTasks":
|
|
5
|
+
"codeLines": 21117,
|
|
6
|
+
"testLines": 14797,
|
|
7
|
+
"testCases": 753,
|
|
8
|
+
"totalCodeLines": 37697,
|
|
9
|
+
"wfTasks": 271
|
|
10
10
|
}
|
|
@@ -1437,6 +1437,35 @@ describe('[integration] Zscaler Adapter Test', () => {
|
|
|
1437
1437
|
}).timeout(attemptTimeout);
|
|
1438
1438
|
});
|
|
1439
1439
|
|
|
1440
|
+
describe('#getUrlCategoriesWithOptions - errors', () => {
|
|
1441
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
1442
|
+
try {
|
|
1443
|
+
a.getUrlCategoriesWithOptions(null, (data, error) => {
|
|
1444
|
+
try {
|
|
1445
|
+
runCommonAsserts(data, error);
|
|
1446
|
+
|
|
1447
|
+
if (stub) {
|
|
1448
|
+
assert.equal('object', typeof data.response[0]);
|
|
1449
|
+
assert.equal('object', typeof data.response[1]);
|
|
1450
|
+
assert.equal('object', typeof data.response[2]);
|
|
1451
|
+
assert.equal('object', typeof data.response[3]);
|
|
1452
|
+
} else {
|
|
1453
|
+
runCommonAsserts(data, error);
|
|
1454
|
+
}
|
|
1455
|
+
|
|
1456
|
+
done();
|
|
1457
|
+
} catch (err) {
|
|
1458
|
+
log.error(`Test Failure: ${err}`);
|
|
1459
|
+
done(err);
|
|
1460
|
+
}
|
|
1461
|
+
});
|
|
1462
|
+
} catch (error) {
|
|
1463
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1464
|
+
done(error);
|
|
1465
|
+
}
|
|
1466
|
+
}).timeout(attemptTimeout);
|
|
1467
|
+
});
|
|
1468
|
+
|
|
1440
1469
|
describe('#postUrlCategories - errors', () => {
|
|
1441
1470
|
it('should work if integrated or standalone with mockdata', (done) => {
|
|
1442
1471
|
try {
|
|
@@ -7061,5 +7090,61 @@ describe('[integration] Zscaler Adapter Test', () => {
|
|
|
7061
7090
|
}
|
|
7062
7091
|
}).timeout(attemptTimeout);
|
|
7063
7092
|
});
|
|
7093
|
+
|
|
7094
|
+
const uRLCategoriespostUrlCategoriesReviewDomainBodyParam = [
|
|
7095
|
+
{}
|
|
7096
|
+
];
|
|
7097
|
+
describe('#postUrlCategoriesReviewDomain - errors', () => {
|
|
7098
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
7099
|
+
try {
|
|
7100
|
+
a.postUrlCategoriesReviewDomain(uRLCategoriespostUrlCategoriesReviewDomainBodyParam, (data, error) => {
|
|
7101
|
+
try {
|
|
7102
|
+
if (stub) {
|
|
7103
|
+
const displayE = 'Error 400 received on request';
|
|
7104
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
7105
|
+
} else {
|
|
7106
|
+
runCommonAsserts(data, error);
|
|
7107
|
+
}
|
|
7108
|
+
saveMockData('URLCategories', 'postUrlCategoriesReviewDomain', 'default', data);
|
|
7109
|
+
done();
|
|
7110
|
+
} catch (err) {
|
|
7111
|
+
log.error(`Test Failure: ${err}`);
|
|
7112
|
+
done(err);
|
|
7113
|
+
}
|
|
7114
|
+
});
|
|
7115
|
+
} catch (error) {
|
|
7116
|
+
log.error(`Adapter Exception: ${error}`);
|
|
7117
|
+
done(error);
|
|
7118
|
+
}
|
|
7119
|
+
}).timeout(attemptTimeout);
|
|
7120
|
+
});
|
|
7121
|
+
|
|
7122
|
+
const uRLCategoriesputUrlCategoriesReviewDomainAddURLsBodyParam = [
|
|
7123
|
+
{}
|
|
7124
|
+
];
|
|
7125
|
+
describe('#putUrlCategoriesReviewDomainAddURLs - errors', () => {
|
|
7126
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
7127
|
+
try {
|
|
7128
|
+
a.putUrlCategoriesReviewDomainAddURLs(uRLCategoriesputUrlCategoriesReviewDomainAddURLsBodyParam, (data, error) => {
|
|
7129
|
+
try {
|
|
7130
|
+
if (stub) {
|
|
7131
|
+
const displayE = 'Error 400 received on request';
|
|
7132
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
7133
|
+
} else {
|
|
7134
|
+
runCommonAsserts(data, error);
|
|
7135
|
+
}
|
|
7136
|
+
saveMockData('URLCategories', 'putUrlCategoriesReviewDomainAddURLs', 'default', data);
|
|
7137
|
+
done();
|
|
7138
|
+
} catch (err) {
|
|
7139
|
+
log.error(`Test Failure: ${err}`);
|
|
7140
|
+
done(err);
|
|
7141
|
+
}
|
|
7142
|
+
});
|
|
7143
|
+
} catch (error) {
|
|
7144
|
+
log.error(`Adapter Exception: ${error}`);
|
|
7145
|
+
done(error);
|
|
7146
|
+
}
|
|
7147
|
+
}).timeout(attemptTimeout);
|
|
7148
|
+
});
|
|
7064
7149
|
});
|
|
7065
7150
|
});
|
|
@@ -2039,6 +2039,18 @@ describe('[unit] Zscaler Adapter Test', () => {
|
|
|
2039
2039
|
}).timeout(attemptTimeout);
|
|
2040
2040
|
});
|
|
2041
2041
|
|
|
2042
|
+
describe('#getUrlCategoriesWithOptions - errors', () => {
|
|
2043
|
+
it('should have a getUrlCategoriesWithOptions function', (done) => {
|
|
2044
|
+
try {
|
|
2045
|
+
assert.equal(true, typeof a.getUrlCategoriesWithOptions === 'function');
|
|
2046
|
+
done();
|
|
2047
|
+
} catch (error) {
|
|
2048
|
+
log.error(`Test Failure: ${error}`);
|
|
2049
|
+
done(error);
|
|
2050
|
+
}
|
|
2051
|
+
}).timeout(attemptTimeout);
|
|
2052
|
+
});
|
|
2053
|
+
|
|
2042
2054
|
describe('#postUrlCategories - errors', () => {
|
|
2043
2055
|
it('should have a postUrlCategories function', (done) => {
|
|
2044
2056
|
try {
|
|
@@ -6343,5 +6355,63 @@ describe('[unit] Zscaler Adapter Test', () => {
|
|
|
6343
6355
|
}
|
|
6344
6356
|
}).timeout(attemptTimeout);
|
|
6345
6357
|
});
|
|
6358
|
+
|
|
6359
|
+
describe('#postUrlCategoriesReviewDomain - errors', () => {
|
|
6360
|
+
it('should have a postUrlCategoriesReviewDomain function', (done) => {
|
|
6361
|
+
try {
|
|
6362
|
+
assert.equal(true, typeof a.postUrlCategoriesReviewDomain === 'function');
|
|
6363
|
+
done();
|
|
6364
|
+
} catch (error) {
|
|
6365
|
+
log.error(`Test Failure: ${error}`);
|
|
6366
|
+
done(error);
|
|
6367
|
+
}
|
|
6368
|
+
}).timeout(attemptTimeout);
|
|
6369
|
+
it('should error if - missing body', (done) => {
|
|
6370
|
+
try {
|
|
6371
|
+
a.postUrlCategoriesReviewDomain(null, (data, error) => {
|
|
6372
|
+
try {
|
|
6373
|
+
const displayE = 'body is required';
|
|
6374
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-zscaler-adapter-postUrlCategoriesReviewDomain', displayE);
|
|
6375
|
+
done();
|
|
6376
|
+
} catch (err) {
|
|
6377
|
+
log.error(`Test Failure: ${err}`);
|
|
6378
|
+
done(err);
|
|
6379
|
+
}
|
|
6380
|
+
});
|
|
6381
|
+
} catch (error) {
|
|
6382
|
+
log.error(`Adapter Exception: ${error}`);
|
|
6383
|
+
done(error);
|
|
6384
|
+
}
|
|
6385
|
+
}).timeout(attemptTimeout);
|
|
6386
|
+
});
|
|
6387
|
+
|
|
6388
|
+
describe('#putUrlCategoriesReviewDomainAddURLs - errors', () => {
|
|
6389
|
+
it('should have a putUrlCategoriesReviewDomainAddURLs function', (done) => {
|
|
6390
|
+
try {
|
|
6391
|
+
assert.equal(true, typeof a.putUrlCategoriesReviewDomainAddURLs === 'function');
|
|
6392
|
+
done();
|
|
6393
|
+
} catch (error) {
|
|
6394
|
+
log.error(`Test Failure: ${error}`);
|
|
6395
|
+
done(error);
|
|
6396
|
+
}
|
|
6397
|
+
}).timeout(attemptTimeout);
|
|
6398
|
+
it('should error if - missing body', (done) => {
|
|
6399
|
+
try {
|
|
6400
|
+
a.putUrlCategoriesReviewDomainAddURLs(null, (data, error) => {
|
|
6401
|
+
try {
|
|
6402
|
+
const displayE = 'body is required';
|
|
6403
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-zscaler-adapter-putUrlCategoriesReviewDomainAddURLs', displayE);
|
|
6404
|
+
done();
|
|
6405
|
+
} catch (err) {
|
|
6406
|
+
log.error(`Test Failure: ${err}`);
|
|
6407
|
+
done(err);
|
|
6408
|
+
}
|
|
6409
|
+
});
|
|
6410
|
+
} catch (error) {
|
|
6411
|
+
log.error(`Adapter Exception: ${error}`);
|
|
6412
|
+
done(error);
|
|
6413
|
+
}
|
|
6414
|
+
}).timeout(attemptTimeout);
|
|
6415
|
+
});
|
|
6346
6416
|
});
|
|
6347
6417
|
});
|