@azure-rest/ai-anomaly-detector 1.0.0-beta.1 → 1.0.0-beta.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/CHANGELOG.md +15 -0
- package/LICENSE +4 -4
- package/README.md +272 -17
- package/dist/browser/anomalyDetectorRest.d.ts +13 -0
- package/dist/browser/anomalyDetectorRest.d.ts.map +1 -0
- package/{dist-esm/src → dist/browser}/anomalyDetectorRest.js +13 -8
- package/dist/browser/anomalyDetectorRest.js.map +1 -0
- package/dist/browser/clientDefinitions.d.ts +95 -0
- package/dist/browser/clientDefinitions.d.ts.map +1 -0
- package/dist/browser/clientDefinitions.js +4 -0
- package/dist/browser/clientDefinitions.js.map +1 -0
- package/dist/browser/index.d.ts +11 -0
- package/dist/browser/index.d.ts.map +1 -0
- package/dist/browser/index.js +13 -0
- package/dist/browser/index.js.map +1 -0
- package/dist/browser/isUnexpected.d.ts +12 -0
- package/dist/browser/isUnexpected.d.ts.map +1 -0
- package/{dist-esm/src → dist/browser}/isUnexpected.js +5 -6
- package/dist/browser/isUnexpected.js.map +1 -0
- package/dist/browser/models.d.ts +252 -0
- package/dist/browser/models.d.ts.map +1 -0
- package/dist/browser/models.js +4 -0
- package/{dist-esm/src → dist/browser}/models.js.map +1 -1
- package/dist/browser/outputModels.d.ts +367 -0
- package/dist/browser/outputModels.d.ts.map +1 -0
- package/dist/browser/outputModels.js +4 -0
- package/{dist-esm/src → dist/browser}/outputModels.js.map +1 -1
- package/dist/browser/package.json +3 -0
- package/dist/browser/paginateHelper.d.ts +47 -0
- package/dist/browser/paginateHelper.d.ts.map +1 -0
- package/{dist-esm/src → dist/browser}/paginateHelper.js +2 -2
- package/dist/browser/paginateHelper.js.map +1 -0
- package/dist/browser/parameters.d.ts +46 -0
- package/dist/browser/parameters.d.ts.map +1 -0
- package/dist/browser/parameters.js +4 -0
- package/dist/browser/parameters.js.map +1 -0
- package/dist/browser/responses.d.ts +155 -0
- package/dist/browser/responses.d.ts.map +1 -0
- package/dist/browser/responses.js +4 -0
- package/dist/browser/responses.js.map +1 -0
- package/dist/commonjs/anomalyDetectorRest.d.ts +13 -0
- package/dist/commonjs/anomalyDetectorRest.d.ts.map +1 -0
- package/dist/commonjs/anomalyDetectorRest.js +34 -0
- package/dist/commonjs/anomalyDetectorRest.js.map +1 -0
- package/dist/commonjs/clientDefinitions.d.ts +95 -0
- package/dist/commonjs/clientDefinitions.d.ts.map +1 -0
- package/dist/commonjs/clientDefinitions.js +5 -0
- package/dist/commonjs/clientDefinitions.js.map +1 -0
- package/dist/commonjs/index.d.ts +11 -0
- package/dist/commonjs/index.d.ts.map +1 -0
- package/dist/commonjs/index.js +16 -0
- package/dist/commonjs/index.js.map +1 -0
- package/dist/commonjs/isUnexpected.d.ts +12 -0
- package/dist/commonjs/isUnexpected.d.ts.map +1 -0
- package/dist/commonjs/isUnexpected.js +81 -0
- package/dist/commonjs/isUnexpected.js.map +1 -0
- package/dist/commonjs/models.d.ts +252 -0
- package/dist/commonjs/models.d.ts.map +1 -0
- package/dist/commonjs/models.js +5 -0
- package/dist/commonjs/models.js.map +1 -0
- package/dist/commonjs/outputModels.d.ts +367 -0
- package/dist/commonjs/outputModels.d.ts.map +1 -0
- package/dist/commonjs/outputModels.js +5 -0
- package/dist/commonjs/outputModels.js.map +1 -0
- package/dist/commonjs/package.json +3 -0
- package/dist/commonjs/paginateHelper.d.ts +47 -0
- package/dist/commonjs/paginateHelper.d.ts.map +1 -0
- package/dist/commonjs/paginateHelper.js +106 -0
- package/dist/commonjs/paginateHelper.js.map +1 -0
- package/dist/commonjs/parameters.d.ts +46 -0
- package/dist/commonjs/parameters.d.ts.map +1 -0
- package/dist/commonjs/parameters.js +5 -0
- package/dist/commonjs/parameters.js.map +1 -0
- package/dist/commonjs/responses.d.ts +155 -0
- package/dist/commonjs/responses.d.ts.map +1 -0
- package/dist/commonjs/responses.js +5 -0
- package/dist/commonjs/responses.js.map +1 -0
- package/dist/commonjs/tsdoc-metadata.json +11 -0
- package/dist/esm/anomalyDetectorRest.d.ts +13 -0
- package/dist/esm/anomalyDetectorRest.d.ts.map +1 -0
- package/dist/esm/anomalyDetectorRest.js +31 -0
- package/dist/esm/anomalyDetectorRest.js.map +1 -0
- package/dist/esm/clientDefinitions.d.ts +95 -0
- package/dist/esm/clientDefinitions.d.ts.map +1 -0
- package/dist/esm/clientDefinitions.js +4 -0
- package/dist/esm/clientDefinitions.js.map +1 -0
- package/dist/esm/index.d.ts +11 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +13 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/isUnexpected.d.ts +12 -0
- package/dist/esm/isUnexpected.d.ts.map +1 -0
- package/dist/esm/isUnexpected.js +78 -0
- package/dist/esm/isUnexpected.js.map +1 -0
- package/dist/esm/models.d.ts +252 -0
- package/dist/esm/models.d.ts.map +1 -0
- package/dist/esm/models.js +4 -0
- package/dist/esm/models.js.map +1 -0
- package/dist/esm/outputModels.d.ts +367 -0
- package/dist/esm/outputModels.d.ts.map +1 -0
- package/dist/esm/outputModels.js +4 -0
- package/dist/esm/outputModels.js.map +1 -0
- package/dist/esm/package.json +3 -0
- package/dist/esm/paginateHelper.d.ts +47 -0
- package/dist/esm/paginateHelper.d.ts.map +1 -0
- package/dist/esm/paginateHelper.js +103 -0
- package/dist/esm/paginateHelper.js.map +1 -0
- package/dist/esm/parameters.d.ts +46 -0
- package/dist/esm/parameters.d.ts.map +1 -0
- package/dist/esm/parameters.js +4 -0
- package/dist/esm/parameters.js.map +1 -0
- package/dist/esm/responses.d.ts +155 -0
- package/dist/esm/responses.d.ts.map +1 -0
- package/dist/esm/responses.js +4 -0
- package/dist/esm/responses.js.map +1 -0
- package/dist/react-native/anomalyDetectorRest.d.ts +13 -0
- package/dist/react-native/anomalyDetectorRest.d.ts.map +1 -0
- package/dist/react-native/anomalyDetectorRest.js +31 -0
- package/dist/react-native/anomalyDetectorRest.js.map +1 -0
- package/dist/react-native/clientDefinitions.d.ts +95 -0
- package/dist/react-native/clientDefinitions.d.ts.map +1 -0
- package/dist/react-native/clientDefinitions.js +4 -0
- package/dist/react-native/clientDefinitions.js.map +1 -0
- package/dist/react-native/index.d.ts +11 -0
- package/dist/react-native/index.d.ts.map +1 -0
- package/dist/react-native/index.js +13 -0
- package/dist/react-native/index.js.map +1 -0
- package/dist/react-native/isUnexpected.d.ts +12 -0
- package/dist/react-native/isUnexpected.d.ts.map +1 -0
- package/dist/react-native/isUnexpected.js +78 -0
- package/dist/react-native/isUnexpected.js.map +1 -0
- package/dist/react-native/models.d.ts +252 -0
- package/dist/react-native/models.d.ts.map +1 -0
- package/dist/react-native/models.js +4 -0
- package/dist/react-native/models.js.map +1 -0
- package/dist/react-native/outputModels.d.ts +367 -0
- package/dist/react-native/outputModels.d.ts.map +1 -0
- package/dist/react-native/outputModels.js +4 -0
- package/dist/react-native/outputModels.js.map +1 -0
- package/dist/react-native/package.json +3 -0
- package/dist/react-native/paginateHelper.d.ts +47 -0
- package/dist/react-native/paginateHelper.d.ts.map +1 -0
- package/dist/react-native/paginateHelper.js +103 -0
- package/dist/react-native/paginateHelper.js.map +1 -0
- package/dist/react-native/parameters.d.ts +46 -0
- package/dist/react-native/parameters.d.ts.map +1 -0
- package/dist/react-native/parameters.js +4 -0
- package/dist/react-native/parameters.js.map +1 -0
- package/dist/react-native/responses.d.ts +155 -0
- package/dist/react-native/responses.d.ts.map +1 -0
- package/dist/react-native/responses.js +4 -0
- package/dist/react-native/responses.js.map +1 -0
- package/package.json +86 -80
- package/review/{ai-anomaly-detector.api.md → ai-anomaly-detector-node.api.md} +9 -9
- package/dist/index.js +0 -216
- package/dist/index.js.map +0 -1
- package/dist-esm/src/anomalyDetectorRest.js.map +0 -1
- package/dist-esm/src/clientDefinitions.js +0 -4
- package/dist-esm/src/clientDefinitions.js.map +0 -1
- package/dist-esm/src/index.js +0 -13
- package/dist-esm/src/index.js.map +0 -1
- package/dist-esm/src/isUnexpected.js.map +0 -1
- package/dist-esm/src/models.js +0 -4
- package/dist-esm/src/outputModels.js +0 -4
- package/dist-esm/src/paginateHelper.js.map +0 -1
- package/dist-esm/src/parameters.js +0 -4
- package/dist-esm/src/parameters.js.map +0 -1
- package/dist-esm/src/responses.js +0 -4
- package/dist-esm/src/responses.js.map +0 -1
- package/types/ai-anomaly-detector.d.ts +0 -1086
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
|
-
// Licensed under the MIT
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
3
|
const responseMap = {
|
|
4
4
|
"POST /timeseries/entire/detect": ["200"],
|
|
5
5
|
"POST /timeseries/last/detect": ["200"],
|
|
@@ -14,7 +14,7 @@ const responseMap = {
|
|
|
14
14
|
};
|
|
15
15
|
export function isUnexpected(response) {
|
|
16
16
|
const lroOriginal = response.headers["x-ms-original-url"];
|
|
17
|
-
const url = new URL(lroOriginal
|
|
17
|
+
const url = new URL(lroOriginal ?? response.request.url);
|
|
18
18
|
const method = response.request.method;
|
|
19
19
|
let pathDetails = responseMap[`${method} ${url.pathname}`];
|
|
20
20
|
if (!pathDetails) {
|
|
@@ -23,7 +23,6 @@ export function isUnexpected(response) {
|
|
|
23
23
|
return !pathDetails.includes(response.status);
|
|
24
24
|
}
|
|
25
25
|
function getParametrizedPathSuccess(method, path) {
|
|
26
|
-
var _a, _b, _c, _d;
|
|
27
26
|
const pathParts = path.split("/");
|
|
28
27
|
// Traverse list to match the longest candidate
|
|
29
28
|
// matchedLen: the length of candidate path
|
|
@@ -42,13 +41,13 @@ function getParametrizedPathSuccess(method, path) {
|
|
|
42
41
|
// track if we have found a match to return the values found.
|
|
43
42
|
let found = true;
|
|
44
43
|
for (let i = candidateParts.length - 1, j = pathParts.length - 1; i >= 1 && j >= 1; i--, j--) {
|
|
45
|
-
if (
|
|
46
|
-
const start = candidateParts[i].indexOf("}") + 1, end =
|
|
44
|
+
if (candidateParts[i]?.startsWith("{") && candidateParts[i]?.indexOf("}") !== -1) {
|
|
45
|
+
const start = candidateParts[i].indexOf("}") + 1, end = candidateParts[i]?.length;
|
|
47
46
|
// If the current part of the candidate is a "template" part
|
|
48
47
|
// Try to use the suffix of pattern to match the path
|
|
49
48
|
// {guid} ==> $
|
|
50
49
|
// {guid}:export ==> :export$
|
|
51
|
-
const isMatched = new RegExp(`${
|
|
50
|
+
const isMatched = new RegExp(`${candidateParts[i]?.slice(start, end)}`).test(pathParts[j] || "");
|
|
52
51
|
if (!isMatched) {
|
|
53
52
|
found = false;
|
|
54
53
|
break;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isUnexpected.js","sourceRoot":"","sources":["../../src/isUnexpected.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAyBlC,MAAM,WAAW,GAA6B;IAC5C,gCAAgC,EAAE,CAAC,KAAK,CAAC;IACzC,8BAA8B,EAAE,CAAC,KAAK,CAAC;IACvC,qCAAqC,EAAE,CAAC,KAAK,CAAC;IAC9C,2CAA2C,EAAE,CAAC,KAAK,CAAC;IACpD,2BAA2B,EAAE,CAAC,KAAK,CAAC;IACpC,0BAA0B,EAAE,CAAC,KAAK,CAAC;IACnC,uCAAuC,EAAE,CAAC,KAAK,CAAC;IAChD,oCAAoC,EAAE,CAAC,KAAK,CAAC;IAC7C,kDAAkD,EAAE,CAAC,KAAK,CAAC;IAC3D,iDAAiD,EAAE,CAAC,KAAK,CAAC;CAC3D,CAAC;AAoCF,MAAM,UAAU,YAAY,CAC1B,QAoBgD;IAYhD,MAAM,WAAW,GAAG,QAAQ,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAC1D,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,WAAW,IAAI,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACzD,MAAM,MAAM,GAAG,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC;IACvC,IAAI,WAAW,GAAG,WAAW,CAAC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O,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC;gBACjF,MAAM,KAAK,GAAG,cAAc,CAAC,CAAC,CAAE,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,EAC/C,GAAG,GAAG,cAAc,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC;gBAClC,4DAA4D;gBAC5D,qDAAqD;gBACrD,eAAe;gBACf,6BAA6B;gBAC7B,MAAM,SAAS,GAAG,IAAI,MAAM,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC,IAAI,CAC1E,SAAS,CAAC,CAAC,CAAC,IAAI,EAAE,CACnB,CAAC;gBAEF,IAAI,CAAC,SAAS,EAAE,CAAC;oBACf,KAAK,GAAG,KAAK,CAAC;oBACd,MAAM;gBACR,CAAC;gBACD,SAAS;YACX,CAAC;YAED,8CAA8C;YAC9C,wDAAwD;YACxD,2CAA2C;YAC3C,IAAI,cAAc,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;gBACvC,KAAK,GAAG,KAAK,CAAC;gBACd,MAAM;YACR,CAAC;QACH,CAAC;QAED,qDAAqD;QACrD,sEAAsE;QACtE,IAAI,KAAK,IAAI,aAAa,CAAC,MAAM,GAAG,UAAU,EAAE,CAAC;YAC/C,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC;YAClC,YAAY,GAAG,KAAK,CAAC;QACvB,CAAC;IACH,CAAC;IAED,OAAO,YAAY,CAAC;AACtB,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 type {\n DetectUnivariateEntireSeries200Response,\n DetectUnivariateEntireSeriesDefaultResponse,\n DetectUnivariateLastPoint200Response,\n DetectUnivariateLastPointDefaultResponse,\n DetectUnivariateChangePoint200Response,\n DetectUnivariateChangePointDefaultResponse,\n GetMultivariateBatchDetectionResult200Response,\n GetMultivariateBatchDetectionResultDefaultResponse,\n TrainMultivariateModel201Response,\n TrainMultivariateModelDefaultResponse,\n ListMultivariateModels200Response,\n ListMultivariateModelsDefaultResponse,\n DeleteMultivariateModel204Response,\n DeleteMultivariateModelDefaultResponse,\n GetMultivariateModel200Response,\n GetMultivariateModelDefaultResponse,\n DetectMultivariateBatchAnomaly202Response,\n DetectMultivariateBatchAnomalyDefaultResponse,\n DetectMultivariateLastAnomaly200Response,\n DetectMultivariateLastAnomalyDefaultResponse,\n} from \"./responses.js\";\n\nconst responseMap: Record<string, string[]> = {\n \"POST /timeseries/entire/detect\": [\"200\"],\n \"POST /timeseries/last/detect\": [\"200\"],\n \"POST /timeseries/changepoint/detect\": [\"200\"],\n \"GET /multivariate/detect-batch/{resultId}\": [\"200\"],\n \"POST /multivariate/models\": [\"201\"],\n \"GET /multivariate/models\": [\"200\"],\n \"DELETE /multivariate/models/{modelId}\": [\"204\"],\n \"GET /multivariate/models/{modelId}\": [\"200\"],\n \"POST /multivariate/models/{modelId}:detect-batch\": [\"202\"],\n \"POST /multivariate/models/{modelId}:detect-last\": [\"200\"],\n};\n\nexport function isUnexpected(\n response: DetectUnivariateEntireSeries200Response | DetectUnivariateEntireSeriesDefaultResponse,\n): response is DetectUnivariateEntireSeriesDefaultResponse;\nexport function isUnexpected(\n response: DetectUnivariateLastPoint200Response | DetectUnivariateLastPointDefaultResponse,\n): response is DetectUnivariateLastPointDefaultResponse;\nexport function isUnexpected(\n response: DetectUnivariateChangePoint200Response | DetectUnivariateChangePointDefaultResponse,\n): response is DetectUnivariateChangePointDefaultResponse;\nexport function isUnexpected(\n response:\n | GetMultivariateBatchDetectionResult200Response\n | GetMultivariateBatchDetectionResultDefaultResponse,\n): response is GetMultivariateBatchDetectionResultDefaultResponse;\nexport function isUnexpected(\n response: TrainMultivariateModel201Response | TrainMultivariateModelDefaultResponse,\n): response is TrainMultivariateModelDefaultResponse;\nexport function isUnexpected(\n response: ListMultivariateModels200Response | ListMultivariateModelsDefaultResponse,\n): response is ListMultivariateModelsDefaultResponse;\nexport function isUnexpected(\n response: DeleteMultivariateModel204Response | DeleteMultivariateModelDefaultResponse,\n): response is DeleteMultivariateModelDefaultResponse;\nexport function isUnexpected(\n response: GetMultivariateModel200Response | GetMultivariateModelDefaultResponse,\n): response is GetMultivariateModelDefaultResponse;\nexport function isUnexpected(\n response:\n | DetectMultivariateBatchAnomaly202Response\n | DetectMultivariateBatchAnomalyDefaultResponse,\n): response is DetectMultivariateBatchAnomalyDefaultResponse;\nexport function isUnexpected(\n response: DetectMultivariateLastAnomaly200Response | DetectMultivariateLastAnomalyDefaultResponse,\n): response is DetectMultivariateLastAnomalyDefaultResponse;\nexport function isUnexpected(\n response:\n | DetectUnivariateEntireSeries200Response\n | DetectUnivariateEntireSeriesDefaultResponse\n | DetectUnivariateLastPoint200Response\n | DetectUnivariateLastPointDefaultResponse\n | DetectUnivariateChangePoint200Response\n | DetectUnivariateChangePointDefaultResponse\n | GetMultivariateBatchDetectionResult200Response\n | GetMultivariateBatchDetectionResultDefaultResponse\n | TrainMultivariateModel201Response\n | TrainMultivariateModelDefaultResponse\n | ListMultivariateModels200Response\n | ListMultivariateModelsDefaultResponse\n | DeleteMultivariateModel204Response\n | DeleteMultivariateModelDefaultResponse\n | GetMultivariateModel200Response\n | GetMultivariateModelDefaultResponse\n | DetectMultivariateBatchAnomaly202Response\n | DetectMultivariateBatchAnomalyDefaultResponse\n | DetectMultivariateLastAnomaly200Response\n | DetectMultivariateLastAnomalyDefaultResponse,\n): response is\n | DetectUnivariateEntireSeriesDefaultResponse\n | DetectUnivariateLastPointDefaultResponse\n | DetectUnivariateChangePointDefaultResponse\n | GetMultivariateBatchDetectionResultDefaultResponse\n | TrainMultivariateModelDefaultResponse\n | ListMultivariateModelsDefaultResponse\n | DeleteMultivariateModelDefaultResponse\n | GetMultivariateModelDefaultResponse\n | DetectMultivariateBatchAnomalyDefaultResponse\n | DetectMultivariateLastAnomalyDefaultResponse {\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 = getParametrizedPathSuccess(method, url.pathname);\n }\n return !pathDetails.includes(response.status);\n}\n\nfunction getParametrizedPathSuccess(method: string, path: string): string[] {\n const pathParts = path.split(\"/\");\n\n // Traverse list to match the longest candidate\n // matchedLen: the length of candidate path\n // matchedValue: the matched status code array\n let matchedLen = -1,\n matchedValue: string[] = [];\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 if (!key.startsWith(method)) {\n continue;\n }\n const candidatePath = getPathFromMapKey(key);\n // Get each part of the url path\n const candidateParts = candidatePath.split(\"/\");\n\n // track if we have found a match to return the values found.\n let found = true;\n for (let i = candidateParts.length - 1, j = pathParts.length - 1; i >= 1 && j >= 1; i--, j--) {\n if (candidateParts[i]?.startsWith(\"{\") && candidateParts[i]?.indexOf(\"}\") !== -1) {\n const start = candidateParts[i]!.indexOf(\"}\") + 1,\n end = candidateParts[i]?.length;\n // If the current part of the candidate is a \"template\" part\n // Try to use the suffix of pattern to match the path\n // {guid} ==> $\n // {guid}:export ==> :export$\n const isMatched = new RegExp(`${candidateParts[i]?.slice(start, end)}`).test(\n pathParts[j] || \"\",\n );\n\n if (!isMatched) {\n found = false;\n break;\n }\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[j]) {\n found = false;\n break;\n }\n }\n\n // We finished evaluating the current candidate parts\n // Update the matched value if and only if we found the longer pattern\n if (found && candidatePath.length > matchedLen) {\n matchedLen = candidatePath.length;\n matchedValue = value;\n }\n }\n\n return matchedValue;\n}\n\nfunction getPathFromMapKey(mapKey: string): string {\n const pathStart = mapKey.indexOf(\"/\");\n return mapKey.slice(pathStart);\n}\n"]}
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
/** The request of entire or last anomaly detection. */
|
|
2
|
+
export interface UnivariateDetectionOptions {
|
|
3
|
+
/**
|
|
4
|
+
* Time series data points. Points should be sorted by timestamp in ascending
|
|
5
|
+
* order to match the anomaly detection result. If the data is not sorted
|
|
6
|
+
* correctly or there is duplicated timestamp, the API will not work. In such
|
|
7
|
+
* case, an error message will be returned.
|
|
8
|
+
*/
|
|
9
|
+
series: Array<TimeSeriesPoint>;
|
|
10
|
+
/**
|
|
11
|
+
* Optional argument, can be one of yearly, monthly, weekly, daily, hourly,
|
|
12
|
+
* minutely, secondly, microsecond or none. If granularity is not present, it will
|
|
13
|
+
* be none by default. If granularity is none, the timestamp property in time
|
|
14
|
+
* series point can be absent.
|
|
15
|
+
*/
|
|
16
|
+
granularity?: "yearly" | "monthly" | "weekly" | "daily" | "hourly" | "minutely" | "secondly" | "microsecond" | "none";
|
|
17
|
+
/**
|
|
18
|
+
* Custom Interval is used to set non-standard time interval, for example, if the
|
|
19
|
+
* series is 5 minutes, request can be set as {"granularity":"minutely",
|
|
20
|
+
* "customInterval":5}.
|
|
21
|
+
*/
|
|
22
|
+
customInterval?: number;
|
|
23
|
+
/**
|
|
24
|
+
* Optional argument, periodic value of a time series. If the value is null or
|
|
25
|
+
* does not present, the API will determine the period automatically.
|
|
26
|
+
*/
|
|
27
|
+
period?: number;
|
|
28
|
+
/** Optional argument, advanced model parameter, max anomaly ratio in a time series. */
|
|
29
|
+
maxAnomalyRatio?: number;
|
|
30
|
+
/**
|
|
31
|
+
* Optional argument, advanced model parameter, between 0-99, the lower the value
|
|
32
|
+
* is, the larger the margin value will be which means less anomalies will be
|
|
33
|
+
* accepted.
|
|
34
|
+
*/
|
|
35
|
+
sensitivity?: number;
|
|
36
|
+
/**
|
|
37
|
+
* Used to specify how to deal with missing values in the input series, it's used
|
|
38
|
+
* when granularity is not "none".
|
|
39
|
+
*
|
|
40
|
+
* Possible values: auto, previous, linear, fixed, zero, notFill
|
|
41
|
+
*/
|
|
42
|
+
imputeMode?: string;
|
|
43
|
+
/**
|
|
44
|
+
* Used to specify the value to fill, it's used when granularity is not "none"
|
|
45
|
+
* and imputeMode is "fixed".
|
|
46
|
+
*/
|
|
47
|
+
imputeFixedValue?: number;
|
|
48
|
+
}
|
|
49
|
+
/** The definition of input timeseries points. */
|
|
50
|
+
export interface TimeSeriesPoint {
|
|
51
|
+
/** Optional argument, timestamp of a data point (ISO8601 format). */
|
|
52
|
+
timestamp?: Date | string;
|
|
53
|
+
/** The measurement of that point, should be float. */
|
|
54
|
+
value: number;
|
|
55
|
+
}
|
|
56
|
+
/** The request of change point detection. */
|
|
57
|
+
export interface UnivariateChangePointDetectionOptions {
|
|
58
|
+
/**
|
|
59
|
+
* Time series data points. Points should be sorted by timestamp in ascending
|
|
60
|
+
* order to match the change point detection result.
|
|
61
|
+
*/
|
|
62
|
+
series: Array<TimeSeriesPoint>;
|
|
63
|
+
/**
|
|
64
|
+
* Can only be one of yearly, monthly, weekly, daily, hourly, minutely or
|
|
65
|
+
* secondly. Granularity is used for verify whether input series is valid.
|
|
66
|
+
*/
|
|
67
|
+
granularity: "yearly" | "monthly" | "weekly" | "daily" | "hourly" | "minutely" | "secondly" | "microsecond" | "none";
|
|
68
|
+
/**
|
|
69
|
+
* Custom Interval is used to set non-standard time interval, for example, if the
|
|
70
|
+
* series is 5 minutes, request can be set as {"granularity":"minutely",
|
|
71
|
+
* "customInterval":5}.
|
|
72
|
+
*/
|
|
73
|
+
customInterval?: number;
|
|
74
|
+
/**
|
|
75
|
+
* Optional argument, periodic value of a time series. If the value is null or
|
|
76
|
+
* does not present, the API will determine the period automatically.
|
|
77
|
+
*/
|
|
78
|
+
period?: number;
|
|
79
|
+
/**
|
|
80
|
+
* Optional argument, advanced model parameter, a default stableTrendWindow will
|
|
81
|
+
* be used in detection.
|
|
82
|
+
*/
|
|
83
|
+
stableTrendWindow?: number;
|
|
84
|
+
/**
|
|
85
|
+
* Optional argument, advanced model parameter, between 0.0-1.0, the lower the
|
|
86
|
+
* value is, the larger the trend error will be which means less change point will
|
|
87
|
+
* be accepted.
|
|
88
|
+
*/
|
|
89
|
+
threshold?: number;
|
|
90
|
+
}
|
|
91
|
+
/** ErrorResponse contains code and message that shows the error information. */
|
|
92
|
+
export interface ErrorResponse {
|
|
93
|
+
/** The error code. */
|
|
94
|
+
code: string;
|
|
95
|
+
/** The message explaining the error reported by the service. */
|
|
96
|
+
message: string;
|
|
97
|
+
}
|
|
98
|
+
/** Variable Status. */
|
|
99
|
+
export interface VariableState {
|
|
100
|
+
/** Variable name in variable states. */
|
|
101
|
+
variable?: string;
|
|
102
|
+
/** Proportion of missing values that need to be filled by fillNAMethod. */
|
|
103
|
+
filledNARatio?: number;
|
|
104
|
+
/** Number of effective data points before applying fillNAMethod. */
|
|
105
|
+
effectiveCount?: number;
|
|
106
|
+
/** First valid timestamp with value of input data. */
|
|
107
|
+
firstTimestamp?: Date | string;
|
|
108
|
+
/** Last valid timestamp with value of input data. */
|
|
109
|
+
lastTimestamp?: Date | string;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Detection request for batch inference. This is an asynchronous inference which
|
|
113
|
+
* will need another API to get detection results.
|
|
114
|
+
*/
|
|
115
|
+
export interface MultivariateBatchDetectionOptions {
|
|
116
|
+
/**
|
|
117
|
+
* Source link to the input data to indicate an accessible Azure storage Uri,
|
|
118
|
+
* either pointed to an Azure blob storage folder, or pointed to a CSV file in
|
|
119
|
+
* Azure blob storage based on you data schema selection. The data schema should
|
|
120
|
+
* be exactly the same with those used in the training phase.
|
|
121
|
+
*/
|
|
122
|
+
dataSource: string;
|
|
123
|
+
/**
|
|
124
|
+
* An optional field, which is used to specify the number of top contributed
|
|
125
|
+
* variables for one anomalous timestamp in the response. The default number is
|
|
126
|
+
* 10.
|
|
127
|
+
*/
|
|
128
|
+
topContributorCount: number;
|
|
129
|
+
/**
|
|
130
|
+
* A required field, indicating the start time of data for detection, which should
|
|
131
|
+
* be date-time of ISO 8601 format.
|
|
132
|
+
*/
|
|
133
|
+
startTime: Date | string;
|
|
134
|
+
/**
|
|
135
|
+
* A required field, indicating the end time of data for detection, which should
|
|
136
|
+
* be date-time of ISO 8601 format.
|
|
137
|
+
*/
|
|
138
|
+
endTime: Date | string;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Training result of a model including its status, errors and diagnostics
|
|
142
|
+
* information.
|
|
143
|
+
*/
|
|
144
|
+
export interface ModelInfo {
|
|
145
|
+
/**
|
|
146
|
+
* Source link to the input data to indicate an accessible Azure storage Uri,
|
|
147
|
+
* either pointed to an Azure blob storage folder, or pointed to a CSV file in
|
|
148
|
+
* Azure blob storage based on you data schema selection.
|
|
149
|
+
*/
|
|
150
|
+
dataSource: string;
|
|
151
|
+
/**
|
|
152
|
+
* Data schema of input data source: OneTable or MultiTable. The default
|
|
153
|
+
* DataSchema is OneTable.
|
|
154
|
+
*
|
|
155
|
+
* Possible values: OneTable, MultiTable
|
|
156
|
+
*/
|
|
157
|
+
dataSchema?: string;
|
|
158
|
+
/**
|
|
159
|
+
* A required field, indicating the start time of training data, which should be
|
|
160
|
+
* date-time of ISO 8601 format.
|
|
161
|
+
*/
|
|
162
|
+
startTime: Date | string;
|
|
163
|
+
/**
|
|
164
|
+
* A required field, indicating the end time of training data, which should be
|
|
165
|
+
* date-time of ISO 8601 format.
|
|
166
|
+
*/
|
|
167
|
+
endTime: Date | string;
|
|
168
|
+
/**
|
|
169
|
+
* An optional field. The display name of the model whose maximum length is 24
|
|
170
|
+
* characters.
|
|
171
|
+
*/
|
|
172
|
+
displayName?: string;
|
|
173
|
+
/**
|
|
174
|
+
* An optional field, indicating how many previous timestamps will be used to
|
|
175
|
+
* detect whether the timestamp is anomaly or not.
|
|
176
|
+
*/
|
|
177
|
+
slidingWindow?: number;
|
|
178
|
+
/** An optional field, indicating the manner to align multiple variables. */
|
|
179
|
+
alignPolicy?: AlignPolicy;
|
|
180
|
+
/** Model status. One of CREATED, RUNNING, READY, and FAILED. */
|
|
181
|
+
status?: "CREATED" | "RUNNING" | "READY" | "FAILED";
|
|
182
|
+
/** Diagnostics information to help inspect the states of model or variable. */
|
|
183
|
+
diagnosticsInfo?: DiagnosticsInfo;
|
|
184
|
+
}
|
|
185
|
+
/** An optional field, indicating the manner to align multiple variables. */
|
|
186
|
+
export interface AlignPolicy {
|
|
187
|
+
/**
|
|
188
|
+
* An optional field, indicating how to align different variables to the same
|
|
189
|
+
* time-range. Either Inner or Outer.
|
|
190
|
+
*/
|
|
191
|
+
alignMode?: "Inner" | "Outer";
|
|
192
|
+
/**
|
|
193
|
+
* An optional field, indicating how missing values will be filled. One of
|
|
194
|
+
* Previous, Subsequent, Linear, Zero, Fixed.
|
|
195
|
+
*
|
|
196
|
+
* Possible values: Previous, Subsequent, Linear, Zero, Fixed
|
|
197
|
+
*/
|
|
198
|
+
fillNAMethod?: string;
|
|
199
|
+
/** An optional field. Required when fillNAMethod is Fixed. */
|
|
200
|
+
paddingValue?: number;
|
|
201
|
+
}
|
|
202
|
+
/** Diagnostics information to help inspect the states of model or variable. */
|
|
203
|
+
export interface DiagnosticsInfo {
|
|
204
|
+
/** Model status. */
|
|
205
|
+
modelState?: ModelState;
|
|
206
|
+
/** Variable Status. */
|
|
207
|
+
variableStates?: Array<VariableState>;
|
|
208
|
+
}
|
|
209
|
+
/** Model status. */
|
|
210
|
+
export interface ModelState {
|
|
211
|
+
/**
|
|
212
|
+
* This indicates the number of passes of the entire training dataset the
|
|
213
|
+
* algorithm has completed.
|
|
214
|
+
*/
|
|
215
|
+
epochIds?: number[];
|
|
216
|
+
/**
|
|
217
|
+
* List of metrics used to assess how the model fits the training data for each
|
|
218
|
+
* epoch.
|
|
219
|
+
*/
|
|
220
|
+
trainLosses?: number[];
|
|
221
|
+
/**
|
|
222
|
+
* List of metrics used to assess how the model fits the validation set for each
|
|
223
|
+
* epoch.
|
|
224
|
+
*/
|
|
225
|
+
validationLosses?: number[];
|
|
226
|
+
/** Latency for each epoch. */
|
|
227
|
+
latenciesInSeconds?: number[];
|
|
228
|
+
}
|
|
229
|
+
/** Request of last detection. */
|
|
230
|
+
export interface MultivariateLastDetectionOptions {
|
|
231
|
+
/**
|
|
232
|
+
* This contains the inference data, including the name, timestamps(ISO 8601) and
|
|
233
|
+
* values of variables.
|
|
234
|
+
*/
|
|
235
|
+
variables: Array<VariableValues>;
|
|
236
|
+
/**
|
|
237
|
+
* An optional field, which is used to specify the number of top contributed
|
|
238
|
+
* variables for one anomalous timestamp in the response. The default number is
|
|
239
|
+
* 10.
|
|
240
|
+
*/
|
|
241
|
+
topContributorCount: number;
|
|
242
|
+
}
|
|
243
|
+
/** Variable values. */
|
|
244
|
+
export interface VariableValues {
|
|
245
|
+
/** Variable name of last detection request. */
|
|
246
|
+
variable: string;
|
|
247
|
+
/** Timestamps of last detection request */
|
|
248
|
+
timestamps: string[];
|
|
249
|
+
/** Values of variables. */
|
|
250
|
+
values: number[];
|
|
251
|
+
}
|
|
252
|
+
//# sourceMappingURL=models.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../src/models.ts"],"names":[],"mappings":"AAGA,uDAAuD;AACvD,MAAM,WAAW,0BAA0B;IACzC;;;;;OAKG;IACH,MAAM,EAAE,KAAK,CAAC,eAAe,CAAC,CAAC;IAC/B;;;;;OAKG;IACH,WAAW,CAAC,EACR,QAAQ,GACR,SAAS,GACT,QAAQ,GACR,OAAO,GACP,QAAQ,GACR,UAAU,GACV,UAAU,GACV,aAAa,GACb,MAAM,CAAC;IACX;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;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AAU;IACzB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B,8BAA8B;IAC9B,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC/B;AAED,iCAAiC;AACjC,MAAM,WAAW,gCAAgC;IAC/C;;;OAGG;IACH,SAAS,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC;IACjC;;;;OAIG;IACH,mBAAmB,EAAE,MAAM,CAAC;CAC7B;AAED,uBAAuB;AACvB,MAAM,WAAW,cAAc;IAC7B,+CAA+C;IAC/C,QAAQ,EAAE,MAAM,CAAC;IACjB,2CAA2C;IAC3C,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,2BAA2B;IAC3B,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB"}
|
|
@@ -1 +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
|
|
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\n/** The request of entire or last anomaly detection. */\nexport interface UnivariateDetectionOptions {\n /**\n * Time series data points. Points should be sorted by timestamp in ascending\n * order to match the anomaly detection result. If the data is not sorted\n * correctly or there is duplicated timestamp, the API will not work. In such\n * case, an error message will be returned.\n */\n series: Array<TimeSeriesPoint>;\n /**\n * Optional argument, can be one of yearly, monthly, weekly, daily, hourly,\n * minutely, secondly, microsecond or none. If granularity is not present, it will\n * be none by default. If granularity is none, the timestamp property in time\n * series point can be absent.\n */\n granularity?:\n | \"yearly\"\n | \"monthly\"\n | \"weekly\"\n | \"daily\"\n | \"hourly\"\n | \"minutely\"\n | \"secondly\"\n | \"microsecond\"\n | \"none\";\n /**\n * Custom Interval is used to set non-standard time interval, for example, if the\n * series is 5 minutes, request can be set as {\"granularity\":\"minutely\",\n * \"customInterval\":5}.\n */\n customInterval?: number;\n /**\n * Optional argument, periodic value of a time series. If the value is null or\n * does not present, the API will determine the period automatically.\n */\n period?: number;\n /** Optional argument, advanced model parameter, max anomaly ratio in a time series. */\n maxAnomalyRatio?: number;\n /**\n * Optional argument, advanced model parameter, between 0-99, the lower the value\n * is, the larger the margin value will be which means less anomalies will be\n * accepted.\n */\n sensitivity?: number;\n /**\n * Used to specify how to deal with missing values in the input series, it's used\n * when granularity is not \"none\".\n *\n * Possible values: auto, previous, linear, fixed, zero, notFill\n */\n imputeMode?: string;\n /**\n * Used to specify the value to fill, it's used when granularity is not \"none\"\n * and imputeMode is \"fixed\".\n */\n imputeFixedValue?: number;\n}\n\n/** The definition of input timeseries points. */\nexport interface TimeSeriesPoint {\n /** Optional argument, timestamp of a data point (ISO8601 format). */\n timestamp?: Date | string;\n /** The measurement of that point, should be float. */\n value: number;\n}\n\n/** The request of change point detection. */\nexport interface UnivariateChangePointDetectionOptions {\n /**\n * Time series data points. Points should be sorted by timestamp in ascending\n * order to match the change point detection result.\n */\n series: Array<TimeSeriesPoint>;\n /**\n * Can only be one of yearly, monthly, weekly, daily, hourly, minutely or\n * secondly. Granularity is used for verify whether input series is valid.\n */\n granularity:\n | \"yearly\"\n | \"monthly\"\n | \"weekly\"\n | \"daily\"\n | \"hourly\"\n | \"minutely\"\n | \"secondly\"\n | \"microsecond\"\n | \"none\";\n /**\n * Custom Interval is used to set non-standard time interval, for example, if the\n * series is 5 minutes, request can be set as {\"granularity\":\"minutely\",\n * \"customInterval\":5}.\n */\n customInterval?: number;\n /**\n * Optional argument, periodic value of a time series. If the value is null or\n * does not present, the API will determine the period automatically.\n */\n period?: number;\n /**\n * Optional argument, advanced model parameter, a default stableTrendWindow will\n * be used in detection.\n */\n stableTrendWindow?: number;\n /**\n * Optional argument, advanced model parameter, between 0.0-1.0, the lower the\n * value is, the larger the trend error will be which means less change point will\n * be accepted.\n */\n threshold?: number;\n}\n\n/** ErrorResponse contains code and message that shows the error information. */\nexport interface ErrorResponse {\n /** The error code. */\n code: string;\n /** The message explaining the error reported by the service. */\n message: string;\n}\n\n/** Variable Status. */\nexport interface VariableState {\n /** Variable name in variable states. */\n variable?: string;\n /** Proportion of missing values that need to be filled by fillNAMethod. */\n filledNARatio?: number;\n /** Number of effective data points before applying fillNAMethod. */\n effectiveCount?: number;\n /** First valid timestamp with value of input data. */\n firstTimestamp?: Date | string;\n /** Last valid timestamp with value of input data. */\n lastTimestamp?: Date | string;\n}\n\n/**\n * Detection request for batch inference. This is an asynchronous inference which\n * will need another API to get detection results.\n */\nexport interface MultivariateBatchDetectionOptions {\n /**\n * Source link to the input data to indicate an accessible Azure storage Uri,\n * either pointed to an Azure blob storage folder, or pointed to a CSV file in\n * Azure blob storage based on you data schema selection. The data schema should\n * be exactly the same with those used in the training phase.\n */\n dataSource: string;\n /**\n * An optional field, which is used to specify the number of top contributed\n * variables for one anomalous timestamp in the response. The default number is\n * 10.\n */\n topContributorCount: number;\n /**\n * A required field, indicating the start time of data for detection, which should\n * be date-time of ISO 8601 format.\n */\n startTime: Date | string;\n /**\n * A required field, indicating the end time of data for detection, which should\n * be date-time of ISO 8601 format.\n */\n endTime: Date | string;\n}\n\n/**\n * Training result of a model including its status, errors and diagnostics\n * information.\n */\nexport interface ModelInfo {\n /**\n * Source link to the input data to indicate an accessible Azure storage Uri,\n * either pointed to an Azure blob storage folder, or pointed to a CSV file in\n * Azure blob storage based on you data schema selection.\n */\n dataSource: string;\n /**\n * Data schema of input data source: OneTable or MultiTable. The default\n * DataSchema is OneTable.\n *\n * Possible values: OneTable, MultiTable\n */\n dataSchema?: string;\n /**\n * A required field, indicating the start time of training data, which should be\n * date-time of ISO 8601 format.\n */\n startTime: Date | string;\n /**\n * A required field, indicating the end time of training data, which should be\n * date-time of ISO 8601 format.\n */\n endTime: Date | string;\n /**\n * An optional field. The display name of the model whose maximum length is 24\n * characters.\n */\n displayName?: string;\n /**\n * An optional field, indicating how many previous timestamps will be used to\n * detect whether the timestamp is anomaly or not.\n */\n slidingWindow?: number;\n /** An optional field, indicating the manner to align multiple variables. */\n alignPolicy?: AlignPolicy;\n /** Model status. One of CREATED, RUNNING, READY, and FAILED. */\n status?: \"CREATED\" | \"RUNNING\" | \"READY\" | \"FAILED\";\n /** Diagnostics information to help inspect the states of model or variable. */\n diagnosticsInfo?: DiagnosticsInfo;\n}\n\n/** An optional field, indicating the manner to align multiple variables. */\nexport interface AlignPolicy {\n /**\n * An optional field, indicating how to align different variables to the same\n * time-range. Either Inner or Outer.\n */\n alignMode?: \"Inner\" | \"Outer\";\n /**\n * An optional field, indicating how missing values will be filled. One of\n * Previous, Subsequent, Linear, Zero, Fixed.\n *\n * Possible values: Previous, Subsequent, Linear, Zero, Fixed\n */\n fillNAMethod?: string;\n /** An optional field. Required when fillNAMethod is Fixed. */\n paddingValue?: number;\n}\n\n/** Diagnostics information to help inspect the states of model or variable. */\nexport interface DiagnosticsInfo {\n /** Model status. */\n modelState?: ModelState;\n /** Variable Status. */\n variableStates?: Array<VariableState>;\n}\n\n/** Model status. */\nexport interface ModelState {\n /**\n * This indicates the number of passes of the entire training dataset the\n * algorithm has completed.\n */\n epochIds?: number[];\n /**\n * List of metrics used to assess how the model fits the training data for each\n * epoch.\n */\n trainLosses?: number[];\n /**\n * List of metrics used to assess how the model fits the validation set for each\n * epoch.\n */\n validationLosses?: number[];\n /** Latency for each epoch. */\n latenciesInSeconds?: number[];\n}\n\n/** Request of last detection. */\nexport interface MultivariateLastDetectionOptions {\n /**\n * This contains the inference data, including the name, timestamps(ISO 8601) and\n * values of variables.\n */\n variables: Array<VariableValues>;\n /**\n * An optional field, which is used to specify the number of top contributed\n * variables for one anomalous timestamp in the response. The default number is\n * 10.\n */\n topContributorCount: number;\n}\n\n/** Variable values. */\nexport interface VariableValues {\n /** Variable name of last detection request. */\n variable: string;\n /** Timestamps of last detection request */\n timestamps: string[];\n /** Values of variables. */\n values: number[];\n}\n"]}
|