@appland/scanner 1.56.0 → 1.57.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 +15 -0
- package/built/algorithms/dataStructures/graph/Graph.js +53 -62
- package/built/algorithms/dataStructures/graph/GraphEdge.js +13 -16
- package/built/algorithms/dataStructures/graph/GraphVertex.js +37 -42
- package/built/algorithms/dataStructures/linked-list/LinkedList.js +33 -38
- package/built/algorithms/dataStructures/linked-list/LinkedListNode.js +6 -10
- package/built/algorithms/graph/depth-first-search/index.js +7 -8
- package/built/algorithms/graph/detect-cycle/index.js +15 -16
- package/built/algorithms/utils/Comparator.js +19 -21
- package/built/analyzer/recordSecrets.js +7 -30
- package/built/analyzer/secretsRegexes.js +8 -9
- package/built/appMapIndex.js +18 -20
- package/built/check.js +16 -18
- package/built/checkInstance.js +26 -48
- package/built/cli/ci/command.js +61 -156
- package/built/cli/ci/options.js +0 -1
- package/built/cli/codeVersionArgs.js +0 -1
- package/built/cli/exitCode.js +0 -1
- package/built/cli/fail.js +2 -3
- package/built/cli/merge/command.js +21 -63
- package/built/cli/merge/options.js +0 -1
- package/built/cli/reportUploadURL.js +2 -3
- package/built/cli/resolveAppId.js +34 -85
- package/built/cli/scan/command.js +52 -94
- package/built/cli/scan/formatReport.js +16 -89
- package/built/cli/scan/options.js +0 -1
- package/built/cli/scan/scanner.js +38 -117
- package/built/cli/scan/singleScan.js +61 -109
- package/built/cli/scan/watchScan.js +32 -82
- package/built/cli/scan.js +39 -132
- package/built/cli/scanArgs.js +0 -1
- package/built/cli/scanOptions.js +0 -1
- package/built/cli/updateCommitStatus.js +10 -47
- package/built/cli/upload/command.js +20 -64
- package/built/cli/upload/options.js +0 -1
- package/built/cli/upload/pruneAppMap.js +16 -0
- package/built/cli/upload.js +91 -172
- package/built/cli/validateFile.js +13 -52
- package/built/cli.js +34 -21
- package/built/configuration/configurationProvider.js +148 -233
- package/built/configuration/schema/options.json +76 -76
- package/built/configuration/types/checkConfig.js +0 -1
- package/built/configuration/types/configuration.js +0 -1
- package/built/configuration/types/matchEventConfig.js +0 -1
- package/built/configuration/types/matchPatternConfig.js +0 -1
- package/built/database/index.js +33 -127
- package/built/database/visit.js +16 -66
- package/built/errors.js +4 -30
- package/built/eventUtil.js +10 -35
- package/built/findings.js +3 -4
- package/built/integration/appland/app/exists.js +33 -76
- package/built/integration/appland/app/listFindingStatus.js +3 -36
- package/built/integration/appland/appMap/create.js +38 -89
- package/built/integration/appland/location.js +0 -1
- package/built/integration/appland/mapset/create.js +34 -85
- package/built/integration/appland/retry.js +10 -11
- package/built/integration/appland/retryOptions.js +0 -1
- package/built/integration/appland/scannerJob/create.js +34 -84
- package/built/integration/appland/scannerJob/merge.js +28 -74
- package/built/integration/appland/scannerJob.js +0 -1
- package/built/integration/github/commitStatus.js +3 -4
- package/built/integration/vars.js +1 -2
- package/built/openapi/index.js +39 -83
- package/built/report/appMapMetadata.js +0 -1
- package/built/report/findingSummary.js +0 -1
- package/built/report/findingsReport.js +14 -16
- package/built/report/scanResults.js +18 -45
- package/built/report/scanSummary.js +0 -1
- package/built/report/summaryReport.js +12 -13
- package/built/ruleChecker.js +146 -297
- package/built/rules/authzBeforeAuthn.js +25 -59
- package/built/rules/circularDependency.js +69 -101
- package/built/rules/deserializationOfUntrustedData.js +29 -63
- package/built/rules/execOfUntrustedCommand.js +28 -62
- package/built/rules/http-500/metadata.js +0 -1
- package/built/rules/http-500/rule.js +2 -3
- package/built/rules/illegalPackageDependency.js +16 -18
- package/built/rules/incompatibleHttpClientRequest.js +30 -69
- package/built/rules/insecureCompare.js +12 -13
- package/built/rules/jobNotCancelled.js +13 -45
- package/built/rules/lib/hasParameterOrReceiver.js +4 -7
- package/built/rules/lib/matchEvent.js +12 -13
- package/built/rules/lib/matchPattern.js +6 -7
- package/built/rules/lib/metadata.js +0 -1
- package/built/rules/lib/parseRuleDescription.js +5 -6
- package/built/rules/lib/precedingEvents.js +7 -75
- package/built/rules/lib/rpcWithoutProtection.js +5 -28
- package/built/rules/lib/sanitizesData.js +0 -1
- package/built/rules/lib/util.js +33 -73
- package/built/rules/logoutWithoutSessionReset.js +24 -58
- package/built/rules/missingAuthentication.js +28 -28
- package/built/rules/missingContentType.js +8 -9
- package/built/rules/nPlusOneQuery.js +35 -87
- package/built/rules/queryFromInvalidPackage.js +17 -19
- package/built/rules/queryFromView.js +13 -16
- package/built/rules/rpcWithoutCircuitBreaker.js +14 -84
- package/built/rules/saveWithoutValidation.js +8 -9
- package/built/rules/secretInLog.js +29 -92
- package/built/rules/slowFunctionCall.js +16 -20
- package/built/rules/slowHttpServerRequest.js +9 -11
- package/built/rules/slowQuery.js +9 -12
- package/built/rules/tooManyJoins.js +26 -51
- package/built/rules/tooManyUpdates.js +25 -105
- package/built/rules/unbatchedMaterializedQuery.js +26 -30
- package/built/rules/updateInGetRequest.js +30 -45
- package/built/scope/commandScope.js +24 -144
- package/built/scope/httpClientRequestScope.js +11 -98
- package/built/scope/httpServerRequestScope.js +11 -98
- package/built/scope/rootScope.js +11 -98
- package/built/scope/scopeImpl.js +10 -82
- package/built/scope/scopeIterator.js +6 -10
- package/built/scope/sqlTransactionScope.js +24 -122
- package/built/sqlWarning.js +9 -35
- package/built/telemetry.js +215 -0
- package/built/wellKnownLabels.js +0 -1
- package/package.json +7 -3
- package/built/algorithms/dataStructures/graph/Graph.js.map +0 -1
- package/built/algorithms/dataStructures/graph/GraphEdge.js.map +0 -1
- package/built/algorithms/dataStructures/graph/GraphVertex.js.map +0 -1
- package/built/algorithms/dataStructures/linked-list/LinkedList.js.map +0 -1
- package/built/algorithms/dataStructures/linked-list/LinkedListNode.js.map +0 -1
- package/built/algorithms/graph/depth-first-search/index.js.map +0 -1
- package/built/algorithms/graph/detect-cycle/index.js.map +0 -1
- package/built/algorithms/utils/Comparator.js.map +0 -1
- package/built/analyzer/recordSecrets.js.map +0 -1
- package/built/analyzer/secretsRegexes.js.map +0 -1
- package/built/appMapIndex.js.map +0 -1
- package/built/check.js.map +0 -1
- package/built/checkInstance.js.map +0 -1
- package/built/cli/ci/command.js.map +0 -1
- package/built/cli/ci/options.js.map +0 -1
- package/built/cli/codeVersionArgs.js.map +0 -1
- package/built/cli/exitCode.js.map +0 -1
- package/built/cli/fail.js.map +0 -1
- package/built/cli/merge/command.js.map +0 -1
- package/built/cli/merge/options.js.map +0 -1
- package/built/cli/reportUploadURL.js.map +0 -1
- package/built/cli/resolveAppId.js.map +0 -1
- package/built/cli/scan/command.js.map +0 -1
- package/built/cli/scan/formatReport.js.map +0 -1
- package/built/cli/scan/options.js.map +0 -1
- package/built/cli/scan/scanner.js.map +0 -1
- package/built/cli/scan/singleScan.js.map +0 -1
- package/built/cli/scan/watchScan.js.map +0 -1
- package/built/cli/scan.js.map +0 -1
- package/built/cli/scanArgs.js.map +0 -1
- package/built/cli/scanOptions.js.map +0 -1
- package/built/cli/updateCommitStatus.js.map +0 -1
- package/built/cli/upload/command.js.map +0 -1
- package/built/cli/upload/options.js.map +0 -1
- package/built/cli/upload.js.map +0 -1
- package/built/cli/validateFile.js.map +0 -1
- package/built/cli.js.map +0 -1
- package/built/configuration/configurationProvider.js.map +0 -1
- package/built/configuration/types/checkConfig.js.map +0 -1
- package/built/configuration/types/configuration.js.map +0 -1
- package/built/configuration/types/matchEventConfig.js.map +0 -1
- package/built/configuration/types/matchPatternConfig.js.map +0 -1
- package/built/database/index.js.map +0 -1
- package/built/database/visit.js.map +0 -1
- package/built/errors.js.map +0 -1
- package/built/eventUtil.js.map +0 -1
- package/built/findings.js.map +0 -1
- package/built/integration/appland/app/exists.js.map +0 -1
- package/built/integration/appland/app/listFindingStatus.js.map +0 -1
- package/built/integration/appland/appMap/create.js.map +0 -1
- package/built/integration/appland/location.js.map +0 -1
- package/built/integration/appland/mapset/create.js.map +0 -1
- package/built/integration/appland/retry.js.map +0 -1
- package/built/integration/appland/retryOptions.js.map +0 -1
- package/built/integration/appland/scannerJob/create.js.map +0 -1
- package/built/integration/appland/scannerJob/merge.js.map +0 -1
- package/built/integration/appland/scannerJob.js.map +0 -1
- package/built/integration/github/commitStatus.js.map +0 -1
- package/built/integration/vars.js.map +0 -1
- package/built/openapi/index.js.map +0 -1
- package/built/openapi/method.js +0 -120
- package/built/openapi/method.js.map +0 -1
- package/built/openapi/model.js +0 -49
- package/built/openapi/model.js.map +0 -1
- package/built/openapi/path.js +0 -36
- package/built/openapi/path.js.map +0 -1
- package/built/openapi/provider.js +0 -133
- package/built/openapi/provider.js.map +0 -1
- package/built/openapi/response.js +0 -59
- package/built/openapi/response.js.map +0 -1
- package/built/openapi/rpcRequest.js +0 -130
- package/built/openapi/rpcRequest.js.map +0 -1
- package/built/openapi/schema.js +0 -42
- package/built/openapi/schema.js.map +0 -1
- package/built/openapi/securitySchemes.js +0 -32
- package/built/openapi/securitySchemes.js.map +0 -1
- package/built/openapi/statusCodes.js +0 -68
- package/built/openapi/statusCodes.js.map +0 -1
- package/built/openapi/util.js +0 -91
- package/built/openapi/util.js.map +0 -1
- package/built/report/appMapMetadata.js.map +0 -1
- package/built/report/findingSummary.js.map +0 -1
- package/built/report/findingsReport.js.map +0 -1
- package/built/report/scanResults.js.map +0 -1
- package/built/report/scanSummary.js.map +0 -1
- package/built/report/summaryReport.js.map +0 -1
- package/built/ruleChecker.js.map +0 -1
- package/built/rules/authzBeforeAuthn.js.map +0 -1
- package/built/rules/circularDependency.js.map +0 -1
- package/built/rules/deserializationOfUntrustedData.js.map +0 -1
- package/built/rules/execOfUntrustedCommand.js.map +0 -1
- package/built/rules/http-500/metadata.js.map +0 -1
- package/built/rules/http-500/rule.js.map +0 -1
- package/built/rules/illegalPackageDependency.js.map +0 -1
- package/built/rules/incompatibleHttpClientRequest.js.map +0 -1
- package/built/rules/insecureCompare.js.map +0 -1
- package/built/rules/jobNotCancelled.js.map +0 -1
- package/built/rules/lib/hasParameterOrReceiver.js.map +0 -1
- package/built/rules/lib/matchEvent.js.map +0 -1
- package/built/rules/lib/matchPattern.js.map +0 -1
- package/built/rules/lib/metadata.js.map +0 -1
- package/built/rules/lib/parseRuleDescription.js.map +0 -1
- package/built/rules/lib/precedingEvents.js.map +0 -1
- package/built/rules/lib/rpcWithoutProtection.js.map +0 -1
- package/built/rules/lib/sanitizesData.js.map +0 -1
- package/built/rules/lib/util.js.map +0 -1
- package/built/rules/logoutWithoutSessionReset.js.map +0 -1
- package/built/rules/missingAuthentication.js.map +0 -1
- package/built/rules/missingContentType.js.map +0 -1
- package/built/rules/nPlusOneQuery.js.map +0 -1
- package/built/rules/queryFromInvalidPackage.js.map +0 -1
- package/built/rules/queryFromView.js.map +0 -1
- package/built/rules/rpcWithoutCircuitBreaker.js.map +0 -1
- package/built/rules/saveWithoutValidation.js.map +0 -1
- package/built/rules/secretInLog.js.map +0 -1
- package/built/rules/slowFunctionCall.js.map +0 -1
- package/built/rules/slowHttpServerRequest.js.map +0 -1
- package/built/rules/slowQuery.js.map +0 -1
- package/built/rules/tooManyJoins.js.map +0 -1
- package/built/rules/tooManyUpdates.js.map +0 -1
- package/built/rules/unbatchedMaterializedQuery.js.map +0 -1
- package/built/rules/updateInGetRequest.js.map +0 -1
- package/built/scope/commandScope.js.map +0 -1
- package/built/scope/httpClientRequestScope.js.map +0 -1
- package/built/scope/httpServerRequestScope.js.map +0 -1
- package/built/scope/rootScope.js.map +0 -1
- package/built/scope/scopeImpl.js.map +0 -1
- package/built/scope/scopeIterator.js.map +0 -1
- package/built/scope/sqlTransactionScope.js.map +0 -1
- package/built/sqlWarning.js.map +0 -1
- package/built/wellKnownLabels.js.map +0 -1
|
@@ -2,192 +2,192 @@
|
|
|
2
2
|
"$id": "https://appland.com/schemas/scanner/options.json",
|
|
3
3
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
4
4
|
"definitions": {
|
|
5
|
-
"
|
|
6
|
-
"
|
|
5
|
+
"TimeAllowed": {
|
|
6
|
+
"type": "object",
|
|
7
7
|
"properties": {
|
|
8
|
-
"
|
|
8
|
+
"timeAllowed": {
|
|
9
9
|
"type": "number"
|
|
10
|
-
},
|
|
11
|
-
"ignoredPackages": {
|
|
12
|
-
"items": {
|
|
13
|
-
"$ref": "https://appland.com/schemas/scanner/match-pattern-config.json"
|
|
14
|
-
},
|
|
15
|
-
"type": "array"
|
|
16
10
|
}
|
|
17
11
|
},
|
|
18
|
-
"
|
|
12
|
+
"additionalProperties": false
|
|
13
|
+
},
|
|
14
|
+
"WarningLimit": {
|
|
15
|
+
"type": "object",
|
|
16
|
+
"properties": {
|
|
17
|
+
"warningLimit": {
|
|
18
|
+
"type": "number"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"additionalProperties": false
|
|
19
22
|
},
|
|
20
23
|
"IllegalPackageDependency.Options": {
|
|
21
|
-
"
|
|
24
|
+
"type": "object",
|
|
22
25
|
"properties": {
|
|
23
|
-
"calleePackage": {
|
|
24
|
-
"$ref": "https://appland.com/schemas/scanner/match-pattern-config.json"
|
|
25
|
-
},
|
|
26
26
|
"callerPackages": {
|
|
27
|
+
"type": "array",
|
|
27
28
|
"items": {
|
|
28
29
|
"$ref": "https://appland.com/schemas/scanner/match-pattern-config.json"
|
|
29
|
-
}
|
|
30
|
-
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"calleePackage": {
|
|
33
|
+
"$ref": "https://appland.com/schemas/scanner/match-pattern-config.json"
|
|
31
34
|
}
|
|
32
35
|
},
|
|
33
36
|
"required": [
|
|
34
37
|
"callerPackages",
|
|
35
38
|
"calleePackage"
|
|
36
39
|
],
|
|
37
|
-
"
|
|
40
|
+
"additionalProperties": false
|
|
41
|
+
},
|
|
42
|
+
"CircularDependency.Options": {
|
|
43
|
+
"type": "object",
|
|
44
|
+
"properties": {
|
|
45
|
+
"ignoredPackages": {
|
|
46
|
+
"type": "array",
|
|
47
|
+
"items": {
|
|
48
|
+
"$ref": "https://appland.com/schemas/scanner/match-pattern-config.json"
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"depth": {
|
|
52
|
+
"type": "number"
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
"additionalProperties": false
|
|
38
56
|
},
|
|
39
57
|
"IncompatibleHttpClientRequest.Options": {
|
|
40
|
-
"
|
|
58
|
+
"type": "object",
|
|
41
59
|
"properties": {
|
|
42
60
|
"schemata": {
|
|
61
|
+
"type": "object",
|
|
43
62
|
"additionalProperties": {
|
|
44
63
|
"type": "string"
|
|
45
|
-
}
|
|
46
|
-
"type": "object"
|
|
64
|
+
}
|
|
47
65
|
}
|
|
48
66
|
},
|
|
49
67
|
"required": [
|
|
50
68
|
"schemata"
|
|
51
69
|
],
|
|
52
|
-
"
|
|
70
|
+
"additionalProperties": false
|
|
53
71
|
},
|
|
54
72
|
"MissingAuthentication.Options": {
|
|
55
|
-
"
|
|
73
|
+
"type": "object",
|
|
56
74
|
"properties": {
|
|
57
|
-
"
|
|
75
|
+
"includeContentTypes": {
|
|
76
|
+
"type": "array",
|
|
58
77
|
"items": {
|
|
59
78
|
"$ref": "https://appland.com/schemas/scanner/match-pattern-config.json"
|
|
60
|
-
}
|
|
61
|
-
"type": "array"
|
|
79
|
+
}
|
|
62
80
|
},
|
|
63
|
-
"
|
|
81
|
+
"excludeContentTypes": {
|
|
82
|
+
"type": "array",
|
|
64
83
|
"items": {
|
|
65
84
|
"$ref": "https://appland.com/schemas/scanner/match-pattern-config.json"
|
|
66
|
-
}
|
|
67
|
-
"type": "array"
|
|
85
|
+
}
|
|
68
86
|
}
|
|
69
87
|
},
|
|
70
|
-
"
|
|
88
|
+
"additionalProperties": false
|
|
71
89
|
},
|
|
72
90
|
"NPlusOneQuery.Options": {
|
|
73
|
-
"
|
|
91
|
+
"type": "object",
|
|
74
92
|
"properties": {
|
|
75
|
-
"
|
|
93
|
+
"warningLimit": {
|
|
76
94
|
"type": "number"
|
|
77
95
|
},
|
|
78
|
-
"
|
|
96
|
+
"errorLimit": {
|
|
79
97
|
"type": "number"
|
|
80
98
|
}
|
|
81
99
|
},
|
|
82
|
-
"
|
|
100
|
+
"additionalProperties": false
|
|
83
101
|
},
|
|
84
102
|
"QueryFromInvalidPackage.Options": {
|
|
85
|
-
"
|
|
103
|
+
"type": "object",
|
|
86
104
|
"properties": {
|
|
87
105
|
"allowedPackages": {
|
|
106
|
+
"type": "array",
|
|
88
107
|
"items": {
|
|
89
108
|
"$ref": "https://appland.com/schemas/scanner/match-pattern-config.json"
|
|
90
|
-
}
|
|
91
|
-
"type": "array"
|
|
109
|
+
}
|
|
92
110
|
},
|
|
93
111
|
"allowedQueries": {
|
|
112
|
+
"type": "array",
|
|
94
113
|
"items": {
|
|
95
114
|
"$ref": "https://appland.com/schemas/scanner/match-pattern-config.json"
|
|
96
|
-
}
|
|
97
|
-
"type": "array"
|
|
115
|
+
}
|
|
98
116
|
}
|
|
99
117
|
},
|
|
100
118
|
"required": [
|
|
101
119
|
"allowedPackages"
|
|
102
120
|
],
|
|
103
|
-
"
|
|
121
|
+
"additionalProperties": false
|
|
104
122
|
},
|
|
105
123
|
"QueryFromView.Options": {
|
|
106
|
-
"
|
|
124
|
+
"type": "object",
|
|
107
125
|
"properties": {
|
|
108
126
|
"forbiddenLabel": {
|
|
109
127
|
"type": "string"
|
|
110
128
|
}
|
|
111
129
|
},
|
|
112
|
-
"
|
|
130
|
+
"additionalProperties": false
|
|
113
131
|
},
|
|
114
132
|
"RPCWithoutCircuitBreaker.Options": {
|
|
115
|
-
"
|
|
133
|
+
"type": "object",
|
|
116
134
|
"properties": {
|
|
117
135
|
"expectedLabel": {
|
|
118
136
|
"type": "string"
|
|
119
137
|
}
|
|
120
138
|
},
|
|
121
|
-
"
|
|
139
|
+
"additionalProperties": false
|
|
122
140
|
},
|
|
123
141
|
"SlowFunctionCall.Options": {
|
|
124
|
-
"
|
|
142
|
+
"type": "object",
|
|
125
143
|
"properties": {
|
|
144
|
+
"timeAllowed": {
|
|
145
|
+
"type": "number"
|
|
146
|
+
},
|
|
126
147
|
"functions": {
|
|
148
|
+
"type": "array",
|
|
127
149
|
"items": {
|
|
128
150
|
"$ref": "https://appland.com/schemas/scanner/match-pattern-config.json"
|
|
129
|
-
}
|
|
130
|
-
"type": "array"
|
|
131
|
-
},
|
|
132
|
-
"timeAllowed": {
|
|
133
|
-
"type": "number"
|
|
151
|
+
}
|
|
134
152
|
}
|
|
135
153
|
},
|
|
136
|
-
"
|
|
154
|
+
"additionalProperties": false
|
|
137
155
|
},
|
|
138
156
|
"SlowHTTPServerRequest.Options": {
|
|
157
|
+
"type": "object",
|
|
139
158
|
"additionalProperties": false,
|
|
140
159
|
"properties": {
|
|
141
160
|
"timeAllowed": {
|
|
142
161
|
"type": "number"
|
|
143
162
|
}
|
|
144
|
-
}
|
|
145
|
-
"type": "object"
|
|
163
|
+
}
|
|
146
164
|
},
|
|
147
165
|
"SlowQuery.Options": {
|
|
166
|
+
"type": "object",
|
|
148
167
|
"additionalProperties": false,
|
|
149
168
|
"properties": {
|
|
150
169
|
"timeAllowed": {
|
|
151
170
|
"type": "number"
|
|
152
171
|
}
|
|
153
|
-
}
|
|
154
|
-
"type": "object"
|
|
155
|
-
},
|
|
156
|
-
"TimeAllowed": {
|
|
157
|
-
"additionalProperties": false,
|
|
158
|
-
"properties": {
|
|
159
|
-
"timeAllowed": {
|
|
160
|
-
"type": "number"
|
|
161
|
-
}
|
|
162
|
-
},
|
|
163
|
-
"type": "object"
|
|
172
|
+
}
|
|
164
173
|
},
|
|
165
174
|
"TooManyJoins.Options": {
|
|
175
|
+
"type": "object",
|
|
166
176
|
"additionalProperties": false,
|
|
167
177
|
"properties": {
|
|
168
178
|
"warningLimit": {
|
|
169
179
|
"type": "number"
|
|
170
180
|
}
|
|
171
|
-
}
|
|
172
|
-
"type": "object"
|
|
181
|
+
}
|
|
173
182
|
},
|
|
174
183
|
"TooManyUpdates.Options": {
|
|
184
|
+
"type": "object",
|
|
175
185
|
"additionalProperties": false,
|
|
176
186
|
"properties": {
|
|
177
187
|
"warningLimit": {
|
|
178
188
|
"type": "number"
|
|
179
189
|
}
|
|
180
|
-
}
|
|
181
|
-
"type": "object"
|
|
182
|
-
},
|
|
183
|
-
"WarningLimit": {
|
|
184
|
-
"additionalProperties": false,
|
|
185
|
-
"properties": {
|
|
186
|
-
"warningLimit": {
|
|
187
|
-
"type": "number"
|
|
188
|
-
}
|
|
189
|
-
},
|
|
190
|
-
"type": "object"
|
|
190
|
+
}
|
|
191
191
|
}
|
|
192
192
|
}
|
|
193
193
|
}
|
package/built/database/index.js
CHANGED
|
@@ -1,72 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
3
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
4
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
5
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
6
|
-
function step(op) {
|
|
7
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
8
|
-
while (_) try {
|
|
9
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
10
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
11
|
-
switch (op[0]) {
|
|
12
|
-
case 0: case 1: t = op; break;
|
|
13
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
14
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
15
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
16
|
-
default:
|
|
17
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
18
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
19
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
20
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
21
|
-
if (t[2]) _.ops.pop();
|
|
22
|
-
_.trys.pop(); continue;
|
|
23
|
-
}
|
|
24
|
-
op = body.call(thisArg, _);
|
|
25
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
26
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
30
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
31
|
-
if (!m) return o;
|
|
32
|
-
var i = m.call(o), r, ar = [], e;
|
|
33
|
-
try {
|
|
34
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
35
|
-
}
|
|
36
|
-
catch (error) { e = { error: error }; }
|
|
37
|
-
finally {
|
|
38
|
-
try {
|
|
39
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
40
|
-
}
|
|
41
|
-
finally { if (e) throw e.error; }
|
|
42
|
-
}
|
|
43
|
-
return ar;
|
|
44
|
-
};
|
|
45
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
46
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
47
|
-
if (ar || !(i in from)) {
|
|
48
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
49
|
-
ar[i] = from[i];
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
53
|
-
};
|
|
54
|
-
var __values = (this && this.__values) || function(o) {
|
|
55
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
56
|
-
if (m) return m.call(o);
|
|
57
|
-
if (o && typeof o.length === "number") return {
|
|
58
|
-
next: function () {
|
|
59
|
-
if (o && i >= o.length) o = void 0;
|
|
60
|
-
return { value: o && o[i++], done: !o };
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
64
|
-
};
|
|
65
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
66
3
|
exports.countJoins = exports.sqlStrings = exports.isSelect = exports.getSqlLabelFromString = exports.getHttpLabel = exports.capitalizeString = void 0;
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
4
|
+
const models_1 = require("@appland/models");
|
|
5
|
+
const visit_1 = require("./visit");
|
|
6
|
+
const url_1 = require("url");
|
|
70
7
|
function capitalizeString(str) {
|
|
71
8
|
if (typeof str !== 'string') {
|
|
72
9
|
return '';
|
|
@@ -78,13 +15,13 @@ function getHttpLabel(event) {
|
|
|
78
15
|
if (!event.httpServerRequest) {
|
|
79
16
|
return;
|
|
80
17
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
18
|
+
const requestMethod = event.httpServerRequest.request_method;
|
|
19
|
+
const pathInfo = event.httpServerRequest.path_info;
|
|
20
|
+
let label;
|
|
84
21
|
try {
|
|
85
22
|
// the url is fake, we only care about the path info anyway
|
|
86
|
-
|
|
87
|
-
label =
|
|
23
|
+
const url = new url_1.URL(pathInfo, 'http://hostname');
|
|
24
|
+
label = `${requestMethod} ${url.pathname}`;
|
|
88
25
|
}
|
|
89
26
|
catch (ex) {
|
|
90
27
|
label = 'HTTP Request';
|
|
@@ -92,7 +29,7 @@ function getHttpLabel(event) {
|
|
|
92
29
|
return label;
|
|
93
30
|
}
|
|
94
31
|
exports.getHttpLabel = getHttpLabel;
|
|
95
|
-
|
|
32
|
+
const sqlLabels = new Set([
|
|
96
33
|
'insert',
|
|
97
34
|
'update',
|
|
98
35
|
'select',
|
|
@@ -124,7 +61,7 @@ var sqlLabels = new Set([
|
|
|
124
61
|
'xa',
|
|
125
62
|
]);
|
|
126
63
|
function getSqlLabelFromString(sqlString) {
|
|
127
|
-
|
|
64
|
+
const sqlChars = [...sqlString.trimLeft()];
|
|
128
65
|
if (sqlChars.length > 0 && sqlChars[0] === '(') {
|
|
129
66
|
// if the query is wrapped in parenthesis, drop the opening parenthesis
|
|
130
67
|
// it doesn't matter if we leave a hanging closing parenthesis.
|
|
@@ -132,9 +69,9 @@ function getSqlLabelFromString(sqlString) {
|
|
|
132
69
|
sqlChars.shift();
|
|
133
70
|
}
|
|
134
71
|
// drop sub-queries and parenthesized expressions
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
.reduce(
|
|
72
|
+
let depth = 0;
|
|
73
|
+
const topLevelSql = sqlChars
|
|
74
|
+
.reduce((arr, c) => {
|
|
138
75
|
if (c === '(') {
|
|
139
76
|
depth += 1;
|
|
140
77
|
}
|
|
@@ -147,7 +84,7 @@ function getSqlLabelFromString(sqlString) {
|
|
|
147
84
|
return arr;
|
|
148
85
|
}, [])
|
|
149
86
|
.join('');
|
|
150
|
-
|
|
87
|
+
let queryType;
|
|
151
88
|
if (topLevelSql.search(/\s/) === -1) {
|
|
152
89
|
// There's only a single token
|
|
153
90
|
// e.g. BEGIN, COMMIT, CHECKPOINT
|
|
@@ -161,7 +98,7 @@ function getSqlLabelFromString(sqlString) {
|
|
|
161
98
|
.replace(/[^\w]+/g, ' ')
|
|
162
99
|
.toLowerCase()
|
|
163
100
|
.split(' ')
|
|
164
|
-
.find(
|
|
101
|
+
.find((t) => sqlLabels.has(t)) || 'unknown';
|
|
165
102
|
}
|
|
166
103
|
return ['SQL', capitalizeString(queryType) || null].join(' ');
|
|
167
104
|
}
|
|
@@ -170,65 +107,34 @@ function isSelect(sql) {
|
|
|
170
107
|
return getSqlLabelFromString(sql) === 'SQL Select';
|
|
171
108
|
}
|
|
172
109
|
exports.isSelect = isSelect;
|
|
173
|
-
function sqlStrings(event, appMapIndex, filter) {
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
return __generator(this, function (_d) {
|
|
178
|
-
switch (_d.label) {
|
|
179
|
-
case 0:
|
|
180
|
-
_d.trys.push([0, 5, 6, 7]);
|
|
181
|
-
_a = __values(new models_1.EventNavigator(event).descendants()), _b = _a.next();
|
|
182
|
-
_d.label = 1;
|
|
183
|
-
case 1:
|
|
184
|
-
if (!!_b.done) return [3 /*break*/, 4];
|
|
185
|
-
e = _b.value;
|
|
186
|
-
if (!e.event.sql) {
|
|
187
|
-
return [3 /*break*/, 3];
|
|
188
|
-
}
|
|
189
|
-
if (!filter(e.event, appMapIndex)) {
|
|
190
|
-
return [3 /*break*/, 3];
|
|
191
|
-
}
|
|
192
|
-
if (!isSelect(e.event.sqlQuery)) {
|
|
193
|
-
return [3 /*break*/, 3];
|
|
194
|
-
}
|
|
195
|
-
if (!filter(event, appMapIndex)) {
|
|
196
|
-
return [3 /*break*/, 3];
|
|
197
|
-
}
|
|
198
|
-
sql = appMapIndex.sqlNormalized(e.event);
|
|
199
|
-
return [4 /*yield*/, { event: e.event, sql: sql }];
|
|
200
|
-
case 2:
|
|
201
|
-
_d.sent();
|
|
202
|
-
_d.label = 3;
|
|
203
|
-
case 3:
|
|
204
|
-
_b = _a.next();
|
|
205
|
-
return [3 /*break*/, 1];
|
|
206
|
-
case 4: return [3 /*break*/, 7];
|
|
207
|
-
case 5:
|
|
208
|
-
e_1_1 = _d.sent();
|
|
209
|
-
e_1 = { error: e_1_1 };
|
|
210
|
-
return [3 /*break*/, 7];
|
|
211
|
-
case 6:
|
|
212
|
-
try {
|
|
213
|
-
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
|
|
214
|
-
}
|
|
215
|
-
finally { if (e_1) throw e_1.error; }
|
|
216
|
-
return [7 /*endfinally*/];
|
|
217
|
-
case 7: return [2 /*return*/];
|
|
110
|
+
function* sqlStrings(event, appMapIndex, filter = () => true) {
|
|
111
|
+
for (const e of new models_1.EventNavigator(event).descendants()) {
|
|
112
|
+
if (!e.event.sql) {
|
|
113
|
+
continue;
|
|
218
114
|
}
|
|
219
|
-
|
|
115
|
+
if (!filter(e.event, appMapIndex)) {
|
|
116
|
+
continue;
|
|
117
|
+
}
|
|
118
|
+
if (!isSelect(e.event.sqlQuery)) {
|
|
119
|
+
continue;
|
|
120
|
+
}
|
|
121
|
+
if (!filter(event, appMapIndex)) {
|
|
122
|
+
continue;
|
|
123
|
+
}
|
|
124
|
+
const sql = appMapIndex.sqlNormalized(e.event);
|
|
125
|
+
yield { event: e.event, sql };
|
|
126
|
+
}
|
|
220
127
|
}
|
|
221
128
|
exports.sqlStrings = sqlStrings;
|
|
222
129
|
function countJoins(ast) {
|
|
223
130
|
if (!ast)
|
|
224
131
|
return 0;
|
|
225
|
-
|
|
132
|
+
let joins = 0;
|
|
226
133
|
(0, visit_1.visit)(ast, {
|
|
227
|
-
'map.join':
|
|
134
|
+
'map.join': (node) => {
|
|
228
135
|
joins += node.map.length;
|
|
229
136
|
},
|
|
230
137
|
});
|
|
231
138
|
return joins;
|
|
232
139
|
}
|
|
233
140
|
exports.countJoins = countJoins;
|
|
234
|
-
//# sourceMappingURL=index.js.map
|
package/built/database/visit.js
CHANGED
|
@@ -1,82 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __values = (this && this.__values) || function(o) {
|
|
3
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
4
|
-
if (m) return m.call(o);
|
|
5
|
-
if (o && typeof o.length === "number") return {
|
|
6
|
-
next: function () {
|
|
7
|
-
if (o && i >= o.length) o = void 0;
|
|
8
|
-
return { value: o && o[i++], done: !o };
|
|
9
|
-
}
|
|
10
|
-
};
|
|
11
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
12
|
-
};
|
|
13
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
14
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
15
|
-
if (!m) return o;
|
|
16
|
-
var i = m.call(o), r, ar = [], e;
|
|
17
|
-
try {
|
|
18
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
19
|
-
}
|
|
20
|
-
catch (error) { e = { error: error }; }
|
|
21
|
-
finally {
|
|
22
|
-
try {
|
|
23
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
24
|
-
}
|
|
25
|
-
finally { if (e) throw e.error; }
|
|
26
|
-
}
|
|
27
|
-
return ar;
|
|
28
|
-
};
|
|
29
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
3
|
exports.visit = void 0;
|
|
31
4
|
function visit(node, callbacks) {
|
|
32
5
|
if (node === null)
|
|
33
6
|
return;
|
|
34
|
-
|
|
35
|
-
|
|
7
|
+
const { type, variant } = node;
|
|
8
|
+
const key = [type, variant].filter(Boolean).join('.');
|
|
36
9
|
if (callbacks !== undefined && key in callbacks)
|
|
37
10
|
callbacks[key](node, callbacks);
|
|
38
11
|
visitNode(node, callbacks);
|
|
39
12
|
}
|
|
40
13
|
exports.visit = visit;
|
|
41
14
|
function visitNode(node, callbacks) {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
if (Array.isArray(property)) {
|
|
49
|
-
try {
|
|
50
|
-
for (var property_1 = (e_2 = void 0, __values(property)), property_1_1 = property_1.next(); !property_1_1.done; property_1_1 = property_1.next()) {
|
|
51
|
-
var subNode = property_1_1.value;
|
|
52
|
-
visit(subNode, callbacks);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
56
|
-
finally {
|
|
57
|
-
try {
|
|
58
|
-
if (property_1_1 && !property_1_1.done && (_b = property_1.return)) _b.call(property_1);
|
|
59
|
-
}
|
|
60
|
-
finally { if (e_2) throw e_2.error; }
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
else if (typeof property === 'object') {
|
|
64
|
-
visit(property, callbacks);
|
|
65
|
-
}
|
|
66
|
-
else if (typeof property === 'string' || typeof property === 'boolean') {
|
|
67
|
-
// pass
|
|
68
|
-
}
|
|
69
|
-
else {
|
|
70
|
-
console.warn("Unrecognized subexpression: ".concat(typeof property, " ").concat(property));
|
|
71
|
-
}
|
|
15
|
+
for (const [key, property] of Object.entries(node)) {
|
|
16
|
+
if (['type', 'variant', 'name', 'value'].includes(key))
|
|
17
|
+
continue;
|
|
18
|
+
if (Array.isArray(property)) {
|
|
19
|
+
for (const subNode of property)
|
|
20
|
+
visit(subNode, callbacks);
|
|
72
21
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
22
|
+
else if (typeof property === 'object') {
|
|
23
|
+
visit(property, callbacks);
|
|
24
|
+
}
|
|
25
|
+
else if (typeof property === 'string' || typeof property === 'boolean') {
|
|
26
|
+
// pass
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
console.warn(`Unrecognized subexpression: ${typeof property} ${property}`);
|
|
78
30
|
}
|
|
79
|
-
finally { if (e_1) throw e_1.error; }
|
|
80
31
|
}
|
|
81
32
|
}
|
|
82
|
-
//# sourceMappingURL=visit.js.map
|
package/built/errors.js
CHANGED
|
@@ -1,35 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
3
|
exports.AbortError = exports.ValidationError = void 0;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
function ValidationError() {
|
|
22
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
23
|
-
}
|
|
24
|
-
return ValidationError;
|
|
25
|
-
}(Error));
|
|
4
|
+
class ValidationError extends Error {
|
|
5
|
+
}
|
|
26
6
|
exports.ValidationError = ValidationError;
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
function AbortError() {
|
|
30
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
31
|
-
}
|
|
32
|
-
return AbortError;
|
|
33
|
-
}(Error));
|
|
7
|
+
class AbortError extends Error {
|
|
8
|
+
}
|
|
34
9
|
exports.AbortError = AbortError;
|
|
35
|
-
//# sourceMappingURL=errors.js.map
|