@loadmill/core 0.3.139 → 0.3.141
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/dist/assertions/index.d.ts +32 -0
- package/dist/assertions/index.js +52 -0
- package/dist/assertions/index.js.map +1 -0
- package/dist/code-step/index.d.ts +23 -0
- package/dist/code-step/index.js +97 -0
- package/dist/code-step/index.js.map +1 -0
- package/dist/conf/defaults.d.ts +1 -0
- package/dist/conf/defaults.js +11 -0
- package/dist/conf/defaults.js.map +1 -0
- package/dist/conf/extrema.d.ts +7 -0
- package/dist/conf/extrema.js +12 -0
- package/dist/conf/extrema.js.map +1 -0
- package/dist/conf/index.d.ts +15 -0
- package/dist/conf/index.js +80 -0
- package/dist/conf/index.js.map +1 -0
- package/dist/conf/notifications.d.ts +2 -0
- package/dist/conf/notifications.js +19 -0
- package/dist/conf/notifications.js.map +1 -0
- package/dist/conf/types.d.ts +122 -0
- package/dist/conf/types.js +38 -0
- package/dist/conf/types.js.map +1 -0
- package/dist/conf/validate.d.ts +69 -0
- package/dist/conf/validate.js +509 -0
- package/dist/conf/validate.js.map +1 -0
- package/dist/distributed-logger-reporter.d.ts +3 -0
- package/dist/distributed-logger-reporter.js +74 -0
- package/dist/distributed-logger-reporter.js.map +1 -0
- package/dist/echo/firehose.d.ts +7 -0
- package/dist/echo/firehose.js +130 -0
- package/dist/echo/firehose.js.map +1 -0
- package/dist/echo/index.d.ts +3 -0
- package/dist/echo/index.js +8 -0
- package/dist/echo/index.js.map +1 -0
- package/dist/echo/stats.d.ts +8 -0
- package/dist/echo/stats.js +152 -0
- package/dist/echo/stats.js.map +1 -0
- package/dist/extract-and-assert-step/index.d.ts +29 -0
- package/dist/extract-and-assert-step/index.js +108 -0
- package/dist/extract-and-assert-step/index.js.map +1 -0
- package/dist/extractions/index.d.ts +36 -0
- package/dist/extractions/index.js +49 -0
- package/dist/extractions/index.js.map +1 -0
- package/dist/har/index.d.ts +71 -0
- package/dist/har/index.js +61 -0
- package/dist/har/index.js.map +1 -0
- package/dist/labels/constants.d.ts +1 -0
- package/dist/labels/constants.js +5 -0
- package/dist/labels/constants.js.map +1 -0
- package/dist/multipart-form-data/files.d.ts +2 -0
- package/dist/multipart-form-data/files.js +63 -0
- package/dist/multipart-form-data/files.js.map +1 -0
- package/dist/multipart-form-data/form-data-utils.d.ts +19 -0
- package/dist/multipart-form-data/form-data-utils.js +118 -0
- package/dist/multipart-form-data/form-data-utils.js.map +1 -0
- package/dist/multipart-form-data/is-binary-file.d.ts +2 -0
- package/dist/multipart-form-data/is-binary-file.js +215 -0
- package/dist/multipart-form-data/is-binary-file.js.map +1 -0
- package/dist/multipart-form-data/multipart-text-to-post-form-data.d.ts +3 -0
- package/dist/multipart-form-data/multipart-text-to-post-form-data.js +93 -0
- package/dist/multipart-form-data/multipart-text-to-post-form-data.js.map +1 -0
- package/dist/parameters/extractions.d.ts +27 -0
- package/dist/parameters/extractions.js +51 -0
- package/dist/parameters/extractions.js.map +1 -0
- package/dist/parameters/extractors/cheerio-extractor.d.ts +11 -0
- package/dist/parameters/extractors/cheerio-extractor.js +84 -0
- package/dist/parameters/extractors/cheerio-extractor.js.map +1 -0
- package/dist/parameters/extractors/expression-extractor.d.ts +6 -0
- package/dist/parameters/extractors/expression-extractor.js +38 -0
- package/dist/parameters/extractors/expression-extractor.js.map +1 -0
- package/dist/parameters/extractors/extractor.d.ts +3 -0
- package/dist/parameters/extractors/extractor.js +3 -0
- package/dist/parameters/extractors/extractor.js.map +1 -0
- package/dist/parameters/extractors/header-extractor.d.ts +7 -0
- package/dist/parameters/extractors/header-extractor.js +51 -0
- package/dist/parameters/extractors/header-extractor.js.map +1 -0
- package/dist/parameters/extractors/index.d.ts +10 -0
- package/dist/parameters/extractors/index.js +20 -0
- package/dist/parameters/extractors/index.js.map +1 -0
- package/dist/parameters/extractors/json-path-extractor.d.ts +11 -0
- package/dist/parameters/extractors/json-path-extractor.js +127 -0
- package/dist/parameters/extractors/json-path-extractor.js.map +1 -0
- package/dist/parameters/extractors/parametrized-extractor.d.ts +10 -0
- package/dist/parameters/extractors/parametrized-extractor.js +34 -0
- package/dist/parameters/extractors/parametrized-extractor.js.map +1 -0
- package/dist/parameters/extractors/regex-extractor.d.ts +7 -0
- package/dist/parameters/extractors/regex-extractor.js +46 -0
- package/dist/parameters/extractors/regex-extractor.js.map +1 -0
- package/dist/parameters/extractors/regex-matcher.d.ts +1 -0
- package/dist/parameters/extractors/regex-matcher.js +22 -0
- package/dist/parameters/extractors/regex-matcher.js.map +1 -0
- package/dist/parameters/extractors/ws-extractor.d.ts +33 -0
- package/dist/parameters/extractors/ws-extractor.js +215 -0
- package/dist/parameters/extractors/ws-extractor.js.map +1 -0
- package/dist/parameters/extractors/x-path-extractor.d.ts +9 -0
- package/dist/parameters/extractors/x-path-extractor.js +77 -0
- package/dist/parameters/extractors/x-path-extractor.js.map +1 -0
- package/dist/parameters/generate-random.d.ts +13 -0
- package/dist/parameters/generate-random.js +108 -0
- package/dist/parameters/generate-random.js.map +1 -0
- package/dist/parameters/html-utils.d.ts +1 -0
- package/dist/parameters/html-utils.js +18 -0
- package/dist/parameters/html-utils.js.map +1 -0
- package/dist/parameters/index.d.ts +94 -0
- package/dist/parameters/index.js +619 -0
- package/dist/parameters/index.js.map +1 -0
- package/dist/parameters/json-path-utils.d.ts +1 -0
- package/dist/parameters/json-path-utils.js +16 -0
- package/dist/parameters/json-path-utils.js.map +1 -0
- package/dist/parameters/operators/binary-operator.d.ts +13 -0
- package/dist/parameters/operators/binary-operator.js +39 -0
- package/dist/parameters/operators/binary-operator.js.map +1 -0
- package/dist/parameters/operators/index.d.ts +5 -0
- package/dist/parameters/operators/index.js +21 -0
- package/dist/parameters/operators/index.js.map +1 -0
- package/dist/parameters/parameter-functions/aws-cognito.d.ts +3 -0
- package/dist/parameters/parameter-functions/aws-cognito.js +119 -0
- package/dist/parameters/parameter-functions/aws-cognito.js.map +1 -0
- package/dist/parameters/parameter-functions/boolean-parameter-functions.d.ts +12 -0
- package/dist/parameters/parameter-functions/boolean-parameter-functions.js +47 -0
- package/dist/parameters/parameter-functions/boolean-parameter-functions.js.map +1 -0
- package/dist/parameters/parameter-functions/crypto.d.ts +11 -0
- package/dist/parameters/parameter-functions/crypto.js +71 -0
- package/dist/parameters/parameter-functions/crypto.js.map +1 -0
- package/dist/parameters/parameter-functions/json-schema.d.ts +1 -0
- package/dist/parameters/parameter-functions/json-schema.js +33 -0
- package/dist/parameters/parameter-functions/json-schema.js.map +1 -0
- package/dist/parameters/parameter-functions/numeric-input-parameter-functions.d.ts +11 -0
- package/dist/parameters/parameter-functions/numeric-input-parameter-functions.js +34 -0
- package/dist/parameters/parameter-functions/numeric-input-parameter-functions.js.map +1 -0
- package/dist/parameters/parameter-functions/numeric-parameter-functions.d.ts +15 -0
- package/dist/parameters/parameter-functions/numeric-parameter-functions.js +56 -0
- package/dist/parameters/parameter-functions/numeric-parameter-functions.js.map +1 -0
- package/dist/parameters/parameter-functions/parameter-function-utils.d.ts +5 -0
- package/dist/parameters/parameter-functions/parameter-function-utils.js +82 -0
- package/dist/parameters/parameter-functions/parameter-function-utils.js.map +1 -0
- package/dist/parameters/parameter-functions/parameter-function.d.ts +6 -0
- package/dist/parameters/parameter-functions/parameter-function.js +28 -0
- package/dist/parameters/parameter-functions/parameter-function.js.map +1 -0
- package/dist/parameters/parameter-functions/parameter-functions.d.ts +7 -0
- package/dist/parameters/parameter-functions/parameter-functions.js +53 -0
- package/dist/parameters/parameter-functions/parameter-functions.js.map +1 -0
- package/dist/parameters/parameter-functions/random-parameter-functions.d.ts +1 -0
- package/dist/parameters/parameter-functions/random-parameter-functions.js +43 -0
- package/dist/parameters/parameter-functions/random-parameter-functions.js.map +1 -0
- package/dist/parameters/parameter-functions/textual-parameter-functions.d.ts +72 -0
- package/dist/parameters/parameter-functions/textual-parameter-functions.js +389 -0
- package/dist/parameters/parameter-functions/textual-parameter-functions.js.map +1 -0
- package/dist/parameters/parameter-name-utils.d.ts +6 -0
- package/dist/parameters/parameter-name-utils.js +124 -0
- package/dist/parameters/parameter-name-utils.js.map +1 -0
- package/dist/parameters/parameter-regex-providers.d.ts +24 -0
- package/dist/parameters/parameter-regex-providers.js +70 -0
- package/dist/parameters/parameter-regex-providers.js.map +1 -0
- package/dist/parameters/resolvers/random-parameters-resolver.d.ts +1 -0
- package/dist/parameters/resolvers/random-parameters-resolver.js +12 -0
- package/dist/parameters/resolvers/random-parameters-resolver.js.map +1 -0
- package/dist/parameters/type.d.ts +10 -0
- package/dist/parameters/type.js +9 -0
- package/dist/parameters/type.js.map +1 -0
- package/dist/parameters/value-utils.d.ts +5 -0
- package/dist/parameters/value-utils.js +44 -0
- package/dist/parameters/value-utils.js.map +1 -0
- package/dist/request/index.d.ts +174 -0
- package/dist/request/index.js +356 -0
- package/dist/request/index.js.map +1 -0
- package/dist/schema/json-schema-generator.d.ts +20 -0
- package/dist/schema/json-schema-generator.js +135 -0
- package/dist/schema/json-schema-generator.js.map +1 -0
- package/dist/signals.d.ts +4 -0
- package/dist/signals.js +9 -0
- package/dist/signals.js.map +1 -0
- package/dist/socket-events/index.d.ts +13 -0
- package/dist/socket-events/index.js +17 -0
- package/dist/socket-events/index.js.map +1 -0
- package/dist/step/assertable.d.ts +4 -0
- package/dist/step/assertable.js +3 -0
- package/dist/step/assertable.js.map +1 -0
- package/dist/step/codeable.d.ts +3 -0
- package/dist/step/codeable.js +3 -0
- package/dist/step/codeable.js.map +1 -0
- package/dist/step/extractable.d.ts +4 -0
- package/dist/step/extractable.js +3 -0
- package/dist/step/extractable.js.map +1 -0
- package/dist/step/index.d.ts +72 -0
- package/dist/step/index.js +71 -0
- package/dist/step/index.js.map +1 -0
- package/dist/step/step-type.d.ts +4 -0
- package/dist/step/step-type.js +3 -0
- package/dist/step/step-type.js.map +1 -0
- package/dist/step/type-guards.d.ts +7 -0
- package/dist/step/type-guards.js +18 -0
- package/dist/step/type-guards.js.map +1 -0
- package/dist/subset/index.d.ts +3 -0
- package/dist/subset/index.js +8 -0
- package/dist/subset/index.js.map +1 -0
- package/dist/subset/is-subset.d.ts +2 -0
- package/dist/subset/is-subset.js +29 -0
- package/dist/subset/is-subset.js.map +1 -0
- package/dist/subset/json-contains.d.ts +1 -0
- package/dist/subset/json-contains.js +24 -0
- package/dist/subset/json-contains.js.map +1 -0
- package/dist/team-options/constants.d.ts +3 -0
- package/dist/team-options/constants.js +7 -0
- package/dist/team-options/constants.js.map +1 -0
- package/dist/xml/decode.d.ts +2 -0
- package/dist/xml/decode.js +91 -0
- package/dist/xml/decode.js.map +1 -0
- package/dist/xml/encode.d.ts +1 -0
- package/dist/xml/encode.js +14 -0
- package/dist/xml/encode.js.map +1 -0
- package/dist/xml/escape-reserved-chars.d.ts +6 -0
- package/dist/xml/escape-reserved-chars.js +57 -0
- package/dist/xml/escape-reserved-chars.js.map +1 -0
- package/dist/xml/is-xml.d.ts +1 -0
- package/dist/xml/is-xml.js +9 -0
- package/dist/xml/is-xml.js.map +1 -0
- package/dist/xml/json-to-xml.d.ts +2 -0
- package/dist/xml/json-to-xml.js +11 -0
- package/dist/xml/json-to-xml.js.map +1 -0
- package/dist/xml/namespaces.d.ts +7 -0
- package/dist/xml/namespaces.js +16 -0
- package/dist/xml/namespaces.js.map +1 -0
- package/dist/xml/remove-invisible-chars.d.ts +2 -0
- package/dist/xml/remove-invisible-chars.js +13 -0
- package/dist/xml/remove-invisible-chars.js.map +1 -0
- package/dist/xml/replace-s-tags.d.ts +4 -0
- package/dist/xml/replace-s-tags.js +21 -0
- package/dist/xml/replace-s-tags.js.map +1 -0
- package/dist/xml/xml-to-json.d.ts +7 -0
- package/dist/xml/xml-to-json.js +21 -0
- package/dist/xml/xml-to-json.js.map +1 -0
- package/package.json +3 -2
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CONTAINS_APP_JSON_REGEXP = exports.CSRF_REGEXP = exports.CSRF_REGEXP_SUFFIX = exports.isCaptureAllRegExp = exports.CAPTURE_ALL_REGEX = exports.SIGNLE_PARAM_USAGE_REGEXP = exports.PARAM_USAGE_REGEXP = exports.CAPTURE_REGEX = exports.getParameterOperatorsGroupingRegexp = exports.getParameterfunctionGroupingRegexp = exports.getParameterUsageRegexp = exports.globalUsageRegExpProvider = exports.usageRegExpProvider = exports.spacesRegExpProvider = exports.PARAMETER_USAGE_PATTERN = exports.PARAMETER_USAGE_PATTERN_INSIDE = exports.SPACED_OPERATOR = exports.LEGAL_PARAM_CHARS = void 0;
|
|
4
|
+
var operators_1 = require("./operators");
|
|
5
|
+
var OneOffRegExpProvider = /** @class */ (function () {
|
|
6
|
+
function OneOffRegExpProvider(regExp) {
|
|
7
|
+
var _this = this;
|
|
8
|
+
Object.defineProperty(this, "regExp", {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
configurable: true,
|
|
11
|
+
writable: true,
|
|
12
|
+
value: regExp
|
|
13
|
+
});
|
|
14
|
+
Object.defineProperty(this, "use", {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
configurable: true,
|
|
17
|
+
writable: true,
|
|
18
|
+
value: function (callback) {
|
|
19
|
+
_this.regExp.lastIndex = 0;
|
|
20
|
+
return callback(_this.regExp);
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
return OneOffRegExpProvider;
|
|
25
|
+
}());
|
|
26
|
+
var SPACES = '(?: +)';
|
|
27
|
+
var LITERAL = '(?:\'[^,\'\\s]*\')';
|
|
28
|
+
exports.LEGAL_PARAM_CHARS = '_a-zA-Z0-9';
|
|
29
|
+
var PARAMETER = '(?:[_a-zA-Z][' + exports.LEGAL_PARAM_CHARS + ']*)';
|
|
30
|
+
var PARAMETER_OR_LITERAL = "(?:" + PARAMETER + "|" + LITERAL + ")";
|
|
31
|
+
var EXPRESSION = "(?:" + LITERAL + "|(?:(?:" + PARAMETER + "(?:\\((?:" + PARAMETER_OR_LITERAL + "(?:," + PARAMETER_OR_LITERAL + ")*)?\\))?)))";
|
|
32
|
+
var OPERATOR = '(?:' + Object.values(operators_1.operators).map(function (op) { return op.regexSymbol; }).join('|') + ')';
|
|
33
|
+
exports.SPACED_OPERATOR = "" + SPACES + OPERATOR + SPACES;
|
|
34
|
+
// Capture groups designed to work with code mirror parser - be minded!
|
|
35
|
+
exports.PARAMETER_USAGE_PATTERN_INSIDE = "^((?: *)(?:" + EXPRESSION + "(?:" + exports.SPACED_OPERATOR + EXPRESSION + ")*)(?: *))";
|
|
36
|
+
exports.PARAMETER_USAGE_PATTERN = "(\\${)((?: *)(?:" + EXPRESSION + "(?:" + exports.SPACED_OPERATOR + EXPRESSION + ")*)(?: *))(})";
|
|
37
|
+
exports.spacesRegExpProvider = new OneOffRegExpProvider(new RegExp(SPACES));
|
|
38
|
+
exports.usageRegExpProvider = new OneOffRegExpProvider(new RegExp(exports.PARAMETER_USAGE_PATTERN));
|
|
39
|
+
exports.globalUsageRegExpProvider = new OneOffRegExpProvider(new RegExp(exports.PARAMETER_USAGE_PATTERN, 'g'));
|
|
40
|
+
var PARAM_USAGE_REGEXP_PREFIX = '\\${(.[^}]*)?';
|
|
41
|
+
var PARAM_USAGE_REGEXP_SUFFIX = '([\\),\\s].*?)?}';
|
|
42
|
+
var PARAM_GROUPING_REGEXP_PREFIX = '(?<pre>\\${.*?[\\(,])(?<param>';
|
|
43
|
+
var PARAM_GROUPING_REGEXP_SUFFIX = ')(?<suff>[\\),].*?})';
|
|
44
|
+
var PARAM_OPERATORS_GROUPING_REGEXP_PREFIX = "\\${(?<pre>.*?" + exports.SPACED_OPERATOR + ".*)?(?<param>.*";
|
|
45
|
+
var PARAM_OPERATORS_GROUPING_REGEXP_SUFFIX = ")(?<suff>" + exports.SPACED_OPERATOR + ".*)?}";
|
|
46
|
+
var getParameterUsageRegexp = function (parameterName) {
|
|
47
|
+
return new RegExp("" + PARAM_USAGE_REGEXP_PREFIX + parameterName + PARAM_USAGE_REGEXP_SUFFIX, 'g');
|
|
48
|
+
};
|
|
49
|
+
exports.getParameterUsageRegexp = getParameterUsageRegexp;
|
|
50
|
+
var getParameterfunctionGroupingRegexp = function (parameterName) {
|
|
51
|
+
return new RegExp("" + PARAM_GROUPING_REGEXP_PREFIX + parameterName + PARAM_GROUPING_REGEXP_SUFFIX);
|
|
52
|
+
};
|
|
53
|
+
exports.getParameterfunctionGroupingRegexp = getParameterfunctionGroupingRegexp;
|
|
54
|
+
var getParameterOperatorsGroupingRegexp = function (parameterName) {
|
|
55
|
+
return new RegExp("" + PARAM_OPERATORS_GROUPING_REGEXP_PREFIX + parameterName + PARAM_OPERATORS_GROUPING_REGEXP_SUFFIX);
|
|
56
|
+
};
|
|
57
|
+
exports.getParameterOperatorsGroupingRegexp = getParameterOperatorsGroupingRegexp;
|
|
58
|
+
exports.CAPTURE_REGEX = /(([^\\]\(|^\().*[^\\]\))/;
|
|
59
|
+
exports.PARAM_USAGE_REGEXP = /\$\{(.+)\}/;
|
|
60
|
+
exports.SIGNLE_PARAM_USAGE_REGEXP = /^\${\w+}$/;
|
|
61
|
+
exports.CAPTURE_ALL_REGEX = /(.*)/;
|
|
62
|
+
function isCaptureAllRegExp(regexp) {
|
|
63
|
+
return String(exports.CAPTURE_ALL_REGEX) === String(regexp);
|
|
64
|
+
}
|
|
65
|
+
exports.isCaptureAllRegExp = isCaptureAllRegExp;
|
|
66
|
+
var CSRF_REGEXP_PREFIX = '[^"\',;=:{\\s]*?[cCxX](?:srf|SRF)[^\'" =:]*?';
|
|
67
|
+
exports.CSRF_REGEXP_SUFFIX = ' *\\\\?["\']?(?:=|:) *\\\\?["\']([^\'"]+?)\\\\?["\']';
|
|
68
|
+
exports.CSRF_REGEXP = CSRF_REGEXP_PREFIX + exports.CSRF_REGEXP_SUFFIX;
|
|
69
|
+
exports.CONTAINS_APP_JSON_REGEXP = /application\/(.*)json/;
|
|
70
|
+
//# sourceMappingURL=parameter-regex-providers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"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tD,CAAC;AAFD,gDAEC;AAED,IAAM,kBAAkB,GAAG,8CAA8C,CAAC;AAC7D,QAAA,kBAAkB,GAAG,sDAAsD,CAAC;AAC5E,QAAA,WAAW,GAAG,kBAAkB,GAAG,0BAAkB,CAAC;AAEtD,QAAA,wBAAwB,GAAG,uBAAuB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function resolveRandomParameter(parameterName: string): any;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolveRandomParameter = void 0;
|
|
4
|
+
var generate_random_1 = require("../generate-random");
|
|
5
|
+
function resolveRandomParameter(parameterName) {
|
|
6
|
+
if (parameterName.startsWith('__random_')) {
|
|
7
|
+
var _a = parameterName.split('_'), kind = _a[3], arg1 = _a[4], arg2 = _a[5];
|
|
8
|
+
return generate_random_1.generateRandom(kind, arg1, arg2);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
exports.resolveRandomParameter = resolveRandomParameter;
|
|
12
|
+
//# sourceMappingURL=random-parameters-resolver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"random-parameters-resolver.js","sourceRoot":"","sources":["../../../src/parameters/resolvers/random-parameters-resolver.ts"],"names":[],"mappings":";;;AAAA,sDAAoD;AAEpD,SAAgB,sBAAsB,CAAC,aAAqB;IAC1D,IAAI,aAAa,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE;QACnC,IAAA,KAA2B,aAAa,CAAC,KAAK,CAAC,GAAG,CAAC,EAA5C,IAAI,QAAA,EAAE,IAAI,QAAA,EAAE,IAAI,QAA4B,CAAC;QAC1D,OAAO,gCAAc,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;KACzC;AACH,CAAC;AALD,wDAKC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ParametersScope = void 0;
|
|
4
|
+
var ParametersScope;
|
|
5
|
+
(function (ParametersScope) {
|
|
6
|
+
ParametersScope["SUITE"] = "SUITE";
|
|
7
|
+
ParametersScope["FLOW"] = "FLOW";
|
|
8
|
+
})(ParametersScope = exports.ParametersScope || (exports.ParametersScope = {}));
|
|
9
|
+
//# sourceMappingURL=type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type.js","sourceRoot":"","sources":["../../src/parameters/type.ts"],"names":[],"mappings":";;;AAGA,IAAY,eAGT;AAHH,WAAY,eAAe;IACvB,kCAAe,CAAA;IACf,gCAAa,CAAA;AACf,CAAC,EAHS,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAGxB"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const RANDOM_SELECT_OPT = "random";
|
|
2
|
+
export declare function isTruthyParameterValue(value: any): boolean;
|
|
3
|
+
export declare function isFalsyParameterValue(value?: string | boolean): boolean;
|
|
4
|
+
export declare function pickRandom(array: any[]): any;
|
|
5
|
+
export declare function parameterValueToNumber(value?: string | null, options?: any): number | null;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parameterValueToNumber = exports.pickRandom = exports.isFalsyParameterValue = exports.isTruthyParameterValue = exports.RANDOM_SELECT_OPT = void 0;
|
|
4
|
+
var random = require("lodash/random");
|
|
5
|
+
exports.RANDOM_SELECT_OPT = 'random';
|
|
6
|
+
var FALSY_AS_LOWERCASE_STRINGS = ['undefined', 'null', 'false', 'nan'];
|
|
7
|
+
function isTruthyParameterValue(value) {
|
|
8
|
+
if (value && typeof value === 'string') {
|
|
9
|
+
var str = value.toLowerCase();
|
|
10
|
+
return !FALSY_AS_LOWERCASE_STRINGS.includes(str);
|
|
11
|
+
}
|
|
12
|
+
return !!value;
|
|
13
|
+
}
|
|
14
|
+
exports.isTruthyParameterValue = isTruthyParameterValue;
|
|
15
|
+
function isFalsyParameterValue(value) {
|
|
16
|
+
return (value == null ||
|
|
17
|
+
value === false ||
|
|
18
|
+
(typeof value === 'string' && value.toLowerCase() === 'false') ||
|
|
19
|
+
value === '');
|
|
20
|
+
}
|
|
21
|
+
exports.isFalsyParameterValue = isFalsyParameterValue;
|
|
22
|
+
function pickRandom(array) {
|
|
23
|
+
return array[random(0, array.length - 1)];
|
|
24
|
+
}
|
|
25
|
+
exports.pickRandom = pickRandom;
|
|
26
|
+
function parameterValueToNumber(value, options) {
|
|
27
|
+
if (value == null || value === '') {
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
var numeric = Number(value);
|
|
31
|
+
if (Number.isFinite(numeric)) {
|
|
32
|
+
if (options &&
|
|
33
|
+
((options.integer && !Number.isSafeInteger(numeric)) ||
|
|
34
|
+
(options.nonNegative && numeric < 0))) {
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
return numeric;
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
exports.parameterValueToNumber = parameterValueToNumber;
|
|
44
|
+
//# sourceMappingURL=value-utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"value-utils.js","sourceRoot":"","sources":["../../src/parameters/value-utils.ts"],"names":[],"mappings":";;;AAAA,sCAAyC;AAE5B,QAAA,iBAAiB,GAAG,QAAQ,CAAC;AAE1C,IAAM,0BAA0B,GAAG,CAAC,WAAW,EAAC,MAAM,EAAC,OAAO,EAAC,KAAK,CAAC,CAAC;AAEtE,SAAgB,sBAAsB,CAAC,KAAU;IAC/C,IAAI,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;QACtC,IAAM,GAAG,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC;QAChC,OAAO,CAAC,0BAA0B,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;KAClD;IACD,OAAO,CAAC,CAAC,KAAK,CAAC;AACjB,CAAC;AAND,wDAMC;AAED,SAAgB,qBAAqB,CAAC,KAAwB;IAC5D,OAAO,CACL,KAAK,IAAI,IAAI;QACb,KAAK,KAAK,KAAK;QACf,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,WAAW,EAAE,KAAK,OAAO,CAAC;QAC9D,KAAK,KAAK,EAAE,CACb,CAAC;AACJ,CAAC;AAPD,sDAOC;AAED,SAAgB,UAAU,CAAC,KAAY;IACrC,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;AAC5C,CAAC;AAFD,gCAEC;AAED,SAAgB,sBAAsB,CAAC,KAAqB,EAAE,OAAQ;IACpE,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,KAAK,EAAE,EAAE;QACjC,OAAO,IAAI,CAAC;KACb;IAED,IAAM,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAE9B,IAAI,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE;QAC5B,IACE,OAAO;YACP,CAAC,CAAC,OAAO,CAAC,OAAO,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;gBAClD,CAAC,OAAO,CAAC,WAAW,IAAI,OAAO,GAAG,CAAC,CAAC,CAAC,EACvC;YACA,OAAO,IAAI,CAAC;SACb;QACD,OAAO,OAAO,CAAC;KAChB;SAAM;QACL,OAAO,IAAI,CAAC;KACb;AACH,CAAC;AAnBD,wDAmBC"}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import { Parameters } from '../parameters';
|
|
2
|
+
import { isReservedHeader as isReservedRecordedHeader } from '../har';
|
|
3
|
+
import { LoopConf, SkipConf, StepFlowType as RequestType, StepLike, StepTypes, StepMeta } from '../step';
|
|
4
|
+
import { Extractions } from '../extractions';
|
|
5
|
+
import { Assertions } from '../assertions';
|
|
6
|
+
import { Step } from '../step/step-type';
|
|
7
|
+
import { Codeable } from '../step/codeable';
|
|
8
|
+
import { Extractable } from '../step/extractable';
|
|
9
|
+
import { Assertable } from '../step/assertable';
|
|
10
|
+
export declare const DEFAULT_REQUEST_TIMEOUT = 25000;
|
|
11
|
+
export declare const supportedMethods: {
|
|
12
|
+
GET: string;
|
|
13
|
+
POST: string;
|
|
14
|
+
PUT: string;
|
|
15
|
+
DELETE: string;
|
|
16
|
+
PATCH: string;
|
|
17
|
+
};
|
|
18
|
+
export declare const ALLOWED_RESPONSE_STATUSES: {
|
|
19
|
+
SUCCESS: string;
|
|
20
|
+
ERROR: string;
|
|
21
|
+
ANY: string;
|
|
22
|
+
};
|
|
23
|
+
export declare type HttpMethod = keyof typeof supportedMethods;
|
|
24
|
+
export declare type HttpResponseStatus = keyof typeof ALLOWED_RESPONSE_STATUSES;
|
|
25
|
+
/**
|
|
26
|
+
* This class represents an HTTP request to be performed in the course of a load test.
|
|
27
|
+
*
|
|
28
|
+
* @property url The URL of the request (parameterizable).
|
|
29
|
+
* @property method The HTTP method.
|
|
30
|
+
* @property headers An array of headers to add to the request (values parameterizable).
|
|
31
|
+
* @property postData The content of the request (text parameterizable).
|
|
32
|
+
* @property delay The delay between this request and the previous one in milliseconds. This property is ignored for the first request.
|
|
33
|
+
* @property timeout The time to wait for the request to finish in milliseconds.
|
|
34
|
+
* @property extract A dictionary of parameter extractions.
|
|
35
|
+
* @property assert An array or dictionary of assertions.
|
|
36
|
+
* @property expectedStatus The expected status of the http response SUCCESS for 2XX-3XX, ERROR for 4XX-5XX.
|
|
37
|
+
*/
|
|
38
|
+
export declare class LoadmillRequest implements RequestLike, Codeable, Extractable, Assertable {
|
|
39
|
+
url: string;
|
|
40
|
+
readonly type?: StepTypes;
|
|
41
|
+
id?: string;
|
|
42
|
+
auth?: AuthConf;
|
|
43
|
+
stopBefore?: string;
|
|
44
|
+
skipBefore?: SkipConf;
|
|
45
|
+
loop?: LoopConf;
|
|
46
|
+
useCookies?: boolean;
|
|
47
|
+
description?: string;
|
|
48
|
+
delay?: number | string;
|
|
49
|
+
postData?: RequestPostData;
|
|
50
|
+
postFormData?: PostFormData;
|
|
51
|
+
graphqlPostData?: GraphqlPostData;
|
|
52
|
+
file?: RequestRawFileData;
|
|
53
|
+
grpc?: GRPC;
|
|
54
|
+
cachePenetration?: CachePenetration;
|
|
55
|
+
method: HttpMethod;
|
|
56
|
+
headers?: LoadmillHeaders[];
|
|
57
|
+
assert?: Assertions;
|
|
58
|
+
extract?: Extractions[];
|
|
59
|
+
postScript?: string;
|
|
60
|
+
disabled?: boolean;
|
|
61
|
+
timeout?: number;
|
|
62
|
+
expectedStatus?: HttpResponseStatus;
|
|
63
|
+
noRedirects?: boolean;
|
|
64
|
+
meta?: RequestMeta;
|
|
65
|
+
constructor(url: string);
|
|
66
|
+
}
|
|
67
|
+
export declare type LoadmillOrFinfRequest = Step & {
|
|
68
|
+
isFinfRequest?: boolean;
|
|
69
|
+
};
|
|
70
|
+
export declare function resolveUrl(url: string, parameters: Parameters | Parameters[], onError?: any): string;
|
|
71
|
+
/**
|
|
72
|
+
* This function should be able to take any object/json and either make a VALID LoadmillRequest out of it
|
|
73
|
+
* or fail with a meaningful error message.
|
|
74
|
+
*/
|
|
75
|
+
export declare function createRequest(from: RequestLike): LoadmillRequest;
|
|
76
|
+
export declare function toHeaders(headers: LoadmillHeaders | LoadmillHeaders[]): LoadmillHeaders[];
|
|
77
|
+
export declare const isReservedHeader: typeof isReservedRecordedHeader;
|
|
78
|
+
export interface RequestLike extends StepLike {
|
|
79
|
+
url: string;
|
|
80
|
+
auth?: AuthConf;
|
|
81
|
+
method?: HttpMethod;
|
|
82
|
+
postData?: RequestPostData;
|
|
83
|
+
postFormData?: PostFormData;
|
|
84
|
+
graphqlPostData?: GraphqlPostData;
|
|
85
|
+
file?: RequestRawFileData;
|
|
86
|
+
grpc?: GRPC;
|
|
87
|
+
extract?: Extractions | Extractions[];
|
|
88
|
+
headers?: LoadmillHeaders | LoadmillHeaders[];
|
|
89
|
+
expectedStatus?: HttpResponseStatus;
|
|
90
|
+
parameters?: any;
|
|
91
|
+
postScript?: string;
|
|
92
|
+
noRedirects?: boolean;
|
|
93
|
+
meta?: RequestMeta;
|
|
94
|
+
}
|
|
95
|
+
export declare type RequestMeta = StepMeta;
|
|
96
|
+
export declare type RequestPostData = {
|
|
97
|
+
mimeType?: string;
|
|
98
|
+
text: string;
|
|
99
|
+
params?: ParamsEntry[];
|
|
100
|
+
};
|
|
101
|
+
export declare type ParamsEntry = {
|
|
102
|
+
name: string;
|
|
103
|
+
value: string;
|
|
104
|
+
};
|
|
105
|
+
export declare type PostFormData = PostFormDataEntry[];
|
|
106
|
+
export declare type PostFormDataEntry = {
|
|
107
|
+
name: string;
|
|
108
|
+
value: string;
|
|
109
|
+
fileName?: string;
|
|
110
|
+
contentType?: string;
|
|
111
|
+
};
|
|
112
|
+
export declare type GraphqlPostData = {
|
|
113
|
+
query?: string;
|
|
114
|
+
operationName?: string;
|
|
115
|
+
variables?: string;
|
|
116
|
+
};
|
|
117
|
+
export declare type RequestRawFileData = {
|
|
118
|
+
name: string;
|
|
119
|
+
key: string;
|
|
120
|
+
signedUrl?: string;
|
|
121
|
+
};
|
|
122
|
+
export declare enum BodyTypes {
|
|
123
|
+
POST_DATA = "postData",
|
|
124
|
+
URLENCODED = "urlencoded",
|
|
125
|
+
FORM_DATA = "postFormData",
|
|
126
|
+
RAW_FILE = "rawFile",
|
|
127
|
+
GRAPHQL = "GraphQL"
|
|
128
|
+
}
|
|
129
|
+
export declare type GRPC = {
|
|
130
|
+
service: string;
|
|
131
|
+
method: string;
|
|
132
|
+
message: string;
|
|
133
|
+
};
|
|
134
|
+
export declare type LoadmillHeaders = {
|
|
135
|
+
[headerName: string]: string;
|
|
136
|
+
};
|
|
137
|
+
export interface AuthConf {
|
|
138
|
+
user?: string;
|
|
139
|
+
password?: string;
|
|
140
|
+
}
|
|
141
|
+
export interface CachePenetration {
|
|
142
|
+
cacheControl?: string;
|
|
143
|
+
mode?: CachePenetrationModes;
|
|
144
|
+
}
|
|
145
|
+
export declare enum CachePenetrationModes {
|
|
146
|
+
none = "none",
|
|
147
|
+
def = "default",
|
|
148
|
+
alwaysQuery = "always-query",
|
|
149
|
+
alwaysHeader = "always-header"
|
|
150
|
+
}
|
|
151
|
+
export declare const EXCLUDES: string[];
|
|
152
|
+
export declare const isWSRequest: (url?: string | undefined) => boolean;
|
|
153
|
+
export declare const isHTTPRequest: (url?: string | undefined) => boolean;
|
|
154
|
+
export declare const isGRPCRequest: (url?: string | undefined) => boolean;
|
|
155
|
+
export declare const getResponseText: (content: {
|
|
156
|
+
text?: string;
|
|
157
|
+
encoding?: string;
|
|
158
|
+
}) => string | undefined;
|
|
159
|
+
export declare enum ConfMimeTypes {
|
|
160
|
+
TEXT_PLAIN = "text/plain",
|
|
161
|
+
APPLICATION_JSON = "application/json",
|
|
162
|
+
APPLICATION_JAVASCRIPT = "application/javascript",
|
|
163
|
+
APPLICATION_XML = "application/xml",
|
|
164
|
+
APPLICATION_EDN = "application/edn",
|
|
165
|
+
TEXT_XML = "text/xml",
|
|
166
|
+
TEXT_HTML = "text/html",
|
|
167
|
+
TEXT_CSS = "text/css",
|
|
168
|
+
APPLICATION_URLENCODED = "application/x-www-form-urlencoded"
|
|
169
|
+
}
|
|
170
|
+
export declare enum WsMessageType {
|
|
171
|
+
TEXT = "text",
|
|
172
|
+
BINARY = "binary"
|
|
173
|
+
}
|
|
174
|
+
export { RequestType };
|