@itentialopensource/adapter-amazon_route53 0.7.1 → 0.9.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/CHANGELOG.md +8 -0
- package/PROPERTIES.md +6 -1
- package/TAB2.md +2 -1
- package/package.json +8 -8
- package/propertiesSchema.json +22 -15
- package/report/updateReport1766087408944.json +120 -0
- package/report/updateReport1770999207657.json +120 -0
- package/sampleProperties.json +3 -2
- package/test/unit/adapterTestUnit.js +2 -2
- package/utils/methodDocumentor.js +62 -37
package/CHANGELOG.md
CHANGED
package/PROPERTIES.md
CHANGED
|
@@ -54,7 +54,8 @@ This section defines **all** the properties that are available for the adapter,
|
|
|
54
54
|
"healthcheck_on_timeout": false,
|
|
55
55
|
"return_raw": false,
|
|
56
56
|
"archiving": false,
|
|
57
|
-
"return_request": false
|
|
57
|
+
"return_request": false,
|
|
58
|
+
"keep_alive_interval": 0
|
|
58
59
|
},
|
|
59
60
|
"ssl": {
|
|
60
61
|
"ecdhCurve": "",
|
|
@@ -403,6 +404,10 @@ The request section defines properties to help handle requests.
|
|
|
403
404
|
<td style="padding:15px">return_request</td>
|
|
404
405
|
<td style="padding:15px">Optional flag. Default is false. Will return the actual request that is made including headers. This should only be used during debugging issues as there could be credentials in the actual request.</td>
|
|
405
406
|
</tr>
|
|
407
|
+
<tr>
|
|
408
|
+
<td style="padding:15px">keep_alive_interval</td>
|
|
409
|
+
<td style="padding:15px">Optional. TCP keep-alive interval in seconds for long-lived connections. Set to 0 to disable keep-alive (default). When enabled, minimum value is 30 seconds.</td>
|
|
410
|
+
</tr>
|
|
406
411
|
</table>
|
|
407
412
|
<br>
|
|
408
413
|
|
package/TAB2.md
CHANGED
|
@@ -248,7 +248,8 @@ Sample Properties can be used to help you configure the adapter in the Itential
|
|
|
248
248
|
"healthcheck_on_timeout": true,
|
|
249
249
|
"return_raw": false,
|
|
250
250
|
"archiving": false,
|
|
251
|
-
"return_request": false
|
|
251
|
+
"return_request": false,
|
|
252
|
+
"keep_alive_interval": 0
|
|
252
253
|
},
|
|
253
254
|
"proxy": {
|
|
254
255
|
"enabled": false,
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itentialopensource/adapter-amazon_route53",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "This adapter integrates with system described as: Amazon Route53.",
|
|
5
5
|
"main": "adapter.js",
|
|
6
6
|
"systemName": "Amazon AWS Route53",
|
|
7
|
-
"wizardVersion": "3.
|
|
8
|
-
"engineVersion": "1.
|
|
7
|
+
"wizardVersion": "3.12.1",
|
|
8
|
+
"engineVersion": "1.82.5",
|
|
9
9
|
"adapterType": "http",
|
|
10
10
|
"scripts": {
|
|
11
11
|
"preinstall": "node utils/setup.js",
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
],
|
|
41
41
|
"license": "Apache-2.0",
|
|
42
42
|
"engines": {
|
|
43
|
-
"node": ">=
|
|
44
|
-
"npm": ">=
|
|
43
|
+
"node": ">= 18.18.0",
|
|
44
|
+
"npm": ">= 9.8.1"
|
|
45
45
|
},
|
|
46
46
|
"repository": {
|
|
47
47
|
"type": "git",
|
|
@@ -50,14 +50,14 @@
|
|
|
50
50
|
"author": "Itential",
|
|
51
51
|
"homepage": "https://gitlab.com/itentialopensource/adapters/adapter-amazon_route53#readme",
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@itentialopensource/adapter-utils": "6.
|
|
53
|
+
"@itentialopensource/adapter-utils": "6.1.14",
|
|
54
54
|
"acorn": "8.14.1",
|
|
55
55
|
"ajv": "8.17.1",
|
|
56
|
-
"axios": "1.
|
|
56
|
+
"axios": "1.13.5",
|
|
57
57
|
"commander": "11.1.0",
|
|
58
58
|
"fs-extra": "11.3.0",
|
|
59
59
|
"json-query": "2.2.2",
|
|
60
|
-
"mocha": "
|
|
60
|
+
"mocha": "11.3.0",
|
|
61
61
|
"mocha-param": "2.0.1",
|
|
62
62
|
"mongodb": "4.17.2",
|
|
63
63
|
"ping": "0.4.4",
|
package/propertiesSchema.json
CHANGED
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"boolean",
|
|
75
75
|
"string"
|
|
76
76
|
],
|
|
77
|
-
"description": "When true the metrics collected by the adapter will be stored in mongo or
|
|
77
|
+
"description": "When true the metrics collected by the adapter will be stored in mongo or in the adapter. If a full path is provided, metrics will be saved in the path provided.",
|
|
78
78
|
"default": false
|
|
79
79
|
},
|
|
80
80
|
"stub": {
|
|
@@ -555,7 +555,7 @@
|
|
|
555
555
|
"type": "integer",
|
|
556
556
|
"description": "How often the healthcheck should run (in milliseconds).",
|
|
557
557
|
"default": 300000,
|
|
558
|
-
"minimum":
|
|
558
|
+
"minimum": 30000,
|
|
559
559
|
"maximum": 3600000
|
|
560
560
|
},
|
|
561
561
|
"protocol": {
|
|
@@ -790,6 +790,13 @@
|
|
|
790
790
|
"type": "boolean",
|
|
791
791
|
"description": "This property turns on returning the response information - need to be carefull in case credentials are in the path",
|
|
792
792
|
"default": false
|
|
793
|
+
},
|
|
794
|
+
"keep_alive_interval": {
|
|
795
|
+
"type": "integer",
|
|
796
|
+
"description": "TCP keep-alive interval in milliseconds to prevent connection timeout during long-running requests. 0 = disabled (default). Minimum value when enabled is 30000ms (30 seconds). Values below 30000ms will be auto-corrected to 30000ms with a warning.",
|
|
797
|
+
"default": 0,
|
|
798
|
+
"minimum": 0,
|
|
799
|
+
"maximum": 3600000
|
|
793
800
|
}
|
|
794
801
|
},
|
|
795
802
|
"required": [
|
|
@@ -1201,7 +1208,7 @@
|
|
|
1201
1208
|
},
|
|
1202
1209
|
"requestFields": {
|
|
1203
1210
|
"type": "object",
|
|
1204
|
-
"description": "The json object with
|
|
1211
|
+
"description": "The json object with request fields of the call to getDevice",
|
|
1205
1212
|
"additionalProperties": {
|
|
1206
1213
|
"type": [
|
|
1207
1214
|
"string",
|
|
@@ -1344,7 +1351,7 @@
|
|
|
1344
1351
|
},
|
|
1345
1352
|
"requestFields": {
|
|
1346
1353
|
"type": "object",
|
|
1347
|
-
"description": "The json object with
|
|
1354
|
+
"description": "The json object with request fields of the call to getDevice",
|
|
1348
1355
|
"additionalProperties": {
|
|
1349
1356
|
"type": [
|
|
1350
1357
|
"string",
|
|
@@ -1455,7 +1462,7 @@
|
|
|
1455
1462
|
},
|
|
1456
1463
|
"requestFields": {
|
|
1457
1464
|
"type": "object",
|
|
1458
|
-
"description": "The json object with
|
|
1465
|
+
"description": "The json object with request fields of the call to getDevice",
|
|
1459
1466
|
"additionalProperties": {
|
|
1460
1467
|
"type": [
|
|
1461
1468
|
"string",
|
|
@@ -1551,7 +1558,7 @@
|
|
|
1551
1558
|
},
|
|
1552
1559
|
"requestFields": {
|
|
1553
1560
|
"type": "object",
|
|
1554
|
-
"description": "The json object with
|
|
1561
|
+
"description": "The json object with request fields of the call to getDevice",
|
|
1555
1562
|
"additionalProperties": {
|
|
1556
1563
|
"type": [
|
|
1557
1564
|
"string",
|
|
@@ -1636,7 +1643,7 @@
|
|
|
1636
1643
|
},
|
|
1637
1644
|
"requestFields": {
|
|
1638
1645
|
"type": "object",
|
|
1639
|
-
"description": "The json object with
|
|
1646
|
+
"description": "The json object with request fields of the call to getDevice",
|
|
1640
1647
|
"additionalProperties": {
|
|
1641
1648
|
"type": [
|
|
1642
1649
|
"string",
|
|
@@ -1719,12 +1726,12 @@
|
|
|
1719
1726
|
"properties": {
|
|
1720
1727
|
"path": {
|
|
1721
1728
|
"type": "string",
|
|
1722
|
-
"description": "The fully qualified path of the call to
|
|
1729
|
+
"description": "The fully qualified path of the call to populate the cache (e.g. /rest/api/devices)",
|
|
1723
1730
|
"default": ""
|
|
1724
1731
|
},
|
|
1725
1732
|
"method": {
|
|
1726
1733
|
"type": "string",
|
|
1727
|
-
"description": "The method of the call to
|
|
1734
|
+
"description": "The method of the call to populate the cache",
|
|
1728
1735
|
"default": "GET"
|
|
1729
1736
|
},
|
|
1730
1737
|
"pagination": {
|
|
@@ -1761,7 +1768,7 @@
|
|
|
1761
1768
|
},
|
|
1762
1769
|
"query": {
|
|
1763
1770
|
"type": "object",
|
|
1764
|
-
"description": "The json object with query parameters of the call to
|
|
1771
|
+
"description": "The json object with query parameters of the call to populate the cache",
|
|
1765
1772
|
"additionalProperties": {
|
|
1766
1773
|
"type": [
|
|
1767
1774
|
"string",
|
|
@@ -1771,7 +1778,7 @@
|
|
|
1771
1778
|
},
|
|
1772
1779
|
"body": {
|
|
1773
1780
|
"type": "object",
|
|
1774
|
-
"description": "The json object with body of the call to
|
|
1781
|
+
"description": "The json object with body of the call to populate the cache",
|
|
1775
1782
|
"additionalProperties": {
|
|
1776
1783
|
"type": [
|
|
1777
1784
|
"string",
|
|
@@ -1781,7 +1788,7 @@
|
|
|
1781
1788
|
},
|
|
1782
1789
|
"headers": {
|
|
1783
1790
|
"type": "object",
|
|
1784
|
-
"description": "The json object with headers of the call to
|
|
1791
|
+
"description": "The json object with headers of the call to populate the cache",
|
|
1785
1792
|
"additionalProperties": {
|
|
1786
1793
|
"type": [
|
|
1787
1794
|
"string",
|
|
@@ -1800,7 +1807,7 @@
|
|
|
1800
1807
|
},
|
|
1801
1808
|
"requestFields": {
|
|
1802
1809
|
"type": "object",
|
|
1803
|
-
"description": "The json object with
|
|
1810
|
+
"description": "The json object with request fields of the call to populate the cache",
|
|
1804
1811
|
"additionalProperties": {
|
|
1805
1812
|
"type": [
|
|
1806
1813
|
"string",
|
|
@@ -1816,7 +1823,7 @@
|
|
|
1816
1823
|
},
|
|
1817
1824
|
"responseFields": {
|
|
1818
1825
|
"type": "object",
|
|
1819
|
-
"description": "The json object with response fields of the call to
|
|
1826
|
+
"description": "The json object with response fields of the call to populate the cache",
|
|
1820
1827
|
"additionalProperties": {
|
|
1821
1828
|
"type": [
|
|
1822
1829
|
"string",
|
|
@@ -1857,4 +1864,4 @@
|
|
|
1857
1864
|
}
|
|
1858
1865
|
}
|
|
1859
1866
|
}
|
|
1860
|
-
}
|
|
1867
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
{
|
|
2
|
+
"errors": [],
|
|
3
|
+
"statistics": [
|
|
4
|
+
{
|
|
5
|
+
"owner": "errorJson",
|
|
6
|
+
"description": "New adapter errors available for use",
|
|
7
|
+
"value": 0
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"owner": "errorJson",
|
|
11
|
+
"description": "Adapter errors no longer available for use",
|
|
12
|
+
"value": 0
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"owner": "errorJson",
|
|
16
|
+
"description": "Adapter errors that have been updated (e.g. recommendation changes)",
|
|
17
|
+
"value": 31
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"owner": "packageJson",
|
|
21
|
+
"description": "Number of production dependencies",
|
|
22
|
+
"value": 15
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"owner": "packageJson",
|
|
26
|
+
"description": "Number of development dependencies",
|
|
27
|
+
"value": 6
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"owner": "packageJson",
|
|
31
|
+
"description": "Number of npm scripts",
|
|
32
|
+
"value": 17
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"owner": "packageJson",
|
|
36
|
+
"description": "Runtime Library dependency",
|
|
37
|
+
"value": "6.1.7"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"owner": "propertiesSchemaJson",
|
|
41
|
+
"description": "Adapter properties defined in the propertiesSchema file",
|
|
42
|
+
"value": 89
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"owner": "markdown",
|
|
46
|
+
"description": "Number of lines in the README.md",
|
|
47
|
+
"value": 345
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"owner": "markdown",
|
|
51
|
+
"description": "Number of lines in the SUMMARY.md",
|
|
52
|
+
"value": 9
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"owner": "markdown",
|
|
56
|
+
"description": "Number of lines in the PROPERTIES.md",
|
|
57
|
+
"value": 682
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"owner": "markdown",
|
|
61
|
+
"description": "Number of lines in the TROUBLESHOOT.md",
|
|
62
|
+
"value": 57
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"owner": "markdown",
|
|
66
|
+
"description": "Number of lines in the ENHANCE.md",
|
|
67
|
+
"value": 70
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"owner": "markdown",
|
|
71
|
+
"description": "Number of lines in the BROKER.md",
|
|
72
|
+
"value": 70
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"owner": "unitTestJS",
|
|
76
|
+
"description": "Number of lines of code in unit tests",
|
|
77
|
+
"value": 3555
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"owner": "unitTestJS",
|
|
81
|
+
"description": "Number of unit tests",
|
|
82
|
+
"value": 209
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"owner": "integrationTestJS",
|
|
86
|
+
"description": "Number of lines of code in integration tests",
|
|
87
|
+
"value": 2075
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"owner": "integrationTestJS",
|
|
91
|
+
"description": "Number of integration tests",
|
|
92
|
+
"value": 73
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"owner": "staticFile",
|
|
96
|
+
"description": "Number of lines of code in adapterBase.js",
|
|
97
|
+
"value": 1527
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"owner": "staticFile",
|
|
101
|
+
"description": "Number of static files added",
|
|
102
|
+
"value": 37
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"owner": "Overall",
|
|
106
|
+
"description": "Total lines of Code",
|
|
107
|
+
"value": 7157
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"owner": "Overall",
|
|
111
|
+
"description": "Total Tests",
|
|
112
|
+
"value": 282
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"owner": "Overall",
|
|
116
|
+
"description": "Total Files",
|
|
117
|
+
"value": 6
|
|
118
|
+
}
|
|
119
|
+
]
|
|
120
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
{
|
|
2
|
+
"errors": [],
|
|
3
|
+
"statistics": [
|
|
4
|
+
{
|
|
5
|
+
"owner": "errorJson",
|
|
6
|
+
"description": "New adapter errors available for use",
|
|
7
|
+
"value": 0
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"owner": "errorJson",
|
|
11
|
+
"description": "Adapter errors no longer available for use",
|
|
12
|
+
"value": 0
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"owner": "errorJson",
|
|
16
|
+
"description": "Adapter errors that have been updated (e.g. recommendation changes)",
|
|
17
|
+
"value": 31
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"owner": "packageJson",
|
|
21
|
+
"description": "Number of production dependencies",
|
|
22
|
+
"value": 15
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"owner": "packageJson",
|
|
26
|
+
"description": "Number of development dependencies",
|
|
27
|
+
"value": 6
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"owner": "packageJson",
|
|
31
|
+
"description": "Number of npm scripts",
|
|
32
|
+
"value": 17
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"owner": "packageJson",
|
|
36
|
+
"description": "Runtime Library dependency",
|
|
37
|
+
"value": "6.1.14"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"owner": "propertiesSchemaJson",
|
|
41
|
+
"description": "Adapter properties defined in the propertiesSchema file",
|
|
42
|
+
"value": 89
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"owner": "markdown",
|
|
46
|
+
"description": "Number of lines in the README.md",
|
|
47
|
+
"value": 345
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"owner": "markdown",
|
|
51
|
+
"description": "Number of lines in the SUMMARY.md",
|
|
52
|
+
"value": 9
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"owner": "markdown",
|
|
56
|
+
"description": "Number of lines in the PROPERTIES.md",
|
|
57
|
+
"value": 682
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"owner": "markdown",
|
|
61
|
+
"description": "Number of lines in the TROUBLESHOOT.md",
|
|
62
|
+
"value": 57
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"owner": "markdown",
|
|
66
|
+
"description": "Number of lines in the ENHANCE.md",
|
|
67
|
+
"value": 70
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"owner": "markdown",
|
|
71
|
+
"description": "Number of lines in the BROKER.md",
|
|
72
|
+
"value": 70
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"owner": "unitTestJS",
|
|
76
|
+
"description": "Number of lines of code in unit tests",
|
|
77
|
+
"value": 3555
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"owner": "unitTestJS",
|
|
81
|
+
"description": "Number of unit tests",
|
|
82
|
+
"value": 209
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"owner": "integrationTestJS",
|
|
86
|
+
"description": "Number of lines of code in integration tests",
|
|
87
|
+
"value": 2075
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"owner": "integrationTestJS",
|
|
91
|
+
"description": "Number of integration tests",
|
|
92
|
+
"value": 73
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"owner": "staticFile",
|
|
96
|
+
"description": "Number of lines of code in adapterBase.js",
|
|
97
|
+
"value": 1527
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"owner": "staticFile",
|
|
101
|
+
"description": "Number of static files added",
|
|
102
|
+
"value": 37
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"owner": "Overall",
|
|
106
|
+
"description": "Total lines of Code",
|
|
107
|
+
"value": 7157
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"owner": "Overall",
|
|
111
|
+
"description": "Total Tests",
|
|
112
|
+
"value": 282
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"owner": "Overall",
|
|
116
|
+
"description": "Total Files",
|
|
117
|
+
"value": 6
|
|
118
|
+
}
|
|
119
|
+
]
|
|
120
|
+
}
|
package/sampleProperties.json
CHANGED
|
@@ -98,7 +98,8 @@
|
|
|
98
98
|
"healthcheck_on_timeout": true,
|
|
99
99
|
"return_raw": false,
|
|
100
100
|
"archiving": false,
|
|
101
|
-
"return_request": false
|
|
101
|
+
"return_request": false,
|
|
102
|
+
"keep_alive_interval": 0
|
|
102
103
|
},
|
|
103
104
|
"proxy": {
|
|
104
105
|
"enabled": false,
|
|
@@ -287,4 +288,4 @@
|
|
|
287
288
|
"brokers": [],
|
|
288
289
|
"logLevel": "none",
|
|
289
290
|
"timeout": 120000
|
|
290
|
-
}
|
|
291
|
+
}
|
|
@@ -280,10 +280,10 @@ describe('[unit] Amazon_route53 Adapter Test', () => {
|
|
|
280
280
|
assert.notEqual(null, packageDotJson.dependencies);
|
|
281
281
|
assert.notEqual('', packageDotJson.dependencies);
|
|
282
282
|
assert.equal('8.17.1', packageDotJson.dependencies.ajv);
|
|
283
|
-
assert.equal('1.
|
|
283
|
+
assert.equal('1.13.5', packageDotJson.dependencies.axios);
|
|
284
284
|
assert.equal('11.1.0', packageDotJson.dependencies.commander);
|
|
285
285
|
assert.equal('11.3.0', packageDotJson.dependencies['fs-extra']);
|
|
286
|
-
assert.equal('
|
|
286
|
+
assert.equal('11.3.0', packageDotJson.dependencies.mocha);
|
|
287
287
|
assert.equal('2.0.1', packageDotJson.dependencies['mocha-param']);
|
|
288
288
|
assert.equal('0.4.4', packageDotJson.dependencies.ping);
|
|
289
289
|
assert.equal('1.4.10', packageDotJson.dependencies['readline-sync']);
|
|
@@ -19,17 +19,14 @@ function createObjectForFunction(
|
|
|
19
19
|
workflow
|
|
20
20
|
) {
|
|
21
21
|
const funcObject = {};
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
funcObject.
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
funcObject.description = description;
|
|
31
|
-
funcObject.workflow = workflow;
|
|
32
|
-
}
|
|
22
|
+
funcObject.method_signature = `${funcName}(${funcArgs.join(', ')})`;
|
|
23
|
+
funcObject.path = entityPath !== undefined ? entityPath : '';
|
|
24
|
+
if (description === undefined) {
|
|
25
|
+
funcObject.description = '';
|
|
26
|
+
funcObject.workflow = 'No';
|
|
27
|
+
} else {
|
|
28
|
+
funcObject.description = description;
|
|
29
|
+
funcObject.workflow = workflow;
|
|
33
30
|
}
|
|
34
31
|
return funcObject;
|
|
35
32
|
}
|
|
@@ -77,7 +74,8 @@ function readFileUsingLib(filename, descriptionObj, workflowObj, functionList) {
|
|
|
77
74
|
// parsing the file to get the function and class declarations.
|
|
78
75
|
const aFileFuncArgs = acorn.parse(aFile, { ecmaVersion: 2020 });
|
|
79
76
|
|
|
80
|
-
|
|
77
|
+
// Track all method names that can be called (identifyRequest + any proxy methods)
|
|
78
|
+
const allowedCallNames = new Set(['identifyRequest']);
|
|
81
79
|
// Looping through all the declarations parsed:
|
|
82
80
|
aFileFuncArgs.body.forEach((e) => {
|
|
83
81
|
// Getting only the class declaration as it has our required functions.
|
|
@@ -103,9 +101,10 @@ function readFileUsingLib(filename, descriptionObj, workflowObj, functionList) {
|
|
|
103
101
|
method.value.body.body.forEach((statement) => {
|
|
104
102
|
recurseCallExpressions(statement, callList);
|
|
105
103
|
});
|
|
104
|
+
// Find calls to identifyRequest OR any discovered proxy methods
|
|
106
105
|
const requests = [];
|
|
107
106
|
for (let i = 0; i < callList.length; i += 1) {
|
|
108
|
-
if (callList[i].callee.property && callList[i].callee.property.name
|
|
107
|
+
if (callList[i].callee.property && allowedCallNames.has(callList[i].callee.property.name)) {
|
|
109
108
|
requests.push(callList[i]);
|
|
110
109
|
}
|
|
111
110
|
}
|
|
@@ -114,34 +113,60 @@ function readFileUsingLib(filename, descriptionObj, workflowObj, functionList) {
|
|
|
114
113
|
if (expr.arguments.length < 2) {
|
|
115
114
|
throw new Error(`Bad inputs in method ${funcName}`);
|
|
116
115
|
}
|
|
117
|
-
|
|
118
|
-
const
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
116
|
+
|
|
117
|
+
const arg0Type = expr.arguments[0].type;
|
|
118
|
+
const arg1Type = expr.arguments[1].type;
|
|
119
|
+
|
|
120
|
+
let entityPath;
|
|
121
|
+
|
|
122
|
+
if (arg0Type === 'Literal' && arg1Type === 'Literal') {
|
|
123
|
+
const entity = expr.arguments[0].value;
|
|
124
|
+
const actionName = expr.arguments[1].value;
|
|
125
|
+
entityPath = getPathFromEntity(entity, actionName);
|
|
126
|
+
} else {
|
|
127
|
+
// Non-standard format: anything that's not both literals
|
|
128
|
+
// Special handling for proxy methods (both args are identifiers matching first 2 params)
|
|
129
|
+
if (arg0Type === 'Identifier' && arg1Type === 'Identifier') {
|
|
130
|
+
const param1 = method.value.params[0];
|
|
131
|
+
const param2 = method.value.params[1];
|
|
132
|
+
const arg0Name = expr.arguments[0].name;
|
|
133
|
+
const arg1Name = expr.arguments[1].name;
|
|
134
|
+
|
|
135
|
+
// Check if this is a valid proxy method
|
|
136
|
+
const isValidProxy = param1 && param2
|
|
137
|
+
&& param1.type === 'Identifier' && param2.type === 'Identifier'
|
|
138
|
+
&& param1.name === arg0Name && param2.name === arg1Name;
|
|
139
|
+
|
|
140
|
+
// Only process valid proxy methods
|
|
141
|
+
if (isValidProxy) {
|
|
142
|
+
const calledMethod = expr.callee.property.name;
|
|
143
|
+
|
|
144
|
+
// Skip nested proxies (proxies calling other proxies)
|
|
145
|
+
if (calledMethod !== 'identifyRequest') {
|
|
146
|
+
console.log(`Skipping nested proxy method: ${funcName} (calls ${calledMethod})`);
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
// First-level proxy: calls identifyRequest directly
|
|
151
|
+
// Add this proxy to the set so other methods can call it
|
|
152
|
+
allowedCallNames.add(funcName);
|
|
153
|
+
}
|
|
128
154
|
}
|
|
129
|
-
|
|
155
|
+
|
|
156
|
+
// All non-standard formats get documented without path
|
|
157
|
+
entityPath = undefined;
|
|
130
158
|
}
|
|
131
|
-
const entityPath = getPathFromEntity(entity, actionName);
|
|
132
159
|
|
|
133
160
|
// Creating and storing the object for the method.
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
);
|
|
144
|
-
}
|
|
161
|
+
functionList.push(
|
|
162
|
+
createObjectForFunction(
|
|
163
|
+
funcName,
|
|
164
|
+
funcArgs,
|
|
165
|
+
entityPath,
|
|
166
|
+
descriptionObj[funcName],
|
|
167
|
+
workflowObj[funcName]
|
|
168
|
+
)
|
|
169
|
+
);
|
|
145
170
|
}
|
|
146
171
|
});
|
|
147
172
|
}
|