@appland/scanner 1.54.1 → 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 +31 -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 -147
- 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 +58 -233
- package/built/cli/scan/formatReport.js +44 -0
- package/built/cli/scan/options.js +0 -1
- package/built/cli/scan/scanner.js +38 -117
- package/built/cli/scan/singleScan.js +80 -0
- package/built/cli/scan/watchScan.js +84 -0
- package/built/cli/scan.js +39 -132
- package/built/cli/scanArgs.js +2 -4
- package/built/cli/scanOptions.js +0 -1
- package/built/cli/updateCommitStatus.js +10 -47
- package/built/cli/upload/command.js +21 -65
- 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 -48
- package/built/cli.js +34 -21
- package/built/configuration/configurationProvider.js +148 -227
- 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 +5 -38
- 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 +48 -25
- 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 +30 -93
- 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 +10 -4
- 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/options.js.map +0 -1
- package/built/cli/scan/scanner.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
|
@@ -1,105 +1,18 @@
|
|
|
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
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
18
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
19
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
20
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
21
|
-
function step(op) {
|
|
22
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
23
|
-
while (_) try {
|
|
24
|
-
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;
|
|
25
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
26
|
-
switch (op[0]) {
|
|
27
|
-
case 0: case 1: t = op; break;
|
|
28
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
29
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
30
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
31
|
-
default:
|
|
32
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
33
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
34
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
35
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
36
|
-
if (t[2]) _.ops.pop();
|
|
37
|
-
_.trys.pop(); continue;
|
|
38
|
-
}
|
|
39
|
-
op = body.call(thisArg, _);
|
|
40
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
41
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
var __values = (this && this.__values) || function(o) {
|
|
45
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
46
|
-
if (m) return m.call(o);
|
|
47
|
-
if (o && typeof o.length === "number") return {
|
|
48
|
-
next: function () {
|
|
49
|
-
if (o && i >= o.length) o = void 0;
|
|
50
|
-
return { value: o && o[i++], done: !o };
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
54
|
-
};
|
|
55
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
56
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
57
4
|
};
|
|
58
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
var events_1, events_1_1, event, e_1_1;
|
|
68
|
-
var e_1, _a;
|
|
69
|
-
return __generator(this, function (_b) {
|
|
70
|
-
switch (_b.label) {
|
|
71
|
-
case 0:
|
|
72
|
-
_b.trys.push([0, 5, 6, 7]);
|
|
73
|
-
events_1 = __values(events), events_1_1 = events_1.next();
|
|
74
|
-
_b.label = 1;
|
|
75
|
-
case 1:
|
|
76
|
-
if (!!events_1_1.done) return [3 /*break*/, 4];
|
|
77
|
-
event = events_1_1.value;
|
|
78
|
-
if (!(event.isCall() && event.httpClientRequest)) return [3 /*break*/, 3];
|
|
79
|
-
return [4 /*yield*/, new scopeImpl_1.default(event)];
|
|
80
|
-
case 2:
|
|
81
|
-
_b.sent();
|
|
82
|
-
this.advanceToReturnEvent(event, events);
|
|
83
|
-
_b.label = 3;
|
|
84
|
-
case 3:
|
|
85
|
-
events_1_1 = events_1.next();
|
|
86
|
-
return [3 /*break*/, 1];
|
|
87
|
-
case 4: return [3 /*break*/, 7];
|
|
88
|
-
case 5:
|
|
89
|
-
e_1_1 = _b.sent();
|
|
90
|
-
e_1 = { error: e_1_1 };
|
|
91
|
-
return [3 /*break*/, 7];
|
|
92
|
-
case 6:
|
|
93
|
-
try {
|
|
94
|
-
if (events_1_1 && !events_1_1.done && (_a = events_1.return)) _a.call(events_1);
|
|
95
|
-
}
|
|
96
|
-
finally { if (e_1) throw e_1.error; }
|
|
97
|
-
return [7 /*endfinally*/];
|
|
98
|
-
case 7: return [2 /*return*/];
|
|
6
|
+
const scopeImpl_1 = __importDefault(require("./scopeImpl"));
|
|
7
|
+
const scopeIterator_1 = __importDefault(require("./scopeIterator"));
|
|
8
|
+
class HTTPClientRequestScope extends scopeIterator_1.default {
|
|
9
|
+
*scopes(events) {
|
|
10
|
+
for (const event of events) {
|
|
11
|
+
if (event.isCall() && event.httpClientRequest) {
|
|
12
|
+
yield new scopeImpl_1.default(event);
|
|
13
|
+
this.advanceToReturnEvent(event, events);
|
|
99
14
|
}
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
}(scopeIterator_1.default));
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
104
18
|
exports.default = HTTPClientRequestScope;
|
|
105
|
-
//# sourceMappingURL=httpClientRequestScope.js.map
|
|
@@ -1,105 +1,18 @@
|
|
|
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
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
18
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
19
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
20
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
21
|
-
function step(op) {
|
|
22
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
23
|
-
while (_) try {
|
|
24
|
-
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;
|
|
25
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
26
|
-
switch (op[0]) {
|
|
27
|
-
case 0: case 1: t = op; break;
|
|
28
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
29
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
30
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
31
|
-
default:
|
|
32
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
33
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
34
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
35
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
36
|
-
if (t[2]) _.ops.pop();
|
|
37
|
-
_.trys.pop(); continue;
|
|
38
|
-
}
|
|
39
|
-
op = body.call(thisArg, _);
|
|
40
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
41
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
var __values = (this && this.__values) || function(o) {
|
|
45
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
46
|
-
if (m) return m.call(o);
|
|
47
|
-
if (o && typeof o.length === "number") return {
|
|
48
|
-
next: function () {
|
|
49
|
-
if (o && i >= o.length) o = void 0;
|
|
50
|
-
return { value: o && o[i++], done: !o };
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
54
|
-
};
|
|
55
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
56
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
57
4
|
};
|
|
58
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
var events_1, events_1_1, event, e_1_1;
|
|
68
|
-
var e_1, _a;
|
|
69
|
-
return __generator(this, function (_b) {
|
|
70
|
-
switch (_b.label) {
|
|
71
|
-
case 0:
|
|
72
|
-
_b.trys.push([0, 5, 6, 7]);
|
|
73
|
-
events_1 = __values(events), events_1_1 = events_1.next();
|
|
74
|
-
_b.label = 1;
|
|
75
|
-
case 1:
|
|
76
|
-
if (!!events_1_1.done) return [3 /*break*/, 4];
|
|
77
|
-
event = events_1_1.value;
|
|
78
|
-
if (!(event.isCall() && event.httpServerRequest)) return [3 /*break*/, 3];
|
|
79
|
-
return [4 /*yield*/, new scopeImpl_1.default(event)];
|
|
80
|
-
case 2:
|
|
81
|
-
_b.sent();
|
|
82
|
-
this.advanceToReturnEvent(event, events);
|
|
83
|
-
_b.label = 3;
|
|
84
|
-
case 3:
|
|
85
|
-
events_1_1 = events_1.next();
|
|
86
|
-
return [3 /*break*/, 1];
|
|
87
|
-
case 4: return [3 /*break*/, 7];
|
|
88
|
-
case 5:
|
|
89
|
-
e_1_1 = _b.sent();
|
|
90
|
-
e_1 = { error: e_1_1 };
|
|
91
|
-
return [3 /*break*/, 7];
|
|
92
|
-
case 6:
|
|
93
|
-
try {
|
|
94
|
-
if (events_1_1 && !events_1_1.done && (_a = events_1.return)) _a.call(events_1);
|
|
95
|
-
}
|
|
96
|
-
finally { if (e_1) throw e_1.error; }
|
|
97
|
-
return [7 /*endfinally*/];
|
|
98
|
-
case 7: return [2 /*return*/];
|
|
6
|
+
const scopeImpl_1 = __importDefault(require("./scopeImpl"));
|
|
7
|
+
const scopeIterator_1 = __importDefault(require("./scopeIterator"));
|
|
8
|
+
class HTTPServerRequestScope extends scopeIterator_1.default {
|
|
9
|
+
*scopes(events) {
|
|
10
|
+
for (const event of events) {
|
|
11
|
+
if (event.isCall() && event.httpServerRequest) {
|
|
12
|
+
yield new scopeImpl_1.default(event);
|
|
13
|
+
this.advanceToReturnEvent(event, events);
|
|
99
14
|
}
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
}(scopeIterator_1.default));
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
104
18
|
exports.default = HTTPServerRequestScope;
|
|
105
|
-
//# sourceMappingURL=httpServerRequestScope.js.map
|
package/built/scope/rootScope.js
CHANGED
|
@@ -1,105 +1,18 @@
|
|
|
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
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
18
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
19
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
20
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
21
|
-
function step(op) {
|
|
22
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
23
|
-
while (_) try {
|
|
24
|
-
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;
|
|
25
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
26
|
-
switch (op[0]) {
|
|
27
|
-
case 0: case 1: t = op; break;
|
|
28
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
29
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
30
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
31
|
-
default:
|
|
32
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
33
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
34
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
35
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
36
|
-
if (t[2]) _.ops.pop();
|
|
37
|
-
_.trys.pop(); continue;
|
|
38
|
-
}
|
|
39
|
-
op = body.call(thisArg, _);
|
|
40
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
41
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
var __values = (this && this.__values) || function(o) {
|
|
45
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
46
|
-
if (m) return m.call(o);
|
|
47
|
-
if (o && typeof o.length === "number") return {
|
|
48
|
-
next: function () {
|
|
49
|
-
if (o && i >= o.length) o = void 0;
|
|
50
|
-
return { value: o && o[i++], done: !o };
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
54
|
-
};
|
|
55
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
56
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
57
4
|
};
|
|
58
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
var events_1, events_1_1, event, e_1_1;
|
|
68
|
-
var e_1, _a;
|
|
69
|
-
return __generator(this, function (_b) {
|
|
70
|
-
switch (_b.label) {
|
|
71
|
-
case 0:
|
|
72
|
-
_b.trys.push([0, 5, 6, 7]);
|
|
73
|
-
events_1 = __values(events), events_1_1 = events_1.next();
|
|
74
|
-
_b.label = 1;
|
|
75
|
-
case 1:
|
|
76
|
-
if (!!events_1_1.done) return [3 /*break*/, 4];
|
|
77
|
-
event = events_1_1.value;
|
|
78
|
-
if (!(event.isCall() && !event.parent)) return [3 /*break*/, 3];
|
|
79
|
-
return [4 /*yield*/, new scopeImpl_1.default(event)];
|
|
80
|
-
case 2:
|
|
81
|
-
_b.sent();
|
|
82
|
-
this.advanceToReturnEvent(event, events);
|
|
83
|
-
_b.label = 3;
|
|
84
|
-
case 3:
|
|
85
|
-
events_1_1 = events_1.next();
|
|
86
|
-
return [3 /*break*/, 1];
|
|
87
|
-
case 4: return [3 /*break*/, 7];
|
|
88
|
-
case 5:
|
|
89
|
-
e_1_1 = _b.sent();
|
|
90
|
-
e_1 = { error: e_1_1 };
|
|
91
|
-
return [3 /*break*/, 7];
|
|
92
|
-
case 6:
|
|
93
|
-
try {
|
|
94
|
-
if (events_1_1 && !events_1_1.done && (_a = events_1.return)) _a.call(events_1);
|
|
95
|
-
}
|
|
96
|
-
finally { if (e_1) throw e_1.error; }
|
|
97
|
-
return [7 /*endfinally*/];
|
|
98
|
-
case 7: return [2 /*return*/];
|
|
6
|
+
const scopeImpl_1 = __importDefault(require("./scopeImpl"));
|
|
7
|
+
const scopeIterator_1 = __importDefault(require("./scopeIterator"));
|
|
8
|
+
class RootScope extends scopeIterator_1.default {
|
|
9
|
+
*scopes(events) {
|
|
10
|
+
for (const event of events) {
|
|
11
|
+
if (event.isCall() && !event.parent) {
|
|
12
|
+
yield new scopeImpl_1.default(event);
|
|
13
|
+
this.advanceToReturnEvent(event, events);
|
|
99
14
|
}
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
}(scopeIterator_1.default));
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
104
18
|
exports.default = RootScope;
|
|
105
|
-
//# sourceMappingURL=rootScope.js.map
|
package/built/scope/scopeImpl.js
CHANGED
|
@@ -1,88 +1,16 @@
|
|
|
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 __values = (this && this.__values) || function(o) {
|
|
30
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
31
|
-
if (m) return m.call(o);
|
|
32
|
-
if (o && typeof o.length === "number") return {
|
|
33
|
-
next: function () {
|
|
34
|
-
if (o && i >= o.length) o = void 0;
|
|
35
|
-
return { value: o && o[i++], done: !o };
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
39
|
-
};
|
|
40
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
3
|
+
const models_1 = require("@appland/models");
|
|
4
|
+
class ScopeImpl {
|
|
5
|
+
constructor(event) {
|
|
44
6
|
this.scope = event;
|
|
45
7
|
this.descendants = new models_1.EventNavigator(event);
|
|
46
8
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
_d.sent();
|
|
55
|
-
_d.label = 2;
|
|
56
|
-
case 2:
|
|
57
|
-
_d.trys.push([2, 7, 8, 9]);
|
|
58
|
-
_a = __values(this.descendants.descendants()), _b = _a.next();
|
|
59
|
-
_d.label = 3;
|
|
60
|
-
case 3:
|
|
61
|
-
if (!!_b.done) return [3 /*break*/, 6];
|
|
62
|
-
event = _b.value;
|
|
63
|
-
return [4 /*yield*/, event.event];
|
|
64
|
-
case 4:
|
|
65
|
-
_d.sent();
|
|
66
|
-
_d.label = 5;
|
|
67
|
-
case 5:
|
|
68
|
-
_b = _a.next();
|
|
69
|
-
return [3 /*break*/, 3];
|
|
70
|
-
case 6: return [3 /*break*/, 9];
|
|
71
|
-
case 7:
|
|
72
|
-
e_1_1 = _d.sent();
|
|
73
|
-
e_1 = { error: e_1_1 };
|
|
74
|
-
return [3 /*break*/, 9];
|
|
75
|
-
case 8:
|
|
76
|
-
try {
|
|
77
|
-
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
|
|
78
|
-
}
|
|
79
|
-
finally { if (e_1) throw e_1.error; }
|
|
80
|
-
return [7 /*endfinally*/];
|
|
81
|
-
case 9: return [2 /*return*/];
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
};
|
|
85
|
-
return ScopeImpl;
|
|
86
|
-
}());
|
|
9
|
+
*events() {
|
|
10
|
+
yield this.scope;
|
|
11
|
+
for (const event of this.descendants.descendants()) {
|
|
12
|
+
yield event.event;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
87
16
|
exports.default = ScopeImpl;
|
|
88
|
-
//# sourceMappingURL=scopeImpl.js.map
|
|
@@ -1,21 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
function ScopeIterator() {
|
|
5
|
-
}
|
|
3
|
+
class ScopeIterator {
|
|
6
4
|
// Scan ahead past the return event of the yielded scope.
|
|
7
|
-
|
|
5
|
+
advanceToReturnEvent(scopeEvent, events) {
|
|
8
6
|
// Don't use for...of events here, it doesn't work with an outer for...of on the same events generator.
|
|
9
|
-
|
|
7
|
+
let eventResult = events.next();
|
|
10
8
|
while (!eventResult.done) {
|
|
11
|
-
|
|
9
|
+
const event = eventResult.value;
|
|
12
10
|
if (event.isReturn() && event.callEvent === scopeEvent) {
|
|
13
11
|
break;
|
|
14
12
|
}
|
|
15
13
|
eventResult = events.next();
|
|
16
14
|
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
}());
|
|
15
|
+
}
|
|
16
|
+
}
|
|
20
17
|
exports.default = ScopeIterator;
|
|
21
|
-
//# sourceMappingURL=scopeIterator.js.map
|