@azure-rest/load-testing 1.0.0-alpha.20221020.2
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/LICENSE +21 -0
- package/README.md +201 -0
- package/dist/index.js +187 -0
- package/dist/index.js.map +1 -0
- package/dist-esm/src/azureLoadTesting.js +21 -0
- package/dist-esm/src/azureLoadTesting.js.map +1 -0
- package/dist-esm/src/clientDefinitions.js +4 -0
- package/dist-esm/src/clientDefinitions.js.map +1 -0
- package/dist-esm/src/index.js +13 -0
- package/dist-esm/src/index.js.map +1 -0
- package/dist-esm/src/isUnexpected.js +88 -0
- package/dist-esm/src/isUnexpected.js.map +1 -0
- package/dist-esm/src/models.js +4 -0
- package/dist-esm/src/models.js.map +1 -0
- package/dist-esm/src/outputModels.js +4 -0
- package/dist-esm/src/outputModels.js.map +1 -0
- package/dist-esm/src/paginateHelper.js +70 -0
- package/dist-esm/src/paginateHelper.js.map +1 -0
- package/dist-esm/src/parameters.js +4 -0
- package/dist-esm/src/parameters.js.map +1 -0
- package/dist-esm/src/responses.js +4 -0
- package/dist-esm/src/responses.js.map +1 -0
- package/package.json +131 -0
- package/review/load-testing.api.md +1561 -0
- package/types/load-testing.d.ts +1597 -0
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT license.
|
|
3
|
+
const responseMap = {
|
|
4
|
+
"PATCH /appcomponents/{name}": ["200", "201"],
|
|
5
|
+
"DELETE /appcomponents/{name}": ["204"],
|
|
6
|
+
"GET /appcomponents/{name}": ["200"],
|
|
7
|
+
"GET /appcomponents": ["200"],
|
|
8
|
+
"PATCH /serverMetricsConfig/{name}": ["200", "201"],
|
|
9
|
+
"GET /serverMetricsConfig/{name}": ["200"],
|
|
10
|
+
"DELETE /serverMetricsConfig/{name}": ["204"],
|
|
11
|
+
"GET /serverMetricsConfig": ["200"],
|
|
12
|
+
"GET /serverMetricsConfig/default": ["200"],
|
|
13
|
+
"GET /serverMetricsConfig/supportedResourceTypes": ["200"],
|
|
14
|
+
"PATCH /loadtests/{testId}": ["200", "201"],
|
|
15
|
+
"DELETE /loadtests/{testId}": ["204"],
|
|
16
|
+
"GET /loadtests/{testId}": ["200"],
|
|
17
|
+
"GET /loadtests/sortAndFilter": ["200"],
|
|
18
|
+
"PUT /loadtests/{testId}/files/{fileId}": ["201"],
|
|
19
|
+
"GET /loadtests/{testId}/files/{fileId}": ["200"],
|
|
20
|
+
"DELETE /loadtests/{testId}/files/{fileId}": ["204"],
|
|
21
|
+
"GET /loadtests/{testId}/files": ["200"],
|
|
22
|
+
"DELETE /testruns/{testRunId}": ["204"],
|
|
23
|
+
"PATCH /testruns/{testRunId}": ["200"],
|
|
24
|
+
"GET /testruns/{testRunId}": ["200"],
|
|
25
|
+
"GET /testruns/{testRunId}/files/{fileId}": ["200"],
|
|
26
|
+
"GET /testruns/sortAndFilter": ["200"],
|
|
27
|
+
"POST /testruns/{testRunId}:stop": ["200"],
|
|
28
|
+
"POST /testruns/{testRunId}/clientMetrics": ["200"],
|
|
29
|
+
"GET /testruns/{testRunId}/clientMetricsFilters": ["200"],
|
|
30
|
+
};
|
|
31
|
+
export function isUnexpected(response) {
|
|
32
|
+
const lroOriginal = response.headers["x-ms-original-url"];
|
|
33
|
+
const url = new URL(lroOriginal !== null && lroOriginal !== void 0 ? lroOriginal : response.request.url);
|
|
34
|
+
const method = response.request.method;
|
|
35
|
+
let pathDetails = responseMap[`${method} ${url.pathname}`];
|
|
36
|
+
if (!pathDetails) {
|
|
37
|
+
pathDetails = geParametrizedPathSuccess(url.pathname);
|
|
38
|
+
}
|
|
39
|
+
return !pathDetails.includes(response.status);
|
|
40
|
+
}
|
|
41
|
+
function geParametrizedPathSuccess(path) {
|
|
42
|
+
const pathParts = path.split("/");
|
|
43
|
+
// Iterate the responseMap to find a match
|
|
44
|
+
for (const [key, value] of Object.entries(responseMap)) {
|
|
45
|
+
// Extracting the path from the map key which is in format
|
|
46
|
+
// GET /path/foo
|
|
47
|
+
const candidatePath = getPathFromMapKey(key);
|
|
48
|
+
// Get each part of the url path
|
|
49
|
+
const candidateParts = candidatePath.split("/");
|
|
50
|
+
// If the candidate and actual paths don't match in size
|
|
51
|
+
// we move on to the next candidate path
|
|
52
|
+
if (candidateParts.length === pathParts.length && hasParametrizedPath(key)) {
|
|
53
|
+
// track if we have found a match to return the values found.
|
|
54
|
+
let found = true;
|
|
55
|
+
for (let i = 0; i < candidateParts.length; i++) {
|
|
56
|
+
if (candidateParts[i].startsWith("{") && candidateParts[i].endsWith("}")) {
|
|
57
|
+
// If the current part of the candidate is a "template" part
|
|
58
|
+
// it is a match with the actual path part on hand
|
|
59
|
+
// skip as the parameterized part can match anything
|
|
60
|
+
continue;
|
|
61
|
+
}
|
|
62
|
+
// If the candidate part is not a template and
|
|
63
|
+
// the parts don't match mark the candidate as not found
|
|
64
|
+
// to move on with the next candidate path.
|
|
65
|
+
if (candidateParts[i] !== pathParts[i]) {
|
|
66
|
+
found = false;
|
|
67
|
+
break;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
// We finished evaluating the current candidate parts
|
|
71
|
+
// if all parts matched we return the success values form
|
|
72
|
+
// the path mapping.
|
|
73
|
+
if (found) {
|
|
74
|
+
return value;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
// No match was found, return an empty array.
|
|
79
|
+
return [];
|
|
80
|
+
}
|
|
81
|
+
function hasParametrizedPath(path) {
|
|
82
|
+
return path.includes("/{");
|
|
83
|
+
}
|
|
84
|
+
function getPathFromMapKey(mapKey) {
|
|
85
|
+
const pathStart = mapKey.indexOf("/");
|
|
86
|
+
return mapKey.slice(pathStart);
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=isUnexpected.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isUnexpected.js","sourceRoot":"","sources":["../../src/isUnexpected.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AA4DlC,MAAM,WAAW,GAA6B;IAC5C,6BAA6B,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC;IAC7C,8BAA8B,EAAE,CAAC,KAAK,CAAC;IACvC,2BAA2B,EAAE,CAAC,KAAK,CAAC;IACpC,oBAAoB,EAAE,CAAC,KAAK,CAAC;IAC7B,mCAAmC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC;IACnD,iCAAiC,EAAE,CAAC,KAAK,CAAC;IAC1C,oCAAoC,EAAE,CAAC,KAAK,CAAC;IAC7C,0BAA0B,EAAE,CAAC,KAAK,CAAC;IACnC,kCAAkC,EAAE,CAAC,KAAK,CAAC;IAC3C,iDAAiD,EAAE,CAAC,KAAK,CAAC;IAC1D,2BAA2B,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC;IAC3C,4BAA4B,EAAE,CAAC,KAAK,CAAC;IACrC,yBAAyB,EAAE,CAAC,KAAK,CAAC;IAClC,8BAA8B,EAAE,CAAC,KAAK,CAAC;IACvC,wCAAwC,EAAE,CAAC,KAAK,CAAC;IACjD,wCAAwC,EAAE,CAAC,KAAK,CAAC;IACjD,2CAA2C,EAAE,CAAC,KAAK,CAAC;IACpD,+BAA+B,EAAE,CAAC,KAAK,CAAC;IACxC,8BAA8B,EAAE,CAAC,KAAK,CAAC;IACvC,6BAA6B,EAAE,CAAC,KAAK,CAAC;IACtC,2BAA2B,EAAE,CAAC,KAAK,CAAC;IACpC,0CAA0C,EAAE,CAAC,KAAK,CAAC;IACnD,6BAA6B,EAAE,CAAC,KAAK,CAAC;IACtC,iCAAiC,EAAE,CAAC,KAAK,CAAC;IAC1C,0CAA0C,EAAE,CAAC,KAAK,CAAC;IACnD,gDAAgD,EAAE,CAAC,KAAK,CAAC;CAC1D,CAAC;AA2GF,MAAM,UAAU,YAAY,CAC1B,QAuDwD;IA4BxD,MAAM,WAAW,GAAG,QAAQ,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAC1D,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,WAAW,aAAX,WAAW,cAAX,WAAW,GAAI,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACzD,MAAM,MAAM,GAAG,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC;IACvC,IAAI,WAAW,GAAG,WAAW,CAAC,GAAG,MAAM,IAAI,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC;IAC3D,IAAI,CAAC,WAAW,EAAE;QAChB,WAAW,GAAG,yBAAyB,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;KACvD;IACD,OAAO,CAAC,WAAW,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AAChD,CAAC;AAED,SAAS,yBAAyB,CAAC,IAAY;IAC7C,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAElC,0CAA0C;IAC1C,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE;QACtD,0DAA0D;QAC1D,gBAAgB;QAChB,MAAM,aAAa,GAAG,iBAAiB,CAAC,GAAG,CAAC,CAAC;QAC7C,gCAAgC;QAChC,MAAM,cAAc,GAAG,aAAa,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAEhD,wDAAwD;QACxD,wCAAwC;QACxC,IAAI,cAAc,CAAC,MAAM,KAAK,SAAS,CAAC,MAAM,IAAI,mBAAmB,CAAC,GAAG,CAAC,EAAE;YAC1E,6DAA6D;YAC7D,IAAI,KAAK,GAAG,IAAI,CAAC;YACjB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,cAAc,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;gBAC9C,IAAI,cAAc,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,cAAc,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;oBACxE,4DAA4D;oBAC5D,kDAAkD;oBAClD,oDAAoD;oBACpD,SAAS;iBACV;gBAED,8CAA8C;gBAC9C,wDAAwD;gBACxD,2CAA2C;gBAC3C,IAAI,cAAc,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE;oBACtC,KAAK,GAAG,KAAK,CAAC;oBACd,MAAM;iBACP;aACF;YAED,qDAAqD;YACrD,yDAAyD;YACzD,oBAAoB;YACpB,IAAI,KAAK,EAAE;gBACT,OAAO,KAAK,CAAC;aACd;SACF;KACF;IAED,6CAA6C;IAC7C,OAAO,EAAE,CAAC;AACZ,CAAC;AAED,SAAS,mBAAmB,CAAC,IAAY;IACvC,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AAC7B,CAAC;AAED,SAAS,iBAAiB,CAAC,MAAc;IACvC,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACtC,OAAO,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;AACjC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n AppComponentCreateOrUpdateAppComponents200Response,\n AppComponentCreateOrUpdateAppComponents201Response,\n AppComponentCreateOrUpdateAppComponentsdefaultResponse,\n AppComponentDeleteAppComponents204Response,\n AppComponentDeleteAppComponentsdefaultResponse,\n AppComponentGetAppComponentByName200Response,\n AppComponentGetAppComponentByNamedefaultResponse,\n AppComponentGetAppComponent200Response,\n AppComponentGetAppComponentdefaultResponse,\n ServerMetricsCreateOrUpdateServerMetricsConfig200Response,\n ServerMetricsCreateOrUpdateServerMetricsConfig201Response,\n ServerMetricsCreateOrUpdateServerMetricsConfigdefaultResponse,\n ServerMetricsGetServerMetricsConfigByName200Response,\n ServerMetricsGetServerMetricsConfigByNamedefaultResponse,\n ServerMetricsDeleteServerMetricsConfig204Response,\n ServerMetricsDeleteServerMetricsConfigdefaultResponse,\n ServerMetricsGetServerMetricsConfig200Response,\n ServerMetricsGetServerMetricsConfigdefaultResponse,\n ServerMetricsGetServerDefaultMetricsConfig200Response,\n ServerMetricsGetServerDefaultMetricsConfigdefaultResponse,\n ServerMetricsListSupportedResourceTypes200Response,\n ServerMetricsListSupportedResourceTypesdefaultResponse,\n TestCreateOrUpdateTest200Response,\n TestCreateOrUpdateTest201Response,\n TestCreateOrUpdateTestdefaultResponse,\n TestDeleteLoadTest204Response,\n TestDeleteLoadTestdefaultResponse,\n TestGetLoadTest200Response,\n TestGetLoadTestdefaultResponse,\n TestListLoadTestSearch200Response,\n TestListLoadTestSearchdefaultResponse,\n TestUploadTestFile201Response,\n TestUploadTestFiledefaultResponse,\n TestGetTestFile200Response,\n TestGetTestFiledefaultResponse,\n TestDeleteTestFile204Response,\n TestDeleteTestFiledefaultResponse,\n TestListTestFiles200Response,\n TestListTestFilesdefaultResponse,\n TestRunDeleteTestRun204Response,\n TestRunDeleteTestRundefaultResponse,\n TestRunCreateOrUpdateTestRun200Response,\n TestRunCreateOrUpdateTestRundefaultResponse,\n TestRunGetTestRun200Response,\n TestRunGetTestRundefaultResponse,\n TestRunGetTestRunFile200Response,\n TestRunGetTestRunFiledefaultResponse,\n TestRunListTestRuns200Response,\n TestRunListTestRunsdefaultResponse,\n TestRunStopTestRun200Response,\n TestRunStopTestRundefaultResponse,\n TestRunGetTestRunClientMetrics200Response,\n TestRunGetTestRunClientMetricsdefaultResponse,\n TestRunGetTestRunClientMetricsFilters200Response,\n TestRunGetTestRunClientMetricsFiltersdefaultResponse,\n} from \"./responses\";\n\nconst responseMap: Record<string, string[]> = {\n \"PATCH /appcomponents/{name}\": [\"200\", \"201\"],\n \"DELETE /appcomponents/{name}\": [\"204\"],\n \"GET /appcomponents/{name}\": [\"200\"],\n \"GET /appcomponents\": [\"200\"],\n \"PATCH /serverMetricsConfig/{name}\": [\"200\", \"201\"],\n \"GET /serverMetricsConfig/{name}\": [\"200\"],\n \"DELETE /serverMetricsConfig/{name}\": [\"204\"],\n \"GET /serverMetricsConfig\": [\"200\"],\n \"GET /serverMetricsConfig/default\": [\"200\"],\n \"GET /serverMetricsConfig/supportedResourceTypes\": [\"200\"],\n \"PATCH /loadtests/{testId}\": [\"200\", \"201\"],\n \"DELETE /loadtests/{testId}\": [\"204\"],\n \"GET /loadtests/{testId}\": [\"200\"],\n \"GET /loadtests/sortAndFilter\": [\"200\"],\n \"PUT /loadtests/{testId}/files/{fileId}\": [\"201\"],\n \"GET /loadtests/{testId}/files/{fileId}\": [\"200\"],\n \"DELETE /loadtests/{testId}/files/{fileId}\": [\"204\"],\n \"GET /loadtests/{testId}/files\": [\"200\"],\n \"DELETE /testruns/{testRunId}\": [\"204\"],\n \"PATCH /testruns/{testRunId}\": [\"200\"],\n \"GET /testruns/{testRunId}\": [\"200\"],\n \"GET /testruns/{testRunId}/files/{fileId}\": [\"200\"],\n \"GET /testruns/sortAndFilter\": [\"200\"],\n \"POST /testruns/{testRunId}:stop\": [\"200\"],\n \"POST /testruns/{testRunId}/clientMetrics\": [\"200\"],\n \"GET /testruns/{testRunId}/clientMetricsFilters\": [\"200\"],\n};\n\nexport function isUnexpected(\n response:\n | AppComponentCreateOrUpdateAppComponents200Response\n | AppComponentCreateOrUpdateAppComponents201Response\n | AppComponentCreateOrUpdateAppComponentsdefaultResponse\n): response is AppComponentCreateOrUpdateAppComponentsdefaultResponse;\nexport function isUnexpected(\n response:\n | AppComponentDeleteAppComponents204Response\n | AppComponentDeleteAppComponentsdefaultResponse\n): response is AppComponentDeleteAppComponentsdefaultResponse;\nexport function isUnexpected(\n response:\n | AppComponentGetAppComponentByName200Response\n | AppComponentGetAppComponentByNamedefaultResponse\n): response is AppComponentGetAppComponentByNamedefaultResponse;\nexport function isUnexpected(\n response: AppComponentGetAppComponent200Response | AppComponentGetAppComponentdefaultResponse\n): response is AppComponentGetAppComponentdefaultResponse;\nexport function isUnexpected(\n response:\n | ServerMetricsCreateOrUpdateServerMetricsConfig200Response\n | ServerMetricsCreateOrUpdateServerMetricsConfig201Response\n | ServerMetricsCreateOrUpdateServerMetricsConfigdefaultResponse\n): response is ServerMetricsCreateOrUpdateServerMetricsConfigdefaultResponse;\nexport function isUnexpected(\n response:\n | ServerMetricsGetServerMetricsConfigByName200Response\n | ServerMetricsGetServerMetricsConfigByNamedefaultResponse\n): response is ServerMetricsGetServerMetricsConfigByNamedefaultResponse;\nexport function isUnexpected(\n response:\n | ServerMetricsDeleteServerMetricsConfig204Response\n | ServerMetricsDeleteServerMetricsConfigdefaultResponse\n): response is ServerMetricsDeleteServerMetricsConfigdefaultResponse;\nexport function isUnexpected(\n response:\n | ServerMetricsGetServerMetricsConfig200Response\n | ServerMetricsGetServerMetricsConfigdefaultResponse\n): response is ServerMetricsGetServerMetricsConfigdefaultResponse;\nexport function isUnexpected(\n response:\n | ServerMetricsGetServerDefaultMetricsConfig200Response\n | ServerMetricsGetServerDefaultMetricsConfigdefaultResponse\n): response is ServerMetricsGetServerDefaultMetricsConfigdefaultResponse;\nexport function isUnexpected(\n response:\n | ServerMetricsListSupportedResourceTypes200Response\n | ServerMetricsListSupportedResourceTypesdefaultResponse\n): response is ServerMetricsListSupportedResourceTypesdefaultResponse;\nexport function isUnexpected(\n response:\n | TestCreateOrUpdateTest200Response\n | TestCreateOrUpdateTest201Response\n | TestCreateOrUpdateTestdefaultResponse\n): response is TestCreateOrUpdateTestdefaultResponse;\nexport function isUnexpected(\n response: TestDeleteLoadTest204Response | TestDeleteLoadTestdefaultResponse\n): response is TestDeleteLoadTestdefaultResponse;\nexport function isUnexpected(\n response: TestGetLoadTest200Response | TestGetLoadTestdefaultResponse\n): response is TestGetLoadTestdefaultResponse;\nexport function isUnexpected(\n response: TestListLoadTestSearch200Response | TestListLoadTestSearchdefaultResponse\n): response is TestListLoadTestSearchdefaultResponse;\nexport function isUnexpected(\n response: TestUploadTestFile201Response | TestUploadTestFiledefaultResponse\n): response is TestUploadTestFiledefaultResponse;\nexport function isUnexpected(\n response: TestGetTestFile200Response | TestGetTestFiledefaultResponse\n): response is TestGetTestFiledefaultResponse;\nexport function isUnexpected(\n response: TestDeleteTestFile204Response | TestDeleteTestFiledefaultResponse\n): response is TestDeleteTestFiledefaultResponse;\nexport function isUnexpected(\n response: TestListTestFiles200Response | TestListTestFilesdefaultResponse\n): response is TestListTestFilesdefaultResponse;\nexport function isUnexpected(\n response: TestRunDeleteTestRun204Response | TestRunDeleteTestRundefaultResponse\n): response is TestRunDeleteTestRundefaultResponse;\nexport function isUnexpected(\n response: TestRunCreateOrUpdateTestRun200Response | TestRunCreateOrUpdateTestRundefaultResponse\n): response is TestRunCreateOrUpdateTestRundefaultResponse;\nexport function isUnexpected(\n response: TestRunGetTestRun200Response | TestRunGetTestRundefaultResponse\n): response is TestRunGetTestRundefaultResponse;\nexport function isUnexpected(\n response: TestRunGetTestRunFile200Response | TestRunGetTestRunFiledefaultResponse\n): response is TestRunGetTestRunFiledefaultResponse;\nexport function isUnexpected(\n response: TestRunListTestRuns200Response | TestRunListTestRunsdefaultResponse\n): response is TestRunListTestRunsdefaultResponse;\nexport function isUnexpected(\n response: TestRunStopTestRun200Response | TestRunStopTestRundefaultResponse\n): response is TestRunStopTestRundefaultResponse;\nexport function isUnexpected(\n response:\n | TestRunGetTestRunClientMetrics200Response\n | TestRunGetTestRunClientMetricsdefaultResponse\n): response is TestRunGetTestRunClientMetricsdefaultResponse;\nexport function isUnexpected(\n response:\n | TestRunGetTestRunClientMetricsFilters200Response\n | TestRunGetTestRunClientMetricsFiltersdefaultResponse\n): response is TestRunGetTestRunClientMetricsFiltersdefaultResponse;\nexport function isUnexpected(\n response:\n | AppComponentCreateOrUpdateAppComponents200Response\n | AppComponentCreateOrUpdateAppComponents201Response\n | AppComponentCreateOrUpdateAppComponentsdefaultResponse\n | AppComponentDeleteAppComponents204Response\n | AppComponentDeleteAppComponentsdefaultResponse\n | AppComponentGetAppComponentByName200Response\n | AppComponentGetAppComponentByNamedefaultResponse\n | AppComponentGetAppComponent200Response\n | AppComponentGetAppComponentdefaultResponse\n | ServerMetricsCreateOrUpdateServerMetricsConfig200Response\n | ServerMetricsCreateOrUpdateServerMetricsConfig201Response\n | ServerMetricsCreateOrUpdateServerMetricsConfigdefaultResponse\n | ServerMetricsGetServerMetricsConfigByName200Response\n | ServerMetricsGetServerMetricsConfigByNamedefaultResponse\n | ServerMetricsDeleteServerMetricsConfig204Response\n | ServerMetricsDeleteServerMetricsConfigdefaultResponse\n | ServerMetricsGetServerMetricsConfig200Response\n | ServerMetricsGetServerMetricsConfigdefaultResponse\n | ServerMetricsGetServerDefaultMetricsConfig200Response\n | ServerMetricsGetServerDefaultMetricsConfigdefaultResponse\n | ServerMetricsListSupportedResourceTypes200Response\n | ServerMetricsListSupportedResourceTypesdefaultResponse\n | TestCreateOrUpdateTest200Response\n | TestCreateOrUpdateTest201Response\n | TestCreateOrUpdateTestdefaultResponse\n | TestDeleteLoadTest204Response\n | TestDeleteLoadTestdefaultResponse\n | TestGetLoadTest200Response\n | TestGetLoadTestdefaultResponse\n | TestListLoadTestSearch200Response\n | TestListLoadTestSearchdefaultResponse\n | TestUploadTestFile201Response\n | TestUploadTestFiledefaultResponse\n | TestGetTestFile200Response\n | TestGetTestFiledefaultResponse\n | TestDeleteTestFile204Response\n | TestDeleteTestFiledefaultResponse\n | TestListTestFiles200Response\n | TestListTestFilesdefaultResponse\n | TestRunDeleteTestRun204Response\n | TestRunDeleteTestRundefaultResponse\n | TestRunCreateOrUpdateTestRun200Response\n | TestRunCreateOrUpdateTestRundefaultResponse\n | TestRunGetTestRun200Response\n | TestRunGetTestRundefaultResponse\n | TestRunGetTestRunFile200Response\n | TestRunGetTestRunFiledefaultResponse\n | TestRunListTestRuns200Response\n | TestRunListTestRunsdefaultResponse\n | TestRunStopTestRun200Response\n | TestRunStopTestRundefaultResponse\n | TestRunGetTestRunClientMetrics200Response\n | TestRunGetTestRunClientMetricsdefaultResponse\n | TestRunGetTestRunClientMetricsFilters200Response\n | TestRunGetTestRunClientMetricsFiltersdefaultResponse\n): response is\n | AppComponentCreateOrUpdateAppComponentsdefaultResponse\n | AppComponentDeleteAppComponentsdefaultResponse\n | AppComponentGetAppComponentByNamedefaultResponse\n | AppComponentGetAppComponentdefaultResponse\n | ServerMetricsCreateOrUpdateServerMetricsConfigdefaultResponse\n | ServerMetricsGetServerMetricsConfigByNamedefaultResponse\n | ServerMetricsDeleteServerMetricsConfigdefaultResponse\n | ServerMetricsGetServerMetricsConfigdefaultResponse\n | ServerMetricsGetServerDefaultMetricsConfigdefaultResponse\n | ServerMetricsListSupportedResourceTypesdefaultResponse\n | TestCreateOrUpdateTestdefaultResponse\n | TestDeleteLoadTestdefaultResponse\n | TestGetLoadTestdefaultResponse\n | TestListLoadTestSearchdefaultResponse\n | TestUploadTestFiledefaultResponse\n | TestGetTestFiledefaultResponse\n | TestDeleteTestFiledefaultResponse\n | TestListTestFilesdefaultResponse\n | TestRunDeleteTestRundefaultResponse\n | TestRunCreateOrUpdateTestRundefaultResponse\n | TestRunGetTestRundefaultResponse\n | TestRunGetTestRunFiledefaultResponse\n | TestRunListTestRunsdefaultResponse\n | TestRunStopTestRundefaultResponse\n | TestRunGetTestRunClientMetricsdefaultResponse\n | TestRunGetTestRunClientMetricsFiltersdefaultResponse {\n const lroOriginal = response.headers[\"x-ms-original-url\"];\n const url = new URL(lroOriginal ?? response.request.url);\n const method = response.request.method;\n let pathDetails = responseMap[`${method} ${url.pathname}`];\n if (!pathDetails) {\n pathDetails = geParametrizedPathSuccess(url.pathname);\n }\n return !pathDetails.includes(response.status);\n}\n\nfunction geParametrizedPathSuccess(path: string): string[] {\n const pathParts = path.split(\"/\");\n\n // Iterate the responseMap to find a match\n for (const [key, value] of Object.entries(responseMap)) {\n // Extracting the path from the map key which is in format\n // GET /path/foo\n const candidatePath = getPathFromMapKey(key);\n // Get each part of the url path\n const candidateParts = candidatePath.split(\"/\");\n\n // If the candidate and actual paths don't match in size\n // we move on to the next candidate path\n if (candidateParts.length === pathParts.length && hasParametrizedPath(key)) {\n // track if we have found a match to return the values found.\n let found = true;\n for (let i = 0; i < candidateParts.length; i++) {\n if (candidateParts[i].startsWith(\"{\") && candidateParts[i].endsWith(\"}\")) {\n // If the current part of the candidate is a \"template\" part\n // it is a match with the actual path part on hand\n // skip as the parameterized part can match anything\n continue;\n }\n\n // If the candidate part is not a template and\n // the parts don't match mark the candidate as not found\n // to move on with the next candidate path.\n if (candidateParts[i] !== pathParts[i]) {\n found = false;\n break;\n }\n }\n\n // We finished evaluating the current candidate parts\n // if all parts matched we return the success values form\n // the path mapping.\n if (found) {\n return value;\n }\n }\n }\n\n // No match was found, return an empty array.\n return [];\n}\n\nfunction hasParametrizedPath(path: string): boolean {\n return path.includes(\"/{\");\n}\n\nfunction getPathFromMapKey(mapKey: string): string {\n const pathStart = mapKey.indexOf(\"/\");\n return mapKey.slice(pathStart);\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"models.js","sourceRoot":"","sources":["../../src/models.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nexport interface AppComponentsMap {\n /** Azure Load Testing resource Id */\n resourceId?: string;\n /** [Required, if testRunId is not given] Load test unique identifier */\n testId?: string;\n /** [Required if testId is not given] Load test run unique identifier */\n testRunId?: string;\n /** AppComponent name */\n name?: string;\n /** AppComponents Map { resource id (Fully qualified resource Id e.g subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}) : resource object } */\n value: Record<string, AppComponent>;\n}\n\nexport interface AppComponent {\n /** Fully qualified resource Id e.g subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName} */\n resourceId: string;\n /** Azure resource name */\n resourceName: string;\n /** Azure resource type */\n resourceType: string;\n /** Azure resource display name */\n displayName?: string;\n /** Resource group name of the Azure resource */\n resourceGroup?: string;\n /** Subscription Id of the Azure resource */\n subscriptionId?: string;\n /** Kind of Azure resource type */\n kind?: string;\n}\n\nexport interface ServerMetricsModel {\n /** Server metrics config name. */\n name?: string;\n /** [Required, if testRunId is not given] Load test unique identifier */\n testId?: string;\n /** [Required, if testId is not given] Load test run unique identifier */\n testRunId?: string;\n /** Metrics map {metric id : metrics object} (Refer : https://docs.microsoft.com/en-us/rest/api/monitor/metric-definitions/list#metricdefinition for metric id). */\n metrics?: Record<string, ResourceMetricModel>;\n}\n\nexport interface ResourceMetricModel {\n /** Unique identifier for metric. */\n id?: string;\n /** Azure resource Id. */\n resourceId: string;\n /** Metric name space. */\n metricnamespace: string;\n /** Metric description. */\n displayDescription?: string;\n /** Metric name object. */\n name: ServerMetricName;\n /** Metric aggregation. */\n aggregation: string;\n /** Metric unit. */\n unit?: string;\n /** Azure resource type. */\n resourceType: string;\n}\n\nexport interface ServerMetricName {\n /** Metric name value. */\n value: string;\n /** Metric localized name. */\n localizedValue: string;\n}\n\nexport interface TestModel {\n /** Unique test name as identifier. */\n testId?: string;\n /** The test description. */\n description?: string;\n /** Display name of a test. */\n displayName?: string;\n /** Fully qualified resource Id e.g /subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. */\n resourceId?: string;\n /** The load test configuration. */\n loadTestConfig?: LoadTestConfig;\n /** Pass fail criteria for a test. */\n passFailCriteria?: PassFailCriteria;\n /** The created DateTime(ISO 8601 literal format) of the test model. */\n createdDateTime?: Date | string;\n /** The user that created the test model. */\n createdBy?: string;\n /** The last Modified DateTime(ISO 8601 literal format) of the test model. */\n lastModifiedDateTime?: Date | string;\n /** The user that last modified the test model. */\n lastModifiedBy?: string;\n /** The input artifacts for the test. */\n inputArtifacts?: InputTestArtifacts;\n /** Secrets can be stored in an Azure Key Vault or any other secret store. If the secret is stored in an Azure Key Vault, the value should be the secret identifier and the type should be AKV_SECRET_URI. If the secret is stored elsewhere, the secret value should be provided directly and the type should be SECRET_VALUE. */\n secrets?: Record<string, SecretMetadata>;\n /** Environment variables which are defined as a set of <name,value> pairs. */\n environmentVariables?: Record<string, string>;\n /** Subnet ID on which the load test instances should run. */\n subnetId?: string;\n /** Type of the managed identity referencing the Key vault. */\n keyvaultReferenceIdentityType?: string;\n /** Resource Id of the managed identity referencing the Key vault. */\n keyvaultReferenceIdentityId?: string;\n}\n\nexport interface LoadTestConfig {\n /** The number of engine instances to execute load test. Supported values are in range of 1-45. Required for creating a new test. */\n engineInstances?: number;\n /** Whether all the input CSV files should be split evenly across all engines. */\n splitAllCSVs?: boolean;\n}\n\nexport interface PassFailCriteria {\n /** Map of id and pass fail metrics { id : pass fail metrics }. */\n passFailMetrics?: Record<string, PassFailMetric>;\n}\n\nexport interface PassFailMetric {\n /** The client metric on which the criteria should be applied. Allowed values - ‘response_time_ms’ , ‘latency’, ‘error’, ‘requests’, ‘requests_per_sec’. */\n clientmetric?: string;\n /** The aggregation function to be applied on the client metric. Allowed functions - ‘percentage’ - for error metric ,‘avg’, ‘p50’, ‘p90’, ‘p95’, ‘p99’, ‘min’, ‘max’ - for response_time_ms and latency metric, ‘avg’ - for requests_per_sec, ‘count’ - for requests. */\n aggregate?: string;\n /** The comparison operator. Supported types ‘>’ */\n condition?: string;\n /** Request name for which the Pass fail criteria has to be applied. */\n requestName?: string;\n /** The value to compare with the client metric. Allowed values - ‘error : [0.0 , 100.0] unit- % ’, response_time_ms and latency : any integer value unit- ms. */\n value?: number;\n /** Either ‘stop’ or ‘continue’ after the threshold is met. Default is ‘continue’. */\n action?: string;\n /** The actual value of the client metric for the test run. */\n actualValue?: number;\n /** Outcome of the test run. possible outcome - ‘passed’ , ‘failed’ , ‘undetermined’. */\n result?: string;\n}\n\nexport interface InputTestArtifacts {\n /** FileUrl Model. */\n configUrl?: FileUrl;\n /** FileUrl Model. */\n testScriptUrl?: FileUrl;\n /** FileUrl Model. */\n userPropUrl?: FileUrl;\n /** FileUrl Model. */\n inputArtifactsZipFileurl?: FileUrl;\n /** The input artifacts file { name : url } map for the test run. */\n additionalUrls?: Array<FileUrl>;\n}\n\nexport interface FileUrl {\n /** File URL. */\n url?: string;\n /** File unique identifier. */\n fileId?: string;\n /** Name of the file. */\n filename?: string;\n /** Integer representation of the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS) */\n fileType?: \"0\" | \"1\" | \"2\";\n /** Expiry time of the file */\n expireTime?: Date | string;\n /** Validation status of the file */\n validationStatus?: string;\n}\n\nexport interface SecretMetadata {\n /** The value of the secret, of type AKV_SECRET_URI or SECRET_VALUE */\n value?: string;\n /** Type of secret. eg. AKV_SECRET_URI/SECRET_VALUE */\n type?: string;\n}\n\nexport interface TestRunModel {\n /** Unique test run name as identifier. */\n testRunId?: string;\n /** Display name of a test run. */\n displayName?: string;\n /** Associated test Id. */\n testId?: string;\n /** Load test resource Id. */\n resourceId?: string;\n /** The test run description. */\n description?: string;\n /** The test run status. */\n status?: string;\n /** The test run start DateTime(ISO 8601 literal format). */\n startDateTime?: Date | string;\n /** The test run end DateTime(ISO 8601 literal format). */\n endDateTime?: Date | string;\n /** The load test configuration. */\n loadTestConfig?: LoadTestConfig;\n /** Test result for pass/Fail criteria used during the test run. possible outcome - ‘Passed’ , ‘Failed’ , ‘Not Applicable’. */\n testResult?: string;\n /** Pass fail criteria for a test. */\n passFailCriteria?: PassFailCriteria;\n testArtifacts?: TestArtifacts;\n /** Test run initiated time */\n executedDateTime?: Date | string;\n /** Number of virtual users, for which test has been run. */\n vusers?: number;\n /** Test run statistics */\n testRunStatistics?: Record<string, TestRunStatisticsModel>;\n /** The created DateTime(ISO 8601 literal format) of the test run. */\n createdDateTime?: Date | string;\n /** The user that created the test run. */\n createdBy?: string;\n /** The last updated DateTime(ISO 8601 literal format) of the test run. */\n lastModifiedDateTime?: Date | string;\n /** The user that updated the test run. */\n lastModifiedBy?: string;\n /** Portal url. */\n portalUrl?: string;\n /** Secrets can be stored in an Azure Key Vault or any other secret store. If the secret is stored in an Azure Key Vault, the value should be the secret identifier and the type should be AKV_SECRET_URI. If the secret is stored elsewhere, the secret value should be provided directly and the type should be SECRET_VALUE. */\n secrets?: Record<string, SecretMetadata>;\n /** Environment variables which are defined as a set of <name,value> pairs. */\n environmentVariables?: Record<string, string>;\n /** Test run duration in milliseconds. */\n duration?: number;\n /** Subnet ID on which the load test instances should run. */\n subnetId?: string;\n}\n\nexport interface TestArtifacts {\n /** The input artifacts for the test. */\n inputArtifacts: InputTestArtifacts;\n /** The output artifacts for the test run. */\n outputArtifacts?: OutputTestArtifacts;\n}\n\nexport interface OutputTestArtifacts {\n /** FileUrl Model. */\n resultUrl?: FileUrl;\n /** FileUrl Model. */\n logsUrl?: FileUrl;\n}\n\nexport interface TestRunStatisticsModel {\n /** Transaction name. */\n transaction?: string;\n /** Sampler count. */\n sampleCount?: number;\n /** Error count. */\n errorCount?: number;\n /** Error percentage. */\n errorPct?: number;\n /** Mean response time. */\n meanResTime?: number;\n /** Median response time. */\n medianResTime?: number;\n /** Max response time. */\n maxResTime?: number;\n /** Minimum response time. */\n minResTime?: number;\n /** 90 percentile response time. */\n pct1ResTime?: number;\n /** 95 percentile response time. */\n pct2ResTime?: number;\n /** 99 percentile response time. */\n pct3ResTime?: number;\n /** Throughput. */\n throughput?: number;\n /** Received network bytes. */\n receivedKBytesPerSec?: number;\n /** Sent network bytes. */\n sentKBytesPerSec?: number;\n}\n\nexport interface ClientMetricsRequestModel {\n /** List of request samplers, maximum supported samplers for queries are 20. In case of empty, it will return metrics for maximum 20 samplers */\n requestSamplers?: Array<string>;\n /** List of errors, maximum supported errors for queries are 20. In case of empty, by default will return metrics for maximum 20 errors */\n errors?: Array<string>;\n /** List of percentiles values for response time, supported values 50,90,99,95. Default value is 50th percentile. */\n percentiles?: Array<string>;\n /** For test duration less than 10 minutes group by time interval can be any one of 5s,10s,1m,5m.\\n\\nFor test duration greater than 10 minutes, group by time interval can be any one of 1m,5m,1h. Default value is 1m. */\n groupByInterval?: string;\n /** Start time */\n startTime: Date | string;\n /** End time */\n endTime: Date | string;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"outputModels.js","sourceRoot":"","sources":["../../src/outputModels.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nexport interface AppComponentsMapOutput {\n /** Azure Load Testing resource Id */\n resourceId?: string;\n /** [Required, if testRunId is not given] Load test unique identifier */\n testId?: string;\n /** [Required if testId is not given] Load test run unique identifier */\n testRunId?: string;\n /** AppComponent name */\n name?: string;\n /** AppComponents Map { resource id (Fully qualified resource Id e.g subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}) : resource object } */\n value: Record<string, AppComponentOutput>;\n}\n\nexport interface AppComponentOutput {\n /** Fully qualified resource Id e.g subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName} */\n resourceId: string;\n /** Azure resource name */\n resourceName: string;\n /** Azure resource type */\n resourceType: string;\n /** Azure resource display name */\n displayName?: string;\n /** Resource group name of the Azure resource */\n resourceGroup?: string;\n /** Subscription Id of the Azure resource */\n subscriptionId?: string;\n /** Kind of Azure resource type */\n kind?: string;\n}\n\nexport interface ErrorResponseBodyOutput {\n /** Error from a REST request. */\n error?: ErrorModelOutput;\n}\n\nexport interface ErrorModelOutput {\n /** The error code. */\n code?: string;\n /** The error message. */\n message?: string;\n /** The error target. */\n target?: string;\n /** Additional details and inner errors. */\n details?: Array<ErrorModelOutput>;\n}\n\nexport interface ServerMetricsModelOutput {\n /** Server metrics config name. */\n name?: string;\n /** [Required, if testRunId is not given] Load test unique identifier */\n testId?: string;\n /** [Required, if testId is not given] Load test run unique identifier */\n testRunId?: string;\n /** Metrics map {metric id : metrics object} (Refer : https://docs.microsoft.com/en-us/rest/api/monitor/metric-definitions/list#metricdefinition for metric id). */\n metrics?: Record<string, ResourceMetricModelOutput>;\n}\n\nexport interface ResourceMetricModelOutput {\n /** Unique identifier for metric. */\n id?: string;\n /** Azure resource Id. */\n resourceId: string;\n /** Metric name space. */\n metricnamespace: string;\n /** Metric description. */\n displayDescription?: string;\n /** Metric name object. */\n name: ServerMetricNameOutput;\n /** Metric aggregation. */\n aggregation: string;\n /** Metric unit. */\n unit?: string;\n /** Azure resource type. */\n resourceType: string;\n}\n\nexport interface ServerMetricNameOutput {\n /** Metric name value. */\n value: string;\n /** Metric localized name. */\n localizedValue: string;\n}\n\nexport interface DefaultServerMetricsConfigListModelOutput {\n /** Default metrics map {resourceType : list of metrics config} (Refer for metrics structure: https://docs.microsoft.com/en-us/rest/api/monitor/metric-definitions/list#metricdefinition) */\n defaultMetrics?: Record<string, Array<DefaultServerMetricsConfigModelOutput>>;\n}\n\nexport interface DefaultServerMetricsConfigModelOutput {\n metricnamespace?: string;\n aggregation?: string;\n name?: LocalizedNameOutput;\n unit?: string;\n displayDescription?: string;\n}\n\nexport interface LocalizedNameOutput {\n value?: string;\n localizedValue?: string;\n}\n\nexport interface SupportedResourceTypeOutput {\n value?: Array<string>;\n}\n\nexport interface TestModelOutput {\n /** Unique test name as identifier. */\n testId?: string;\n /** The test description. */\n description?: string;\n /** Display name of a test. */\n displayName?: string;\n /** Fully qualified resource Id e.g /subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. */\n resourceId?: string;\n /** The load test configuration. */\n loadTestConfig?: LoadTestConfigOutput;\n /** Pass fail criteria for a test. */\n passFailCriteria?: PassFailCriteriaOutput;\n /** The created DateTime(ISO 8601 literal format) of the test model. */\n createdDateTime?: string;\n /** The user that created the test model. */\n createdBy?: string;\n /** The last Modified DateTime(ISO 8601 literal format) of the test model. */\n lastModifiedDateTime?: string;\n /** The user that last modified the test model. */\n lastModifiedBy?: string;\n /** The input artifacts for the test. */\n inputArtifacts?: InputTestArtifactsOutput;\n /** Secrets can be stored in an Azure Key Vault or any other secret store. If the secret is stored in an Azure Key Vault, the value should be the secret identifier and the type should be AKV_SECRET_URI. If the secret is stored elsewhere, the secret value should be provided directly and the type should be SECRET_VALUE. */\n secrets?: Record<string, SecretMetadataOutput>;\n /** Environment variables which are defined as a set of <name,value> pairs. */\n environmentVariables?: Record<string, string>;\n /** Subnet ID on which the load test instances should run. */\n subnetId?: string;\n /** Type of the managed identity referencing the Key vault. */\n keyvaultReferenceIdentityType?: string;\n /** Resource Id of the managed identity referencing the Key vault. */\n keyvaultReferenceIdentityId?: string;\n}\n\nexport interface LoadTestConfigOutput {\n /** The number of engine instances to execute load test. Supported values are in range of 1-45. Required for creating a new test. */\n engineInstances?: number;\n /** Whether all the input CSV files should be split evenly across all engines. */\n splitAllCSVs?: boolean;\n}\n\nexport interface PassFailCriteriaOutput {\n /** Map of id and pass fail metrics { id : pass fail metrics }. */\n passFailMetrics?: Record<string, PassFailMetricOutput>;\n}\n\nexport interface PassFailMetricOutput {\n /** The client metric on which the criteria should be applied. Allowed values - ‘response_time_ms’ , ‘latency’, ‘error’, ‘requests’, ‘requests_per_sec’. */\n clientmetric?: string;\n /** The aggregation function to be applied on the client metric. Allowed functions - ‘percentage’ - for error metric ,‘avg’, ‘p50’, ‘p90’, ‘p95’, ‘p99’, ‘min’, ‘max’ - for response_time_ms and latency metric, ‘avg’ - for requests_per_sec, ‘count’ - for requests. */\n aggregate?: string;\n /** The comparison operator. Supported types ‘>’ */\n condition?: string;\n /** Request name for which the Pass fail criteria has to be applied. */\n requestName?: string;\n /** The value to compare with the client metric. Allowed values - ‘error : [0.0 , 100.0] unit- % ’, response_time_ms and latency : any integer value unit- ms. */\n value?: number;\n /** Either ‘stop’ or ‘continue’ after the threshold is met. Default is ‘continue’. */\n action?: string;\n /** The actual value of the client metric for the test run. */\n actualValue?: number;\n /** Outcome of the test run. possible outcome - ‘passed’ , ‘failed’ , ‘undetermined’. */\n result?: string;\n}\n\nexport interface InputTestArtifactsOutput {\n /** FileUrl Model. */\n configUrl?: FileUrlOutput;\n /** FileUrl Model. */\n testScriptUrl?: FileUrlOutput;\n /** FileUrl Model. */\n userPropUrl?: FileUrlOutput;\n /** FileUrl Model. */\n inputArtifactsZipFileurl?: FileUrlOutput;\n /** The input artifacts file { name : url } map for the test run. */\n additionalUrls?: Array<FileUrlOutput>;\n}\n\nexport interface FileUrlOutput {\n /** File URL. */\n url?: string;\n /** File unique identifier. */\n fileId?: string;\n /** Name of the file. */\n filename?: string;\n /** Integer representation of the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS) */\n fileType?: \"0\" | \"1\" | \"2\";\n /** Expiry time of the file */\n expireTime?: string;\n /** Validation status of the file */\n validationStatus?: string;\n}\n\nexport interface SecretMetadataOutput {\n /** The value of the secret, of type AKV_SECRET_URI or SECRET_VALUE */\n value?: string;\n /** Type of secret. eg. AKV_SECRET_URI/SECRET_VALUE */\n type?: string;\n}\n\nexport interface TestModelResourceListOutput {\n /** List of Resources */\n value: Array<TestModelOutput>;\n /** Link for the next list of resources in case of paginated results, if applicable */\n nextLink?: string;\n}\n\nexport interface FileUrlListOutput {\n /** List of file URLs. */\n value: Array<FileUrlOutput>;\n /** Link for the next list of file URLs, if applicable */\n nextLink?: string;\n}\n\nexport interface TestRunModelOutput {\n /** Unique test run name as identifier. */\n testRunId?: string;\n /** Display name of a test run. */\n displayName?: string;\n /** Associated test Id. */\n testId?: string;\n /** Load test resource Id. */\n resourceId?: string;\n /** The test run description. */\n description?: string;\n /** The test run status. */\n status?: string;\n /** The test run start DateTime(ISO 8601 literal format). */\n startDateTime?: string;\n /** The test run end DateTime(ISO 8601 literal format). */\n endDateTime?: string;\n /** The load test configuration. */\n loadTestConfig?: LoadTestConfigOutput;\n /** Test result for pass/Fail criteria used during the test run. possible outcome - ‘Passed’ , ‘Failed’ , ‘Not Applicable’. */\n testResult?: string;\n /** Pass fail criteria for a test. */\n passFailCriteria?: PassFailCriteriaOutput;\n testArtifacts?: TestArtifactsOutput;\n /** Test run initiated time */\n executedDateTime?: string;\n /** Number of virtual users, for which test has been run. */\n vusers?: number;\n /** Test run statistics */\n testRunStatistics?: Record<string, TestRunStatisticsModelOutput>;\n /** The created DateTime(ISO 8601 literal format) of the test run. */\n createdDateTime?: string;\n /** The user that created the test run. */\n createdBy?: string;\n /** The last updated DateTime(ISO 8601 literal format) of the test run. */\n lastModifiedDateTime?: string;\n /** The user that updated the test run. */\n lastModifiedBy?: string;\n /** Portal url. */\n portalUrl?: string;\n /** Secrets can be stored in an Azure Key Vault or any other secret store. If the secret is stored in an Azure Key Vault, the value should be the secret identifier and the type should be AKV_SECRET_URI. If the secret is stored elsewhere, the secret value should be provided directly and the type should be SECRET_VALUE. */\n secrets?: Record<string, SecretMetadataOutput>;\n /** Environment variables which are defined as a set of <name,value> pairs. */\n environmentVariables?: Record<string, string>;\n /** Test run duration in milliseconds. */\n duration?: number;\n /** Subnet ID on which the load test instances should run. */\n subnetId?: string;\n}\n\nexport interface TestArtifactsOutput {\n /** The input artifacts for the test. */\n inputArtifacts: InputTestArtifactsOutput;\n /** The output artifacts for the test run. */\n outputArtifacts?: OutputTestArtifactsOutput;\n}\n\nexport interface OutputTestArtifactsOutput {\n /** FileUrl Model. */\n resultUrl?: FileUrlOutput;\n /** FileUrl Model. */\n logsUrl?: FileUrlOutput;\n}\n\nexport interface TestRunStatisticsModelOutput {\n /** Transaction name. */\n transaction?: string;\n /** Sampler count. */\n sampleCount?: number;\n /** Error count. */\n errorCount?: number;\n /** Error percentage. */\n errorPct?: number;\n /** Mean response time. */\n meanResTime?: number;\n /** Median response time. */\n medianResTime?: number;\n /** Max response time. */\n maxResTime?: number;\n /** Minimum response time. */\n minResTime?: number;\n /** 90 percentile response time. */\n pct1ResTime?: number;\n /** 95 percentile response time. */\n pct2ResTime?: number;\n /** 99 percentile response time. */\n pct3ResTime?: number;\n /** Throughput. */\n throughput?: number;\n /** Received network bytes. */\n receivedKBytesPerSec?: number;\n /** Sent network bytes. */\n sentKBytesPerSec?: number;\n}\n\nexport interface TestRunModelResourceListOutput {\n /** List of Resources */\n value: Array<TestRunModelOutput>;\n /** Link for the next list of resources in case of paginated results, if applicable */\n nextLink?: string;\n}\n\nexport interface ClientMetricsResultsOutput {\n /** Test run name for which client metrics results is required. */\n testRunId?: string;\n timeSeries?: SeriesOutput;\n}\n\nexport interface SeriesOutput {\n /** Active users time series data. */\n activeUsers?: Record<string, Array<TimeSeriesOutput>>;\n /** Response time, time series data. */\n responseTime?: Record<string, Array<TimeSeriesOutput>>;\n /** Throughput time series data. */\n throughput?: Record<string, Array<TimeSeriesOutput>>;\n /** Errors time series data. */\n errors?: Record<string, Array<TimeSeriesOutput>>;\n}\n\nexport interface TimeSeriesOutput {\n /** Timestamp(ISO 8601 literal format). */\n timestamp?: string;\n /** Value at timestamp. */\n value?: number;\n}\n\nexport interface ClientMetricsFiltersOutput {\n /** Test run name for which client metrics filters is required. */\n testRunId?: string;\n filters?: FiltersOutput;\n timeRange?: TimeRangeOutput;\n}\n\nexport interface FiltersOutput {\n /** List of request sampler for the test run, for which client metrics can be filtered. */\n requestSamplerValues?: Array<string>;\n /** List of errors occurred for the test run, for which client metrics can be filtered. */\n errorFiltersValues?: Array<string>;\n}\n\nexport interface TimeRangeOutput {\n /** start DateTime(ISO 8601 literal format) for the requested client metrics filter. */\n startTime?: string;\n /** end DateTime(ISO 8601 literal format) for the requested client metrics filter. */\n endTime?: string;\n}\n"]}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT license.
|
|
3
|
+
import { getPagedAsyncIterator } from "@azure/core-paging";
|
|
4
|
+
import { createRestError } from "@azure-rest/core-client";
|
|
5
|
+
/**
|
|
6
|
+
* Helper to paginate results from an initial response that follows the specification of Autorest `x-ms-pageable` extension
|
|
7
|
+
* @param client - Client to use for sending the next page requests
|
|
8
|
+
* @param initialResponse - Initial response containing the nextLink and current page of elements
|
|
9
|
+
* @param customGetPage - Optional - Function to define how to extract the page and next link to be used to paginate the results
|
|
10
|
+
* @returns - PagedAsyncIterableIterator to iterate the elements
|
|
11
|
+
*/
|
|
12
|
+
export function paginate(client, initialResponse, options = {}) {
|
|
13
|
+
let firstRun = true;
|
|
14
|
+
const itemName = "value";
|
|
15
|
+
const nextLinkName = "nextLink";
|
|
16
|
+
const { customGetPage } = options;
|
|
17
|
+
const pagedResult = {
|
|
18
|
+
firstPageLink: "",
|
|
19
|
+
getPage: typeof customGetPage === "function"
|
|
20
|
+
? customGetPage
|
|
21
|
+
: async (pageLink) => {
|
|
22
|
+
const result = firstRun ? initialResponse : await client.pathUnchecked(pageLink).get();
|
|
23
|
+
firstRun = false;
|
|
24
|
+
checkPagingRequest(result);
|
|
25
|
+
const nextLink = getNextLink(result.body, nextLinkName);
|
|
26
|
+
const values = getElements(result.body, itemName);
|
|
27
|
+
return {
|
|
28
|
+
page: values,
|
|
29
|
+
nextPageLink: nextLink,
|
|
30
|
+
};
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
return getPagedAsyncIterator(pagedResult);
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Gets for the value of nextLink in the body
|
|
37
|
+
*/
|
|
38
|
+
function getNextLink(body, nextLinkName) {
|
|
39
|
+
if (!nextLinkName) {
|
|
40
|
+
return undefined;
|
|
41
|
+
}
|
|
42
|
+
const nextLink = body[nextLinkName];
|
|
43
|
+
if (typeof nextLink !== "string" && typeof nextLink !== "undefined") {
|
|
44
|
+
throw new Error(`Body Property ${nextLinkName} should be a string or undefined`);
|
|
45
|
+
}
|
|
46
|
+
return nextLink;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Gets the elements of the current request in the body.
|
|
50
|
+
*/
|
|
51
|
+
function getElements(body, itemName) {
|
|
52
|
+
const value = body[itemName];
|
|
53
|
+
// value has to be an array according to the x-ms-pageable extension.
|
|
54
|
+
// The fact that this must be an array is used above to calculate the
|
|
55
|
+
// type of elements in the page in PaginateReturn
|
|
56
|
+
if (!Array.isArray(value)) {
|
|
57
|
+
throw new Error(`Couldn't paginate response\n Body doesn't contain an array property with name: ${itemName}`);
|
|
58
|
+
}
|
|
59
|
+
return value !== null && value !== void 0 ? value : [];
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Checks if a request failed
|
|
63
|
+
*/
|
|
64
|
+
function checkPagingRequest(response) {
|
|
65
|
+
const Http2xxStatusCodes = ["200", "201", "202", "203", "204", "205", "206", "207", "208", "226"];
|
|
66
|
+
if (!Http2xxStatusCodes.includes(response.status)) {
|
|
67
|
+
throw createRestError(`Pagination failed with unexpected statusCode ${response.status}`, response);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=paginateHelper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paginateHelper.js","sourceRoot":"","sources":["../../src/paginateHelper.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,qBAAqB,EAA2C,MAAM,oBAAoB,CAAC;AACpG,OAAO,EAAU,eAAe,EAAyB,MAAM,yBAAyB,CAAC;AAyCzF;;;;;;GAMG;AACH,MAAM,UAAU,QAAQ,CACtB,MAAc,EACd,eAA0B,EAC1B,UAAoC,EAAE;IAItC,IAAI,QAAQ,GAAG,IAAI,CAAC;IACpB,MAAM,QAAQ,GAAG,OAAO,CAAC;IACzB,MAAM,YAAY,GAAG,UAAU,CAAC;IAChC,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC;IAClC,MAAM,WAAW,GAA4B;QAC3C,aAAa,EAAE,EAAE;QACjB,OAAO,EACL,OAAO,aAAa,KAAK,UAAU;YACjC,CAAC,CAAC,aAAa;YACf,CAAC,CAAC,KAAK,EAAE,QAAgB,EAAE,EAAE;gBACzB,MAAM,MAAM,GAAG,QAAQ,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,MAAM,MAAM,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,GAAG,EAAE,CAAC;gBACvF,QAAQ,GAAG,KAAK,CAAC;gBACjB,kBAAkB,CAAC,MAAM,CAAC,CAAC;gBAC3B,MAAM,QAAQ,GAAG,WAAW,CAAC,MAAM,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;gBACxD,MAAM,MAAM,GAAG,WAAW,CAAW,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;gBAC5D,OAAO;oBACL,IAAI,EAAE,MAAM;oBACZ,YAAY,EAAE,QAAQ;iBACvB,CAAC;YACJ,CAAC;KACR,CAAC;IAEF,OAAO,qBAAqB,CAAC,WAAW,CAAC,CAAC;AAC5C,CAAC;AAED;;GAEG;AACH,SAAS,WAAW,CAAC,IAAa,EAAE,YAAqB;IACvD,IAAI,CAAC,YAAY,EAAE;QACjB,OAAO,SAAS,CAAC;KAClB;IAED,MAAM,QAAQ,GAAI,IAAgC,CAAC,YAAY,CAAC,CAAC;IAEjE,IAAI,OAAO,QAAQ,KAAK,QAAQ,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE;QACnE,MAAM,IAAI,KAAK,CAAC,iBAAiB,YAAY,kCAAkC,CAAC,CAAC;KAClF;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;GAEG;AACH,SAAS,WAAW,CAAc,IAAa,EAAE,QAAgB;IAC/D,MAAM,KAAK,GAAI,IAAgC,CAAC,QAAQ,CAAQ,CAAC;IAEjE,qEAAqE;IACrE,qEAAqE;IACrE,iDAAiD;IACjD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;QACzB,MAAM,IAAI,KAAK,CACb,kFAAkF,QAAQ,EAAE,CAC7F,CAAC;KACH;IAED,OAAO,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,EAAE,CAAC;AACrB,CAAC;AAED;;GAEG;AACH,SAAS,kBAAkB,CAAC,QAA+B;IACzD,MAAM,kBAAkB,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;IAClG,IAAI,CAAC,kBAAkB,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;QACjD,MAAM,eAAe,CACnB,gDAAgD,QAAQ,CAAC,MAAM,EAAE,EACjE,QAAQ,CACT,CAAC;KACH;AACH,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { getPagedAsyncIterator, PagedAsyncIterableIterator, PagedResult } from \"@azure/core-paging\";\nimport { Client, createRestError, PathUncheckedResponse } from \"@azure-rest/core-client\";\n\n/**\n * Helper type to extract the type of an array\n */\nexport type GetArrayType<T> = T extends Array<infer TData> ? TData : never;\n\n/**\n * The type of a custom function that defines how to get a page and a link to the next one if any.\n */\nexport type GetPage<TPage> = (\n pageLink: string,\n maxPageSize?: number\n) => Promise<{\n page: TPage;\n nextPageLink?: string;\n}>;\n\n/**\n * Options for the paging helper\n */\nexport interface PagingOptions<TResponse> {\n /**\n * Custom function to extract pagination details for crating the PagedAsyncIterableIterator\n */\n customGetPage?: GetPage<PaginateReturn<TResponse>[]>;\n}\n\n/**\n * Helper type to infer the Type of the paged elements from the response type\n * This type is generated based on the swagger information for x-ms-pageable\n * specifically on the itemName property which indicates the property of the response\n * where the page items are found. The default value is `value`.\n * This type will allow us to provide strongly typed Iterator based on the response we get as second parameter\n */\nexport type PaginateReturn<TResult> = TResult extends {\n body: { value?: infer TPage };\n}\n ? GetArrayType<TPage>\n : Array<unknown>;\n\n/**\n * Helper to paginate results from an initial response that follows the specification of Autorest `x-ms-pageable` extension\n * @param client - Client to use for sending the next page requests\n * @param initialResponse - Initial response containing the nextLink and current page of elements\n * @param customGetPage - Optional - Function to define how to extract the page and next link to be used to paginate the results\n * @returns - PagedAsyncIterableIterator to iterate the elements\n */\nexport function paginate<TResponse extends PathUncheckedResponse>(\n client: Client,\n initialResponse: TResponse,\n options: PagingOptions<TResponse> = {}\n): PagedAsyncIterableIterator<PaginateReturn<TResponse>> {\n // Extract element type from initial response\n type TElement = PaginateReturn<TResponse>;\n let firstRun = true;\n const itemName = \"value\";\n const nextLinkName = \"nextLink\";\n const { customGetPage } = options;\n const pagedResult: PagedResult<TElement[]> = {\n firstPageLink: \"\",\n getPage:\n typeof customGetPage === \"function\"\n ? customGetPage\n : async (pageLink: string) => {\n const result = firstRun ? initialResponse : await client.pathUnchecked(pageLink).get();\n firstRun = false;\n checkPagingRequest(result);\n const nextLink = getNextLink(result.body, nextLinkName);\n const values = getElements<TElement>(result.body, itemName);\n return {\n page: values,\n nextPageLink: nextLink,\n };\n },\n };\n\n return getPagedAsyncIterator(pagedResult);\n}\n\n/**\n * Gets for the value of nextLink in the body\n */\nfunction getNextLink(body: unknown, nextLinkName?: string): string | undefined {\n if (!nextLinkName) {\n return undefined;\n }\n\n const nextLink = (body as Record<string, unknown>)[nextLinkName];\n\n if (typeof nextLink !== \"string\" && typeof nextLink !== \"undefined\") {\n throw new Error(`Body Property ${nextLinkName} should be a string or undefined`);\n }\n\n return nextLink;\n}\n\n/**\n * Gets the elements of the current request in the body.\n */\nfunction getElements<T = unknown>(body: unknown, itemName: string): T[] {\n const value = (body as Record<string, unknown>)[itemName] as T[];\n\n // value has to be an array according to the x-ms-pageable extension.\n // The fact that this must be an array is used above to calculate the\n // type of elements in the page in PaginateReturn\n if (!Array.isArray(value)) {\n throw new Error(\n `Couldn't paginate response\\n Body doesn't contain an array property with name: ${itemName}`\n );\n }\n\n return value ?? [];\n}\n\n/**\n * Checks if a request failed\n */\nfunction checkPagingRequest(response: PathUncheckedResponse): void {\n const Http2xxStatusCodes = [\"200\", \"201\", \"202\", \"203\", \"204\", \"205\", \"206\", \"207\", \"208\", \"226\"];\n if (!Http2xxStatusCodes.includes(response.status)) {\n throw createRestError(\n `Pagination failed with unexpected statusCode ${response.status}`,\n response\n );\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parameters.js","sourceRoot":"","sources":["../../src/parameters.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { RequestParameters } from \"@azure-rest/core-client\";\nimport {\n AppComponentsMap,\n ServerMetricsModel,\n TestModel,\n TestRunModel,\n ClientMetricsRequestModel,\n} from \"./models\";\n\nexport interface AppComponentCreateOrUpdateAppComponentsBodyParam {\n /** App Component model. */\n body: AppComponentsMap;\n}\n\nexport interface AppComponentCreateOrUpdateAppComponentsMediaTypesParam {\n /** Request content type */\n contentType?: \"application/merge-patch+json\";\n}\n\nexport type AppComponentCreateOrUpdateAppComponentsParameters = AppComponentCreateOrUpdateAppComponentsMediaTypesParam &\n AppComponentCreateOrUpdateAppComponentsBodyParam &\n RequestParameters;\nexport type AppComponentDeleteAppComponentsParameters = RequestParameters;\nexport type AppComponentGetAppComponentByNameParameters = RequestParameters;\n\nexport interface AppComponentGetAppComponentQueryParamProperties {\n /** [Required, if testId is not provided] Test run Id. */\n testRunId?: string;\n /** Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. */\n testId?: string;\n}\n\nexport interface AppComponentGetAppComponentQueryParam {\n queryParameters?: AppComponentGetAppComponentQueryParamProperties;\n}\n\nexport type AppComponentGetAppComponentParameters = AppComponentGetAppComponentQueryParam &\n RequestParameters;\n\nexport interface ServerMetricsCreateOrUpdateServerMetricsConfigBodyParam {\n /** Server metrics configuration model */\n body: ServerMetricsModel;\n}\n\nexport interface ServerMetricsCreateOrUpdateServerMetricsConfigMediaTypesParam {\n /** Request content type */\n contentType?: \"application/merge-patch+json\";\n}\n\nexport type ServerMetricsCreateOrUpdateServerMetricsConfigParameters = ServerMetricsCreateOrUpdateServerMetricsConfigMediaTypesParam &\n ServerMetricsCreateOrUpdateServerMetricsConfigBodyParam &\n RequestParameters;\nexport type ServerMetricsGetServerMetricsConfigByNameParameters = RequestParameters;\nexport type ServerMetricsDeleteServerMetricsConfigParameters = RequestParameters;\n\nexport interface ServerMetricsGetServerMetricsConfigQueryParamProperties {\n /** [Required, if testId is not provided] Test run Id. */\n testRunId?: string;\n /** Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. */\n testId?: string;\n}\n\nexport interface ServerMetricsGetServerMetricsConfigQueryParam {\n queryParameters?: ServerMetricsGetServerMetricsConfigQueryParamProperties;\n}\n\nexport type ServerMetricsGetServerMetricsConfigParameters = ServerMetricsGetServerMetricsConfigQueryParam &\n RequestParameters;\nexport type ServerMetricsGetServerDefaultMetricsConfigParameters = RequestParameters;\nexport type ServerMetricsListSupportedResourceTypesParameters = RequestParameters;\n\nexport interface TestCreateOrUpdateTestBodyParam {\n /** Load test model */\n body: TestModel;\n}\n\nexport interface TestCreateOrUpdateTestMediaTypesParam {\n /** Request content type */\n contentType?: \"application/merge-patch+json\";\n}\n\nexport type TestCreateOrUpdateTestParameters = TestCreateOrUpdateTestMediaTypesParam &\n TestCreateOrUpdateTestBodyParam &\n RequestParameters;\nexport type TestDeleteLoadTestParameters = RequestParameters;\nexport type TestGetLoadTestParameters = RequestParameters;\n\nexport interface TestListLoadTestSearchQueryParamProperties {\n /** Sort on one of the field - lastModifiedDateTime, displayName, createdBy in (field asc/desc) format. eg: displayName asc. */\n orderBy?: string;\n /** Filter search based on searchable fields - testId, createdBy. */\n search?: string;\n /** Start DateTime(ISO 8601 literal format) of the last updated time range to filter tests. */\n lastUpdatedStartTime?: Date | string;\n /** End DateTime(ISO 8601 literal format) of the last updated time range to filter tests. */\n lastUpdatedEndTime?: Date | string;\n /** Continuation token to get the next page of response. */\n continuationToken?: string;\n /** Number of results in response. */\n maxPageSize?: number;\n}\n\nexport interface TestListLoadTestSearchQueryParam {\n queryParameters?: TestListLoadTestSearchQueryParamProperties;\n}\n\nexport type TestListLoadTestSearchParameters = TestListLoadTestSearchQueryParam & RequestParameters;\n\nexport interface TestUploadTestFileBodyParam {\n body: TestUploadTestFileFormBody;\n}\n\nexport interface TestUploadTestFileFormBody {\n /**\n * The file to be uploaded.\n *\n * Value may contain any sequence of octets\n */\n file: string | Uint8Array | ReadableStream<Uint8Array> | NodeJS.ReadableStream;\n}\n\nexport interface TestUploadTestFileQueryParamProperties {\n /** Integer representation of the file type (0 = JMX_FILE, 1 = USER_PROPERTIES, 2 = ADDITIONAL_ARTIFACTS). */\n fileType?: number;\n}\n\nexport interface TestUploadTestFileQueryParam {\n queryParameters?: TestUploadTestFileQueryParamProperties;\n}\n\nexport interface TestUploadTestFileMediaTypesParam {\n /** Request content type */\n contentType?: \"multipart/form-data\";\n}\n\nexport type TestUploadTestFileParameters = TestUploadTestFileQueryParam &\n TestUploadTestFileMediaTypesParam &\n TestUploadTestFileBodyParam &\n RequestParameters;\nexport type TestGetTestFileParameters = RequestParameters;\nexport type TestDeleteTestFileParameters = RequestParameters;\n\nexport interface TestListTestFilesQueryParamProperties {\n /** Continuation token to get the next page of response. */\n continuationToken?: string;\n}\n\nexport interface TestListTestFilesQueryParam {\n queryParameters?: TestListTestFilesQueryParamProperties;\n}\n\nexport type TestListTestFilesParameters = TestListTestFilesQueryParam & RequestParameters;\nexport type TestRunDeleteTestRunParameters = RequestParameters;\n\nexport interface TestRunCreateOrUpdateTestRunBodyParam {\n /** Load test run model */\n body: TestRunModel;\n}\n\nexport interface TestRunCreateOrUpdateTestRunQueryParamProperties {\n /** Existing test run Id that should be rerun. */\n oldTestRunId?: string;\n}\n\nexport interface TestRunCreateOrUpdateTestRunQueryParam {\n queryParameters?: TestRunCreateOrUpdateTestRunQueryParamProperties;\n}\n\nexport interface TestRunCreateOrUpdateTestRunMediaTypesParam {\n /** Request content type */\n contentType?: \"application/merge-patch+json\";\n}\n\nexport type TestRunCreateOrUpdateTestRunParameters = TestRunCreateOrUpdateTestRunQueryParam &\n TestRunCreateOrUpdateTestRunMediaTypesParam &\n TestRunCreateOrUpdateTestRunBodyParam &\n RequestParameters;\nexport type TestRunGetTestRunParameters = RequestParameters;\nexport type TestRunGetTestRunFileParameters = RequestParameters;\n\nexport interface TestRunListTestRunsQueryParamProperties {\n /** Sort on one of the field - status, displayName, executedDateTime in (field asc/desc) format. eg: displayName asc. */\n orderBy?: string;\n /** Continuation token to get the next page of response. */\n continuationToken?: string;\n /** Filter search based on searchable fields - description, executedUser. */\n search?: string;\n /** The end DateTime(ISO 8601 literal format) of test-run execution time filter range. */\n executionFrom?: Date | string;\n /** The start DateTime(ISO 8601 literal format) of test-run execution time filter range. */\n executionTo?: Date | string;\n /**\n * Comma separated list of test run status, value can be - \"ACCEPTED\", \"NOTSTARTED\",\"PROVISIONING\",\"PROVISIONED\",\"CONFIGURING\",\n * \"CONFIGURED\",\"EXECUTING\",\"EXECUTED\",\"DEPROVISIONING\",\"DEPROVISIONED\",\"DONE\",\"CANCELLED\",\"FAILED\".\n */\n status?: string;\n /** Number of results in response. */\n maxPageSize?: number;\n /** Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. */\n testId?: string;\n}\n\nexport interface TestRunListTestRunsQueryParam {\n queryParameters?: TestRunListTestRunsQueryParamProperties;\n}\n\nexport type TestRunListTestRunsParameters = TestRunListTestRunsQueryParam & RequestParameters;\nexport type TestRunStopTestRunParameters = RequestParameters;\n\nexport interface TestRunGetTestRunClientMetricsBodyParam {\n /** Client metrics request model */\n body: ClientMetricsRequestModel;\n}\n\nexport interface TestRunGetTestRunClientMetricsMediaTypesParam {\n /** Request content type */\n contentType?: \"application/json\";\n}\n\nexport type TestRunGetTestRunClientMetricsParameters = TestRunGetTestRunClientMetricsMediaTypesParam &\n TestRunGetTestRunClientMetricsBodyParam &\n RequestParameters;\nexport type TestRunGetTestRunClientMetricsFiltersParameters = RequestParameters;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"responses.js","sourceRoot":"","sources":["../../src/responses.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { RawHttpHeaders } from \"@azure/core-rest-pipeline\";\nimport { HttpResponse } from \"@azure-rest/core-client\";\nimport {\n AppComponentsMapOutput,\n ErrorResponseBodyOutput,\n ServerMetricsModelOutput,\n DefaultServerMetricsConfigListModelOutput,\n SupportedResourceTypeOutput,\n TestModelOutput,\n TestModelResourceListOutput,\n FileUrlOutput,\n FileUrlListOutput,\n TestRunModelOutput,\n TestRunModelResourceListOutput,\n ClientMetricsResultsOutput,\n ClientMetricsFiltersOutput,\n} from \"./outputModels\";\n\n/** Associate an App Component (Azure resource) to a test or test run. */\nexport interface AppComponentCreateOrUpdateAppComponents200Response extends HttpResponse {\n status: \"200\";\n body: AppComponentsMapOutput;\n}\n\n/** Associate an App Component (Azure resource) to a test or test run. */\nexport interface AppComponentCreateOrUpdateAppComponents201Response extends HttpResponse {\n status: \"201\";\n body: AppComponentsMapOutput;\n}\n\nexport interface AppComponentCreateOrUpdateAppComponentsdefaultHeaders {\n /** The error code for specific error that occurred. */\n \"x-ms-error-code\"?: string;\n}\n\n/** Associate an App Component (Azure resource) to a test or test run. */\nexport interface AppComponentCreateOrUpdateAppComponentsdefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponseBodyOutput;\n headers: RawHttpHeaders & AppComponentCreateOrUpdateAppComponentsdefaultHeaders;\n}\n\n/** Delete an App Component. */\nexport interface AppComponentDeleteAppComponents204Response extends HttpResponse {\n status: \"204\";\n body: Record<string, unknown>;\n}\n\nexport interface AppComponentDeleteAppComponentsdefaultHeaders {\n /** The error code for specific error that occurred. */\n \"x-ms-error-code\"?: string;\n}\n\n/** Delete an App Component. */\nexport interface AppComponentDeleteAppComponentsdefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponseBodyOutput;\n headers: RawHttpHeaders & AppComponentDeleteAppComponentsdefaultHeaders;\n}\n\n/** Get App Component details by App Component name. */\nexport interface AppComponentGetAppComponentByName200Response extends HttpResponse {\n status: \"200\";\n body: AppComponentsMapOutput;\n}\n\nexport interface AppComponentGetAppComponentByNamedefaultHeaders {\n /** The error code for specific error that occurred. */\n \"x-ms-error-code\"?: string;\n}\n\n/** Get App Component details by App Component name. */\nexport interface AppComponentGetAppComponentByNamedefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponseBodyOutput;\n headers: RawHttpHeaders & AppComponentGetAppComponentByNamedefaultHeaders;\n}\n\n/** Get App Components for a test or a test run by its name. */\nexport interface AppComponentGetAppComponent200Response extends HttpResponse {\n status: \"200\";\n body: AppComponentsMapOutput;\n}\n\nexport interface AppComponentGetAppComponentdefaultHeaders {\n /** The error code for specific error that occurred. */\n \"x-ms-error-code\"?: string;\n}\n\n/** Get App Components for a test or a test run by its name. */\nexport interface AppComponentGetAppComponentdefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponseBodyOutput;\n headers: RawHttpHeaders & AppComponentGetAppComponentdefaultHeaders;\n}\n\n/** Configure server metrics for a test or test run */\nexport interface ServerMetricsCreateOrUpdateServerMetricsConfig200Response extends HttpResponse {\n status: \"200\";\n body: ServerMetricsModelOutput;\n}\n\n/** Configure server metrics for a test or test run */\nexport interface ServerMetricsCreateOrUpdateServerMetricsConfig201Response extends HttpResponse {\n status: \"201\";\n body: ServerMetricsModelOutput;\n}\n\nexport interface ServerMetricsCreateOrUpdateServerMetricsConfigdefaultHeaders {\n /** The error code for specific error that occurred. */\n \"x-ms-error-code\"?: string;\n}\n\n/** Configure server metrics for a test or test run */\nexport interface ServerMetricsCreateOrUpdateServerMetricsConfigdefaultResponse\n extends HttpResponse {\n status: string;\n body: ErrorResponseBodyOutput;\n headers: RawHttpHeaders & ServerMetricsCreateOrUpdateServerMetricsConfigdefaultHeaders;\n}\n\n/** Get server metrics configuration by its name. */\nexport interface ServerMetricsGetServerMetricsConfigByName200Response extends HttpResponse {\n status: \"200\";\n body: ServerMetricsModelOutput;\n}\n\nexport interface ServerMetricsGetServerMetricsConfigByNamedefaultHeaders {\n /** The error code for specific error that occurred. */\n \"x-ms-error-code\"?: string;\n}\n\n/** Get server metrics configuration by its name. */\nexport interface ServerMetricsGetServerMetricsConfigByNamedefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponseBodyOutput;\n headers: RawHttpHeaders & ServerMetricsGetServerMetricsConfigByNamedefaultHeaders;\n}\n\n/** Delete server metrics configuration by its name */\nexport interface ServerMetricsDeleteServerMetricsConfig204Response extends HttpResponse {\n status: \"204\";\n body: Record<string, unknown>;\n}\n\nexport interface ServerMetricsDeleteServerMetricsConfigdefaultHeaders {\n /** The error code for specific error that occurred. */\n \"x-ms-error-code\"?: string;\n}\n\n/** Delete server metrics configuration by its name */\nexport interface ServerMetricsDeleteServerMetricsConfigdefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponseBodyOutput;\n headers: RawHttpHeaders & ServerMetricsDeleteServerMetricsConfigdefaultHeaders;\n}\n\n/** Get server metrics configuration for a test or test run by its name. */\nexport interface ServerMetricsGetServerMetricsConfig200Response extends HttpResponse {\n status: \"200\";\n body: ServerMetricsModelOutput;\n}\n\nexport interface ServerMetricsGetServerMetricsConfigdefaultHeaders {\n /** The error code for specific error that occurred. */\n \"x-ms-error-code\"?: string;\n}\n\n/** Get server metrics configuration for a test or test run by its name. */\nexport interface ServerMetricsGetServerMetricsConfigdefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponseBodyOutput;\n headers: RawHttpHeaders & ServerMetricsGetServerMetricsConfigdefaultHeaders;\n}\n\n/** Get all default server metrics configuration for supported resource types. */\nexport interface ServerMetricsGetServerDefaultMetricsConfig200Response extends HttpResponse {\n status: \"200\";\n body: DefaultServerMetricsConfigListModelOutput;\n}\n\nexport interface ServerMetricsGetServerDefaultMetricsConfigdefaultHeaders {\n /** The error code for specific error that occurred. */\n \"x-ms-error-code\"?: string;\n}\n\n/** Get all default server metrics configuration for supported resource types. */\nexport interface ServerMetricsGetServerDefaultMetricsConfigdefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponseBodyOutput;\n headers: RawHttpHeaders & ServerMetricsGetServerDefaultMetricsConfigdefaultHeaders;\n}\n\n/** Get all supported resource types for App Components(Azure resource types). */\nexport interface ServerMetricsListSupportedResourceTypes200Response extends HttpResponse {\n status: \"200\";\n body: SupportedResourceTypeOutput;\n}\n\nexport interface ServerMetricsListSupportedResourceTypesdefaultHeaders {\n /** The error code for specific error that occurred. */\n \"x-ms-error-code\"?: string;\n}\n\n/** Get all supported resource types for App Components(Azure resource types). */\nexport interface ServerMetricsListSupportedResourceTypesdefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponseBodyOutput;\n headers: RawHttpHeaders & ServerMetricsListSupportedResourceTypesdefaultHeaders;\n}\n\n/** Create a new test or Update an existing test. */\nexport interface TestCreateOrUpdateTest200Response extends HttpResponse {\n status: \"200\";\n body: TestModelOutput;\n}\n\n/** Create a new test or Update an existing test. */\nexport interface TestCreateOrUpdateTest201Response extends HttpResponse {\n status: \"201\";\n body: TestModelOutput;\n}\n\nexport interface TestCreateOrUpdateTestdefaultHeaders {\n /** The error code for specific error that occurred. */\n \"x-ms-error-code\"?: string;\n}\n\n/** Create a new test or Update an existing test. */\nexport interface TestCreateOrUpdateTestdefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponseBodyOutput;\n headers: RawHttpHeaders & TestCreateOrUpdateTestdefaultHeaders;\n}\n\n/** Delete a test by its name. */\nexport interface TestDeleteLoadTest204Response extends HttpResponse {\n status: \"204\";\n body: Record<string, unknown>;\n}\n\nexport interface TestDeleteLoadTestdefaultHeaders {\n /** The error code for specific error that occurred. */\n \"x-ms-error-code\"?: string;\n}\n\n/** Delete a test by its name. */\nexport interface TestDeleteLoadTestdefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponseBodyOutput;\n headers: RawHttpHeaders & TestDeleteLoadTestdefaultHeaders;\n}\n\n/** Get load test details by test name */\nexport interface TestGetLoadTest200Response extends HttpResponse {\n status: \"200\";\n body: TestModelOutput;\n}\n\nexport interface TestGetLoadTestdefaultHeaders {\n /** The error code for specific error that occurred. */\n \"x-ms-error-code\"?: string;\n}\n\n/** Get load test details by test name */\nexport interface TestGetLoadTestdefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponseBodyOutput;\n headers: RawHttpHeaders & TestGetLoadTestdefaultHeaders;\n}\n\n/** Get all load tests by the fully qualified resource Id e.g subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. */\nexport interface TestListLoadTestSearch200Response extends HttpResponse {\n status: \"200\";\n body: TestModelResourceListOutput;\n}\n\nexport interface TestListLoadTestSearchdefaultHeaders {\n /** The error code for specific error that occurred. */\n \"x-ms-error-code\"?: string;\n}\n\n/** Get all load tests by the fully qualified resource Id e.g subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. */\nexport interface TestListLoadTestSearchdefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponseBodyOutput;\n headers: RawHttpHeaders & TestListLoadTestSearchdefaultHeaders;\n}\n\n/** Upload input file for a given test name. File size can't be more than 50 MB. Existing file with same name for the given test will be overwritten. File should be provided in the request body as multipart/form-data. */\nexport interface TestUploadTestFile201Response extends HttpResponse {\n status: \"201\";\n body: FileUrlOutput;\n}\n\nexport interface TestUploadTestFiledefaultHeaders {\n /** The error code for specific error that occurred. */\n \"x-ms-error-code\"?: string;\n}\n\n/** Upload input file for a given test name. File size can't be more than 50 MB. Existing file with same name for the given test will be overwritten. File should be provided in the request body as multipart/form-data. */\nexport interface TestUploadTestFiledefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponseBodyOutput;\n headers: RawHttpHeaders & TestUploadTestFiledefaultHeaders;\n}\n\n/** Get test file by the file name. */\nexport interface TestGetTestFile200Response extends HttpResponse {\n status: \"200\";\n body: FileUrlOutput;\n}\n\nexport interface TestGetTestFiledefaultHeaders {\n /** The error code for specific error that occurred. */\n \"x-ms-error-code\"?: string;\n}\n\n/** Get test file by the file name. */\nexport interface TestGetTestFiledefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponseBodyOutput;\n headers: RawHttpHeaders & TestGetTestFiledefaultHeaders;\n}\n\n/** Delete file by the file name for a test. */\nexport interface TestDeleteTestFile204Response extends HttpResponse {\n status: \"204\";\n body: Record<string, unknown>;\n}\n\nexport interface TestDeleteTestFiledefaultHeaders {\n /** The error code for specific error that occurred. */\n \"x-ms-error-code\"?: string;\n}\n\n/** Delete file by the file name for a test. */\nexport interface TestDeleteTestFiledefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponseBodyOutput;\n headers: RawHttpHeaders & TestDeleteTestFiledefaultHeaders;\n}\n\n/** Get all test files. */\nexport interface TestListTestFiles200Response extends HttpResponse {\n status: \"200\";\n body: FileUrlListOutput;\n}\n\nexport interface TestListTestFilesdefaultHeaders {\n /** The error code for specific error that occurred. */\n \"x-ms-error-code\"?: string;\n}\n\n/** Get all test files. */\nexport interface TestListTestFilesdefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponseBodyOutput;\n headers: RawHttpHeaders & TestListTestFilesdefaultHeaders;\n}\n\n/** Delete a test run by its name. */\nexport interface TestRunDeleteTestRun204Response extends HttpResponse {\n status: \"204\";\n body: Record<string, unknown>;\n}\n\nexport interface TestRunDeleteTestRundefaultHeaders {\n /** The error code for specific error that occurred. */\n \"x-ms-error-code\"?: string;\n}\n\n/** Delete a test run by its name. */\nexport interface TestRunDeleteTestRundefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponseBodyOutput;\n headers: RawHttpHeaders & TestRunDeleteTestRundefaultHeaders;\n}\n\n/** Create and start a new test run with the given name. */\nexport interface TestRunCreateOrUpdateTestRun200Response extends HttpResponse {\n status: \"200\";\n body: TestRunModelOutput;\n}\n\nexport interface TestRunCreateOrUpdateTestRundefaultHeaders {\n /** The error code for specific error that occurred. */\n \"x-ms-error-code\"?: string;\n}\n\n/** Create and start a new test run with the given name. */\nexport interface TestRunCreateOrUpdateTestRundefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponseBodyOutput;\n headers: RawHttpHeaders & TestRunCreateOrUpdateTestRundefaultHeaders;\n}\n\n/** Get test run details by name. */\nexport interface TestRunGetTestRun200Response extends HttpResponse {\n status: \"200\";\n body: TestRunModelOutput;\n}\n\nexport interface TestRunGetTestRundefaultHeaders {\n /** The error code for specific error that occurred. */\n \"x-ms-error-code\"?: string;\n}\n\n/** Get test run details by name. */\nexport interface TestRunGetTestRundefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponseBodyOutput;\n headers: RawHttpHeaders & TestRunGetTestRundefaultHeaders;\n}\n\n/** Get test run file by file name. */\nexport interface TestRunGetTestRunFile200Response extends HttpResponse {\n status: \"200\";\n body: FileUrlOutput;\n}\n\nexport interface TestRunGetTestRunFiledefaultHeaders {\n /** The error code for specific error that occurred. */\n \"x-ms-error-code\"?: string;\n}\n\n/** Get test run file by file name. */\nexport interface TestRunGetTestRunFiledefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponseBodyOutput;\n headers: RawHttpHeaders & TestRunGetTestRunFiledefaultHeaders;\n}\n\n/** Get all test runs with given filters */\nexport interface TestRunListTestRuns200Response extends HttpResponse {\n status: \"200\";\n body: TestRunModelResourceListOutput;\n}\n\nexport interface TestRunListTestRunsdefaultHeaders {\n /** The error code for specific error that occurred. */\n \"x-ms-error-code\"?: string;\n}\n\n/** Get all test runs with given filters */\nexport interface TestRunListTestRunsdefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponseBodyOutput;\n headers: RawHttpHeaders & TestRunListTestRunsdefaultHeaders;\n}\n\n/** Stop test run by name. */\nexport interface TestRunStopTestRun200Response extends HttpResponse {\n status: \"200\";\n body: TestRunModelOutput;\n}\n\nexport interface TestRunStopTestRundefaultHeaders {\n /** The error code for specific error that occurred. */\n \"x-ms-error-code\"?: string;\n}\n\n/** Stop test run by name. */\nexport interface TestRunStopTestRundefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponseBodyOutput;\n headers: RawHttpHeaders & TestRunStopTestRundefaultHeaders;\n}\n\n/** Get all client metrics for a load test run. */\nexport interface TestRunGetTestRunClientMetrics200Response extends HttpResponse {\n status: \"200\";\n body: ClientMetricsResultsOutput;\n}\n\nexport interface TestRunGetTestRunClientMetricsdefaultHeaders {\n /** The error code for specific error that occurred. */\n \"x-ms-error-code\"?: string;\n}\n\n/** Get all client metrics for a load test run. */\nexport interface TestRunGetTestRunClientMetricsdefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponseBodyOutput;\n headers: RawHttpHeaders & TestRunGetTestRunClientMetricsdefaultHeaders;\n}\n\n/** Get all filters that are supported for client metrics for a given load test run */\nexport interface TestRunGetTestRunClientMetricsFilters200Response extends HttpResponse {\n status: \"200\";\n body: ClientMetricsFiltersOutput;\n}\n\nexport interface TestRunGetTestRunClientMetricsFiltersdefaultHeaders {\n /** The error code for specific error that occurred. */\n \"x-ms-error-code\"?: string;\n}\n\n/** Get all filters that are supported for client metrics for a given load test run */\nexport interface TestRunGetTestRunClientMetricsFiltersdefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponseBodyOutput;\n headers: RawHttpHeaders & TestRunGetTestRunClientMetricsFiltersdefaultHeaders;\n}\n"]}
|
package/package.json
ADDED
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@azure-rest/load-testing",
|
|
3
|
+
"sdk-type": "client",
|
|
4
|
+
"author": "Microsoft Corporation",
|
|
5
|
+
"version": "1.0.0-alpha.20221020.2",
|
|
6
|
+
"description": "",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"node",
|
|
9
|
+
"azure",
|
|
10
|
+
"cloud",
|
|
11
|
+
"typescript",
|
|
12
|
+
"browser",
|
|
13
|
+
"isomorphic"
|
|
14
|
+
],
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"main": "dist/index.js",
|
|
17
|
+
"module": "./dist-esm/src/index.js",
|
|
18
|
+
"types": "./types/load-testing.d.ts",
|
|
19
|
+
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/loadtestservice/load-testing-rest/README.md",
|
|
20
|
+
"repository": "github:Azure/azure-sdk-for-js",
|
|
21
|
+
"bugs": {
|
|
22
|
+
"url": "https://github.com/Azure/azure-sdk-for-js/issues"
|
|
23
|
+
},
|
|
24
|
+
"files": [
|
|
25
|
+
"dist/",
|
|
26
|
+
"dist-esm/src/",
|
|
27
|
+
"types/load-testing.d.ts",
|
|
28
|
+
"README.md",
|
|
29
|
+
"LICENSE",
|
|
30
|
+
"review/*"
|
|
31
|
+
],
|
|
32
|
+
"//metadata": {
|
|
33
|
+
"constantPaths": [
|
|
34
|
+
{
|
|
35
|
+
"path": "swagger/README.md",
|
|
36
|
+
"prefix": "package-version"
|
|
37
|
+
}
|
|
38
|
+
]
|
|
39
|
+
},
|
|
40
|
+
"//sampleConfiguration": {
|
|
41
|
+
"productName": "Azure Load Testing rest",
|
|
42
|
+
"productSlugs": [
|
|
43
|
+
"azure"
|
|
44
|
+
],
|
|
45
|
+
"requiredResources": {
|
|
46
|
+
"Azure LoadTesting Service instance": "https://learn.microsoft.com/en-us/azure/load-testing/"
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"engines": {
|
|
50
|
+
"node": ">=12.0.0"
|
|
51
|
+
},
|
|
52
|
+
"scripts": {
|
|
53
|
+
"audit": "node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit",
|
|
54
|
+
"build:browser": "tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1",
|
|
55
|
+
"build:node": "tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1",
|
|
56
|
+
"build:samples": "echo skipped.",
|
|
57
|
+
"build:test": "tsc -p . && dev-tool run bundle",
|
|
58
|
+
"build:debug": "tsc -p . && dev-tool run bundle && api-extractor run --local",
|
|
59
|
+
"check-format": "prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"",
|
|
60
|
+
"clean": "rimraf dist dist-browser dist-esm test-dist temp types *.tgz *.log",
|
|
61
|
+
"execute:samples": "echo skipped",
|
|
62
|
+
"extract-api": "rimraf review && mkdirp ./review && api-extractor run --local",
|
|
63
|
+
"format": "prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"",
|
|
64
|
+
"generate:client": "autorest --typescript swagger/README.md && npm run format",
|
|
65
|
+
"integration-test:browser": "dev-tool run test:browser",
|
|
66
|
+
"integration-test:node": "dev-tool run test:node-js-input -- --timeout 5000000 'dist-esm/test/**/*.spec.js'",
|
|
67
|
+
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
|
|
68
|
+
"lint:fix": "eslint package.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]",
|
|
69
|
+
"lint": "eslint package.json api-extractor.json src test --ext .ts",
|
|
70
|
+
"pack": "npm pack 2>&1",
|
|
71
|
+
"test:browser": "npm run clean && npm run build:test && npm run unit-test:browser",
|
|
72
|
+
"test:node": "npm run clean && npm run build:test && npm run unit-test:node",
|
|
73
|
+
"test": "npm run clean && npm run build:test && npm run unit-test",
|
|
74
|
+
"unit-test": "npm run unit-test:node && npm run unit-test:browser",
|
|
75
|
+
"unit-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 --exclude 'test/**/browser/*.spec.ts' 'test/**/*.spec.ts'",
|
|
76
|
+
"unit-test:browser": "dev-tool run test:browser",
|
|
77
|
+
"build": "npm run clean && tsc -p . && dev-tool run bundle && mkdirp ./review && api-extractor run --local"
|
|
78
|
+
},
|
|
79
|
+
"sideEffects": false,
|
|
80
|
+
"autoPublish": false,
|
|
81
|
+
"dependencies": {
|
|
82
|
+
"@azure/core-auth": "^1.3.0",
|
|
83
|
+
"@azure-rest/core-client": "1.0.0-beta.10",
|
|
84
|
+
"@azure/core-rest-pipeline": "^1.8.0",
|
|
85
|
+
"@azure/logger": "^1.0.0",
|
|
86
|
+
"tslib": "^2.2.0",
|
|
87
|
+
"@azure/core-paging": "^1.2.0",
|
|
88
|
+
"@azure/core-util": "1.1.1"
|
|
89
|
+
},
|
|
90
|
+
"devDependencies": {
|
|
91
|
+
"@microsoft/api-extractor": "7.18.11",
|
|
92
|
+
"autorest": "latest",
|
|
93
|
+
"@types/node": "^12.0.0",
|
|
94
|
+
"dotenv": "^8.2.0",
|
|
95
|
+
"eslint": "^7.15.0",
|
|
96
|
+
"mkdirp": "^1.0.4",
|
|
97
|
+
"prettier": "2.2.1",
|
|
98
|
+
"process": "0.11.10",
|
|
99
|
+
"rimraf": "^3.0.0",
|
|
100
|
+
"source-map-support": "^0.5.9",
|
|
101
|
+
"typescript": "~4.2.0",
|
|
102
|
+
"@azure/dev-tool": ">=1.0.0-alpha <1.0.0-alphb",
|
|
103
|
+
"@azure/eslint-plugin-azure-sdk": ">=3.0.0-alpha <3.0.0-alphb",
|
|
104
|
+
"@azure-tools/test-credential": ">=1.0.0-alpha <1.0.0-alphb",
|
|
105
|
+
"@azure/identity": "^2.0.1",
|
|
106
|
+
"@azure-tools/test-recorder": "^2.0.0",
|
|
107
|
+
"mocha": "^7.1.1",
|
|
108
|
+
"mocha-junit-reporter": "^1.18.0",
|
|
109
|
+
"cross-env": "^7.0.2",
|
|
110
|
+
"@types/chai": "^4.2.8",
|
|
111
|
+
"chai": "^4.2.0",
|
|
112
|
+
"karma-chrome-launcher": "^3.0.0",
|
|
113
|
+
"karma-coverage": "^2.0.0",
|
|
114
|
+
"karma-edge-launcher": "^0.4.2",
|
|
115
|
+
"karma-env-preprocessor": "^0.1.1",
|
|
116
|
+
"karma-firefox-launcher": "^1.1.0",
|
|
117
|
+
"karma-ie-launcher": "^1.0.0",
|
|
118
|
+
"karma-junit-reporter": "^2.0.1",
|
|
119
|
+
"karma-mocha-reporter": "^2.2.5",
|
|
120
|
+
"karma-mocha": "^2.0.1",
|
|
121
|
+
"karma-source-map-support": "~1.4.0",
|
|
122
|
+
"karma-sourcemap-loader": "^0.3.8",
|
|
123
|
+
"karma": "^6.2.0",
|
|
124
|
+
"nyc": "^14.0.0",
|
|
125
|
+
"uuid": "^9.0.0",
|
|
126
|
+
"@types/uuid": "8.3.4"
|
|
127
|
+
},
|
|
128
|
+
"browser": {
|
|
129
|
+
"./dist-esm/test/public/utils/env.js": "./dist-esm/test/public/utils/env.browser.js"
|
|
130
|
+
}
|
|
131
|
+
}
|