@azure-rest/ai-anomaly-detector 1.0.0-alpha.20221107.2 → 1.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +3 -53
- package/dist/index.js.map +1 -1
- package/dist-esm/src/anomalyDetectorRest.js +3 -4
- package/dist-esm/src/anomalyDetectorRest.js.map +1 -1
- package/dist-esm/src/clientDefinitions.js.map +1 -1
- package/dist-esm/src/index.js +0 -1
- package/dist-esm/src/index.js.map +1 -1
- package/dist-esm/src/isUnexpected.js +0 -1
- package/dist-esm/src/isUnexpected.js.map +1 -1
- package/dist-esm/src/models.js.map +1 -1
- package/dist-esm/src/outputModels.js.map +1 -1
- package/dist-esm/src/parameters.js.map +1 -1
- package/dist-esm/src/responses.js.map +1 -1
- package/package.json +4 -4
- package/review/ai-anomaly-detector.api.md +210 -259
- package/types/ai-anomaly-detector.d.ts +614 -362
- package/dist-esm/src/pollingHelper.js +0 -48
- package/dist-esm/src/pollingHelper.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -4,19 +4,17 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var coreClient = require('@azure-rest/core-client');
|
|
6
6
|
var corePaging = require('@azure/core-paging');
|
|
7
|
-
var coreLro = require('@azure/core-lro');
|
|
8
7
|
|
|
9
8
|
// Copyright (c) Microsoft Corporation.
|
|
10
9
|
/**
|
|
11
10
|
* Initialize a new instance of the class AnomalyDetectorRestClient class.
|
|
12
|
-
* @param Endpoint type: string
|
|
13
|
-
* @param ApiVersion type: string Anomaly Detector API version (for example, v1.1).
|
|
11
|
+
* @param Endpoint type: string
|
|
14
12
|
* @param credentials type: KeyCredential
|
|
15
13
|
*/
|
|
16
14
|
function createClient(Endpoint, credentials, options = {}) {
|
|
17
15
|
var _a, _b;
|
|
18
|
-
const
|
|
19
|
-
const baseUrl = (_b = options.baseUrl) !== null && _b !== void 0 ? _b : `${Endpoint}/anomalydetector/${
|
|
16
|
+
const ApiVersion = (_a = options.ApiVersion) !== null && _a !== void 0 ? _a : "v1.1";
|
|
17
|
+
const baseUrl = (_b = options.baseUrl) !== null && _b !== void 0 ? _b : `${Endpoint}/anomalydetector/${ApiVersion}`;
|
|
20
18
|
options = Object.assign(Object.assign({}, options), { credentials: {
|
|
21
19
|
apiKeyHeaderName: "Ocp-Apim-Subscription-Key",
|
|
22
20
|
} });
|
|
@@ -43,7 +41,6 @@ const responseMap = {
|
|
|
43
41
|
"DELETE /multivariate/models/{modelId}": ["204"],
|
|
44
42
|
"GET /multivariate/models/{modelId}": ["200"],
|
|
45
43
|
"POST /multivariate/models/{modelId}:detect-batch": ["202"],
|
|
46
|
-
"GET /multivariate/models/{modelId}:detect-batch": ["202"],
|
|
47
44
|
"POST /multivariate/models/{modelId}:detect-last": ["200"],
|
|
48
45
|
};
|
|
49
46
|
function isUnexpected(response) {
|
|
@@ -211,56 +208,9 @@ function getPaginationProperties(initialResponse) {
|
|
|
211
208
|
return { itemName, nextLinkName };
|
|
212
209
|
}
|
|
213
210
|
|
|
214
|
-
// Copyright (c) Microsoft Corporation.
|
|
215
|
-
/**
|
|
216
|
-
* Helper function that builds a Poller object to help polling a long running operation.
|
|
217
|
-
* @param client - Client to use for sending the request to get additional pages.
|
|
218
|
-
* @param initialResponse - The initial response.
|
|
219
|
-
* @param options - Options to set a resume state or custom polling interval.
|
|
220
|
-
* @returns - A poller object to poll for operation state updates and eventually get the final response.
|
|
221
|
-
*/
|
|
222
|
-
function getLongRunningPoller(client, initialResponse, options = {}) {
|
|
223
|
-
const poller = {
|
|
224
|
-
requestMethod: initialResponse.request.method,
|
|
225
|
-
requestPath: initialResponse.request.url,
|
|
226
|
-
sendInitialRequest: async () => {
|
|
227
|
-
// In the case of Rest Clients we are building the LRO poller object from a response that's the reason
|
|
228
|
-
// we are not triggering the initial request here, just extracting the information from the
|
|
229
|
-
// response we were provided.
|
|
230
|
-
return getLroResponse(initialResponse);
|
|
231
|
-
},
|
|
232
|
-
sendPollRequest: async (path) => {
|
|
233
|
-
// This is the callback that is going to be called to poll the service
|
|
234
|
-
// to get the latest status. We use the client provided and the polling path
|
|
235
|
-
// which is an opaque URL provided by caller, the service sends this in one of the following headers: operation-location, azure-asyncoperation or location
|
|
236
|
-
// depending on the lro pattern that the service implements. If non is provided we default to the initial path.
|
|
237
|
-
const response = await client.pathUnchecked(path !== null && path !== void 0 ? path : initialResponse.request.url).get();
|
|
238
|
-
const lroResponse = getLroResponse(response);
|
|
239
|
-
lroResponse.rawResponse.headers["x-ms-original-url"] = initialResponse.request.url;
|
|
240
|
-
return lroResponse;
|
|
241
|
-
},
|
|
242
|
-
};
|
|
243
|
-
return new coreLro.LroEngine(poller, options);
|
|
244
|
-
}
|
|
245
|
-
/**
|
|
246
|
-
* Converts a Rest Client response to a response that the LRO engine knows about
|
|
247
|
-
* @param response - a rest client http response
|
|
248
|
-
* @returns - An LRO response that the LRO engine can work with
|
|
249
|
-
*/
|
|
250
|
-
function getLroResponse(response) {
|
|
251
|
-
if (Number.isNaN(response.status)) {
|
|
252
|
-
throw new TypeError(`Status code of the response is not a number. Value: ${response.status}`);
|
|
253
|
-
}
|
|
254
|
-
return {
|
|
255
|
-
flatResponse: response,
|
|
256
|
-
rawResponse: Object.assign(Object.assign({}, response), { statusCode: Number.parseInt(response.status), body: response.body }),
|
|
257
|
-
};
|
|
258
|
-
}
|
|
259
|
-
|
|
260
211
|
// Copyright (c) Microsoft Corporation.
|
|
261
212
|
|
|
262
213
|
exports["default"] = createClient;
|
|
263
|
-
exports.getLongRunningPoller = getLongRunningPoller;
|
|
264
214
|
exports.isUnexpected = isUnexpected;
|
|
265
215
|
exports.paginate = paginate;
|
|
266
216
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/anomalyDetectorRest.ts","../src/isUnexpected.ts","../src/paginateHelper.ts","../src/pollingHelper.ts","../src/index.ts"],"sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { getClient, ClientOptions } from \"@azure-rest/core-client\";\nimport { KeyCredential } from \"@azure/core-auth\";\nimport { AnomalyDetectorRestClient } from \"./clientDefinitions\";\n\n/**\n * Initialize a new instance of the class AnomalyDetectorRestClient class.\n * @param Endpoint type: string Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus2.api.cognitive.microsoft.com).\n * @param ApiVersion type: string Anomaly Detector API version (for example, v1.1).\n * @param credentials type: KeyCredential\n */\nexport default function createClient(\n Endpoint: string,\n credentials: KeyCredential,\n options: ClientOptions & { apiVersion?: string } = {}\n): AnomalyDetectorRestClient {\n const apiVersion = options.apiVersion ?? \"v1.1\";\n const baseUrl = options.baseUrl ?? `${Endpoint}/anomalydetector/${apiVersion}`;\n\n options = {\n ...options,\n credentials: {\n apiKeyHeaderName: \"Ocp-Apim-Subscription-Key\",\n },\n };\n\n const userAgentInfo = `azsdk-js-ai-anomaly-detector-rest/1.0.0-beta.1`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`\n : `${userAgentInfo}`;\n options = {\n ...options,\n userAgentOptions: {\n userAgentPrefix,\n },\n };\n\n const client = getClient(baseUrl, credentials, options) as AnomalyDetectorRestClient;\n\n return client;\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n DetectUnivariateEntireSeries200Response,\n DetectUnivariateEntireSeriesDefaultResponse,\n DetectUnivariateLastPoint200Response,\n DetectUnivariateLastPointDefaultResponse,\n DetectUnivariateChangePoint200Response,\n DetectUnivariateChangePointDefaultResponse,\n GetMultivariateBatchDetectionResult200Response,\n GetMultivariateBatchDetectionResultDefaultResponse,\n CreateAndTrainMultivariateModel201Response,\n CreateAndTrainMultivariateModelDefaultResponse,\n ListMultivariateModels200Response,\n ListMultivariateModelsDefaultResponse,\n DeleteMultivariateModel204Response,\n DeleteMultivariateModelDefaultResponse,\n GetMultivariateModel200Response,\n GetMultivariateModelDefaultResponse,\n DetectMultivariateBatchAnomaly202Response,\n DetectMultivariateBatchAnomalyDefaultResponse,\n DetectMultivariateLastAnomaly200Response,\n DetectMultivariateLastAnomalyDefaultResponse,\n} from \"./responses\";\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 \"GET /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:\n | CreateAndTrainMultivariateModel201Response\n | CreateAndTrainMultivariateModelDefaultResponse\n): response is CreateAndTrainMultivariateModelDefaultResponse;\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 | CreateAndTrainMultivariateModel201Response\n | CreateAndTrainMultivariateModelDefaultResponse\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 | CreateAndTrainMultivariateModelDefaultResponse\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","// 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 | {\n body: { value?: infer TPage };\n }\n | {\n body: { models?: 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 // We need to check the response for success before trying to inspect it looking for\n // the properties to use for nextLink and itemName\n checkPagingRequest(initialResponse);\n const { itemName, nextLinkName } = getPaginationProperties(initialResponse);\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\n/**\n * Extracts the itemName and nextLinkName from the initial response to use them for pagination\n */\nfunction getPaginationProperties(initialResponse: PathUncheckedResponse) {\n // Build a set with the passed custom nextLinkNames\n const nextLinkNames = new Set([\"nextLink\"]);\n\n // Build a set with the passed custom set of itemNames\n const itemNames = new Set([\"value\", \"models\"]);\n\n let nextLinkName: string | undefined;\n let itemName: string | undefined;\n\n for (const name of nextLinkNames) {\n const nextLink = (initialResponse.body as Record<string, unknown>)[name] as string;\n if (nextLink) {\n nextLinkName = name;\n break;\n }\n }\n\n for (const name of itemNames) {\n const item = (initialResponse.body as Record<string, unknown>)[name] as string;\n if (item) {\n itemName = name;\n break;\n }\n }\n\n if (!itemName) {\n throw new Error(\n `Couldn't paginate response\\n Body doesn't contain an array property with name: ${[\n ...itemNames,\n ].join(\" OR \")}`\n );\n }\n\n return { itemName, nextLinkName };\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { Client, HttpResponse } from \"@azure-rest/core-client\";\nimport {\n LongRunningOperation,\n LroEngine,\n LroEngineOptions,\n LroResponse,\n PollerLike,\n PollOperationState,\n} from \"@azure/core-lro\";\n\n/**\n * Helper function that builds a Poller object to help polling a long running operation.\n * @param client - Client to use for sending the request to get additional pages.\n * @param initialResponse - The initial response.\n * @param options - Options to set a resume state or custom polling interval.\n * @returns - A poller object to poll for operation state updates and eventually get the final response.\n */\nexport function getLongRunningPoller<TResult extends HttpResponse>(\n client: Client,\n initialResponse: TResult,\n options: LroEngineOptions<TResult, PollOperationState<TResult>> = {}\n): PollerLike<PollOperationState<TResult>, TResult> {\n const poller: LongRunningOperation<TResult> = {\n requestMethod: initialResponse.request.method,\n requestPath: initialResponse.request.url,\n sendInitialRequest: async () => {\n // In the case of Rest Clients we are building the LRO poller object from a response that's the reason\n // we are not triggering the initial request here, just extracting the information from the\n // response we were provided.\n return getLroResponse(initialResponse);\n },\n sendPollRequest: async (path) => {\n // This is the callback that is going to be called to poll the service\n // to get the latest status. We use the client provided and the polling path\n // which is an opaque URL provided by caller, the service sends this in one of the following headers: operation-location, azure-asyncoperation or location\n // depending on the lro pattern that the service implements. If non is provided we default to the initial path.\n const response = await client.pathUnchecked(path ?? initialResponse.request.url).get();\n const lroResponse = getLroResponse(response as TResult);\n lroResponse.rawResponse.headers[\"x-ms-original-url\"] = initialResponse.request.url;\n return lroResponse;\n },\n };\n\n return new LroEngine(poller, options);\n}\n\n/**\n * Converts a Rest Client response to a response that the LRO engine knows about\n * @param response - a rest client http response\n * @returns - An LRO response that the LRO engine can work with\n */\nfunction getLroResponse<TResult extends HttpResponse>(response: TResult): LroResponse<TResult> {\n if (Number.isNaN(response.status)) {\n throw new TypeError(`Status code of the response is not a number. Value: ${response.status}`);\n }\n\n return {\n flatResponse: response,\n rawResponse: {\n ...response,\n statusCode: Number.parseInt(response.status),\n body: response.body,\n },\n };\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport AnomalyDetectorRest from \"./anomalyDetectorRest\";\n\nexport * from \"./anomalyDetectorRest\";\nexport * from \"./parameters\";\nexport * from \"./responses\";\nexport * from \"./clientDefinitions\";\nexport * from \"./isUnexpected\";\nexport * from \"./models\";\nexport * from \"./outputModels\";\nexport * from \"./paginateHelper\";\nexport * from \"./pollingHelper\";\n\nexport default AnomalyDetectorRest;\n"],"names":["getClient","getPagedAsyncIterator","createRestError","LroEngine"],"mappings":";;;;;;;;AAAA;AAOA;;;;;AAKG;AACW,SAAU,YAAY,CAClC,QAAgB,EAChB,WAA0B,EAC1B,OAAA,GAAmD,EAAE,EAAA;;IAErD,MAAM,UAAU,GAAG,CAAA,EAAA,GAAA,OAAO,CAAC,UAAU,MAAA,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,EAAA,GAAI,MAAM,CAAC;AAChD,IAAA,MAAM,OAAO,GAAG,CAAA,EAAA,GAAA,OAAO,CAAC,OAAO,MAAI,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,EAAA,GAAA,CAAA,EAAG,QAAQ,CAAA,iBAAA,EAAoB,UAAU,CAAA,CAAE,CAAC;AAE/E,IAAA,OAAO,GACF,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAAA,OAAO,CACV,EAAA,EAAA,WAAW,EAAE;AACX,YAAA,gBAAgB,EAAE,2BAA2B;AAC9C,SAAA,EAAA,CACF,CAAC;IAEF,MAAM,aAAa,GAAG,CAAA,8CA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E,OAAO,IAAI,KAAI;;;;;YAK9B,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,aAAa,CAAC,IAAI,KAAA,IAAA,IAAJ,IAAI,KAAA,KAAA,CAAA,GAAJ,IAAI,GAAI,eAAe,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC;AACvF,YAAA,MAAM,WAAW,GAAG,cAAc,CAAC,QAAmB,CAAC,CAAC;AACxD,YAAA,WAAW,CAAC,WAAW,CAAC,OAAO,CAAC,mBAAmB,CAAC,GAAG,eAAe,CAAC,OAAO,CAAC,GAAG,CAAC;AACnF,YAAA,OAAO,WAAW,CAAC;SACpB;KACF,CAAC;AAEF,IAAA,OAAO,IAAIC,iBAAS,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AACxC,CAAC;AAED;;;;AAIG;AACH,SAAS,cAAc,CAA+B,QAAiB,EAAA;IACrE,IAAI,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;QACjC,MAAM,IAAI,SAAS,CAAC,CAAA,oDAAA,EAAuD,QAAQ,CAAC,MAAM,CAAE,CAAA,CAAC,CAAC;AAC/F,KAAA;IAED,OAAO;AACL,QAAA,YAAY,EAAE,QAAQ;AACtB,QAAA,WAAW,kCACN,QAAQ,CAAA,EAAA,EACX,UAAU,EAAE,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,EAC5C,IAAI,EAAE,QAAQ,CAAC,IAAI,EACpB,CAAA;KACF,CAAC;AACJ;;ACnEA;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/anomalyDetectorRest.ts","../src/isUnexpected.ts","../src/paginateHelper.ts","../src/index.ts"],"sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { getClient, ClientOptions } from \"@azure-rest/core-client\";\nimport { KeyCredential } from \"@azure/core-auth\";\nimport { AnomalyDetectorRestClient } from \"./clientDefinitions\";\n\nexport interface AnomalyDetectorRestClientOptions extends ClientOptions {\n ApiVersion?: string;\n}\n\n/**\n * Initialize a new instance of the class AnomalyDetectorRestClient class.\n * @param Endpoint type: string\n * @param credentials type: KeyCredential\n */\nexport default function createClient(\n Endpoint: string,\n credentials: KeyCredential,\n options: AnomalyDetectorRestClientOptions = {}\n): AnomalyDetectorRestClient {\n const ApiVersion = options.ApiVersion ?? \"v1.1\";\n const baseUrl = options.baseUrl ?? `${Endpoint}/anomalydetector/${ApiVersion}`;\n\n options = {\n ...options,\n credentials: {\n apiKeyHeaderName: \"Ocp-Apim-Subscription-Key\",\n },\n };\n\n const userAgentInfo = `azsdk-js-ai-anomaly-detector-rest/1.0.0-beta.1`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`\n : `${userAgentInfo}`;\n options = {\n ...options,\n userAgentOptions: {\n userAgentPrefix,\n },\n };\n\n const client = getClient(baseUrl, credentials, options) as AnomalyDetectorRestClient;\n\n return client;\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\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\";\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","// 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 | {\n body: { value?: infer TPage };\n }\n | {\n body: { models?: 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 // We need to check the response for success before trying to inspect it looking for\n // the properties to use for nextLink and itemName\n checkPagingRequest(initialResponse);\n const { itemName, nextLinkName } = getPaginationProperties(initialResponse);\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\n/**\n * Extracts the itemName and nextLinkName from the initial response to use them for pagination\n */\nfunction getPaginationProperties(initialResponse: PathUncheckedResponse) {\n // Build a set with the passed custom nextLinkNames\n const nextLinkNames = new Set([\"nextLink\"]);\n\n // Build a set with the passed custom set of itemNames\n const itemNames = new Set([\"value\", \"models\"]);\n\n let nextLinkName: string | undefined;\n let itemName: string | undefined;\n\n for (const name of nextLinkNames) {\n const nextLink = (initialResponse.body as Record<string, unknown>)[name] as string;\n if (nextLink) {\n nextLinkName = name;\n break;\n }\n }\n\n for (const name of itemNames) {\n const item = (initialResponse.body as Record<string, unknown>)[name] as string;\n if (item) {\n itemName = name;\n break;\n }\n }\n\n if (!itemName) {\n throw new Error(\n `Couldn't paginate response\\n Body doesn't contain an array property with name: ${[\n ...itemNames,\n ].join(\" OR \")}`\n );\n }\n\n return { itemName, nextLinkName };\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport AnomalyDetectorRest from \"./anomalyDetectorRest\";\n\nexport * from \"./anomalyDetectorRest\";\nexport * from \"./parameters\";\nexport * from \"./responses\";\nexport * from \"./clientDefinitions\";\nexport * from \"./isUnexpected\";\nexport * from \"./models\";\nexport * from \"./outputModels\";\nexport * from \"./paginateHelper\";\n\nexport default AnomalyDetectorRest;\n"],"names":["getClient","getPagedAsyncIterator","createRestError"],"mappings":";;;;;;;AAAA;AAWA;;;;AAIG;AACW,SAAU,YAAY,CAClC,QAAgB,EAChB,WAA0B,EAC1B,OAAA,GAA4C,EAAE,EAAA;;IAE9C,MAAM,UAAU,GAAG,CAAA,EAAA,GAAA,OAAO,CAAC,UAAU,MAAA,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,EAAA,GAAI,MAAM,CAAC;AAChD,IAAA,MAAM,OAAO,GAAG,CAAA,EAAA,GAAA,OAAO,CAAC,OAAO,MAAI,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,EAAA,GAAA,CAAA,EAAG,QAAQ,CAAA,iBAAA,EAAoB,UAAU,CAAA,CAAE,CAAC;AAE/E,IAAA,OAAO,GACF,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAAA,OAAO,CACV,EAAA,EAAA,WAAW,EAAE;AACX,YAAA,gBAAgB,EAAE,2BAA2B;AAC9C,SAAA,EAAA,CACF,CAAC;IAEF,MAAM,aAAa,GAAG,CAAA,8CAAA,CAAgD,CAAC;IACvE,MAAM,eAAe,GACnB,OAAO,CAAC,gBAAgB,IAAI,OAAO,CAAC,gBAAgB,CAAC,eAAe;UAChE,GAAG,OAAO,CAAC,gBAAgB,CAAC,eAAe,CAAI,CAAA,EAAA,aAAa,CAAE,CAAA;AAChE,UAAE,CAAA,EAAG,aAAa,CAAA,CAAE,CAAC;AACzB,IAAA,OAAO,GACF,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAAA,OAAO,CACV,EAAA,EAAA,gBAA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Z,YAAY,GAAG,IAAI,CAAC;YACpB,MAAM;AACP,SAAA;AACF,KAAA;AAED,IAAA,KAAK,MAAM,IAAI,IAAI,SAAS,EAAE;QAC5B,MAAM,IAAI,GAAI,eAAe,CAAC,IAAgC,CAAC,IAAI,CAAW,CAAC;AAC/E,QAAA,IAAI,IAAI,EAAE;YACR,QAAQ,GAAG,IAAI,CAAC;YAChB,MAAM;AACP,SAAA;AACF,KAAA;IAED,IAAI,CAAC,QAAQ,EAAE;QACb,MAAM,IAAI,KAAK,CACb,CAAkF,+EAAA,EAAA;AAChF,YAAA,GAAG,SAAS;AACb,SAAA,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA,CAAE,CACjB,CAAC;AACH,KAAA;AAED,IAAA,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,CAAC;AACpC;;AChLA;;;;;;"}
|
|
@@ -3,14 +3,13 @@
|
|
|
3
3
|
import { getClient } from "@azure-rest/core-client";
|
|
4
4
|
/**
|
|
5
5
|
* Initialize a new instance of the class AnomalyDetectorRestClient class.
|
|
6
|
-
* @param Endpoint type: string
|
|
7
|
-
* @param ApiVersion type: string Anomaly Detector API version (for example, v1.1).
|
|
6
|
+
* @param Endpoint type: string
|
|
8
7
|
* @param credentials type: KeyCredential
|
|
9
8
|
*/
|
|
10
9
|
export default function createClient(Endpoint, credentials, options = {}) {
|
|
11
10
|
var _a, _b;
|
|
12
|
-
const
|
|
13
|
-
const baseUrl = (_b = options.baseUrl) !== null && _b !== void 0 ? _b : `${Endpoint}/anomalydetector/${
|
|
11
|
+
const ApiVersion = (_a = options.ApiVersion) !== null && _a !== void 0 ? _a : "v1.1";
|
|
12
|
+
const baseUrl = (_b = options.baseUrl) !== null && _b !== void 0 ? _b : `${Endpoint}/anomalydetector/${ApiVersion}`;
|
|
14
13
|
options = Object.assign(Object.assign({}, options), { credentials: {
|
|
15
14
|
apiKeyHeaderName: "Ocp-Apim-Subscription-Key",
|
|
16
15
|
} });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"anomalyDetectorRest.js","sourceRoot":"","sources":["../../src/anomalyDetectorRest.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,SAAS,EAAiB,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"anomalyDetectorRest.js","sourceRoot":"","sources":["../../src/anomalyDetectorRest.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,SAAS,EAAiB,MAAM,yBAAyB,CAAC;AAQnE;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAClC,QAAgB,EAChB,WAA0B,EAC1B,UAA4C,EAAE;;IAE9C,MAAM,UAAU,GAAG,MAAA,OAAO,CAAC,UAAU,mCAAI,MAAM,CAAC;IAChD,MAAM,OAAO,GAAG,MAAA,OAAO,CAAC,OAAO,mCAAI,GAAG,QAAQ,oBAAoB,UAAU,EAAE,CAAC;IAE/E,OAAO,mCACF,OAAO,KACV,WAAW,EAAE;YACX,gBAAgB,EAAE,2BAA2B;SAC9C,GACF,CAAC;IAEF,MAAM,aAAa,GAAG,gDAAgD,CAAC;IACvE,MAAM,eAAe,GACnB,OAAO,CAAC,gBAAgB,IAAI,OAAO,CAAC,gBAAgB,CAAC,eAAe;QAClE,CAAC,CAAC,GAAG,OAAO,CAAC,gBAAgB,CAAC,eAAe,IAAI,aAAa,EAAE;QAChE,CAAC,CAAC,GAAG,aAAa,EAAE,CAAC;IACzB,OAAO,mCACF,OAAO,KACV,gBAAgB,EAAE;YAChB,eAAe;SAChB,GACF,CAAC;IAEF,MAAM,MAAM,GAAG,SAAS,CAAC,OAAO,EAAE,WAAW,EAAE,OAAO,CAA8B,CAAC;IAErF,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { getClient, ClientOptions } from \"@azure-rest/core-client\";\nimport { KeyCredential } from \"@azure/core-auth\";\nimport { AnomalyDetectorRestClient } from \"./clientDefinitions\";\n\nexport interface AnomalyDetectorRestClientOptions extends ClientOptions {\n ApiVersion?: string;\n}\n\n/**\n * Initialize a new instance of the class AnomalyDetectorRestClient class.\n * @param Endpoint type: string\n * @param credentials type: KeyCredential\n */\nexport default function createClient(\n Endpoint: string,\n credentials: KeyCredential,\n options: AnomalyDetectorRestClientOptions = {}\n): AnomalyDetectorRestClient {\n const ApiVersion = options.ApiVersion ?? \"v1.1\";\n const baseUrl = options.baseUrl ?? `${Endpoint}/anomalydetector/${ApiVersion}`;\n\n options = {\n ...options,\n credentials: {\n apiKeyHeaderName: \"Ocp-Apim-Subscription-Key\",\n },\n };\n\n const userAgentInfo = `azsdk-js-ai-anomaly-detector-rest/1.0.0-beta.1`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`\n : `${userAgentInfo}`;\n options = {\n ...options,\n userAgentOptions: {\n userAgentPrefix,\n },\n };\n\n const client = getClient(baseUrl, credentials, options) as AnomalyDetectorRestClient;\n\n return client;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clientDefinitions.js","sourceRoot":"","sources":["../../src/clientDefinitions.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n DetectUnivariateEntireSeriesParameters,\n DetectUnivariateLastPointParameters,\n DetectUnivariateChangePointParameters,\n GetMultivariateBatchDetectionResultParameters,\n
|
|
1
|
+
{"version":3,"file":"clientDefinitions.js","sourceRoot":"","sources":["../../src/clientDefinitions.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n DetectUnivariateEntireSeriesParameters,\n DetectUnivariateLastPointParameters,\n DetectUnivariateChangePointParameters,\n GetMultivariateBatchDetectionResultParameters,\n TrainMultivariateModelParameters,\n ListMultivariateModelsParameters,\n DeleteMultivariateModelParameters,\n GetMultivariateModelParameters,\n DetectMultivariateBatchAnomalyParameters,\n DetectMultivariateLastAnomalyParameters,\n} from \"./parameters\";\nimport {\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\";\nimport { Client, StreamableMethod } from \"@azure-rest/core-client\";\n\nexport interface DetectUnivariateEntireSeries {\n /**\n * This operation generates a model with an entire series, each point is detected\n * with the same model. With this method, points before and after a certain point\n * are used to determine whether it is an anomaly. The entire detection can give\n * user an overall status of the time series.\n */\n post(\n options: DetectUnivariateEntireSeriesParameters\n ): StreamableMethod<\n DetectUnivariateEntireSeries200Response | DetectUnivariateEntireSeriesDefaultResponse\n >;\n}\n\nexport interface DetectUnivariateLastPoint {\n /**\n * This operation generates a model using the points that you sent into the API,\n * and based on all data to determine whether the last point is anomalous.\n */\n post(\n options: DetectUnivariateLastPointParameters\n ): StreamableMethod<\n DetectUnivariateLastPoint200Response | DetectUnivariateLastPointDefaultResponse\n >;\n}\n\nexport interface DetectUnivariateChangePoint {\n /** Evaluate change point score of every series point */\n post(\n options: DetectUnivariateChangePointParameters\n ): StreamableMethod<\n DetectUnivariateChangePoint200Response | DetectUnivariateChangePointDefaultResponse\n >;\n}\n\nexport interface GetMultivariateBatchDetectionResult {\n /**\n * For asynchronous inference, get multivariate anomaly detection result based on\n * resultId returned by the BatchDetectAnomaly api.\n */\n get(\n options?: GetMultivariateBatchDetectionResultParameters\n ): StreamableMethod<\n | GetMultivariateBatchDetectionResult200Response\n | GetMultivariateBatchDetectionResultDefaultResponse\n >;\n}\n\nexport interface TrainMultivariateModel {\n /**\n * Create and train a multivariate anomaly detection model. The request must\n * include a source parameter to indicate an externally accessible Azure blob\n * storage URI.There are two types of data input: An URI pointed to an Azure blob\n * storage folder which contains multiple CSV files, and each CSV file contains\n * two columns, timestamp and variable. Another type of input is an URI pointed to\n * a CSV file in Azure blob storage, which contains all the variables and a\n * timestamp column.\n */\n post(\n options: TrainMultivariateModelParameters\n ): StreamableMethod<TrainMultivariateModel201Response | TrainMultivariateModelDefaultResponse>;\n /** List models of a resource. */\n get(\n options?: ListMultivariateModelsParameters\n ): StreamableMethod<ListMultivariateModels200Response | ListMultivariateModelsDefaultResponse>;\n}\n\nexport interface DeleteMultivariateModel {\n /** Delete an existing multivariate model according to the modelId */\n delete(\n options?: DeleteMultivariateModelParameters\n ): StreamableMethod<DeleteMultivariateModel204Response | DeleteMultivariateModelDefaultResponse>;\n /**\n * Get detailed information of multivariate model, including the training status\n * and variables used in the model.\n */\n get(\n options?: GetMultivariateModelParameters\n ): StreamableMethod<GetMultivariateModel200Response | GetMultivariateModelDefaultResponse>;\n}\n\nexport interface DetectMultivariateBatchAnomaly {\n /**\n * Submit multivariate anomaly detection task with the modelId of trained model\n * and inference data, the input schema should be the same with the training\n * request. The request will complete asynchronously and return a resultId to\n * query the detection result.The request should be a source link to indicate an\n * externally accessible Azure storage Uri, either pointed to an Azure blob\n * storage folder, or pointed to a CSV file in Azure blob storage.\n */\n post(\n options: DetectMultivariateBatchAnomalyParameters\n ): StreamableMethod<\n DetectMultivariateBatchAnomaly202Response | DetectMultivariateBatchAnomalyDefaultResponse\n >;\n}\n\nexport interface DetectMultivariateLastAnomaly {\n /**\n * Submit multivariate anomaly detection task with the modelId of trained model\n * and inference data, and the inference data should be put into request body in a\n * JSON format. The request will complete synchronously and return the detection\n * immediately in the response body.\n */\n post(\n options: DetectMultivariateLastAnomalyParameters\n ): StreamableMethod<\n DetectMultivariateLastAnomaly200Response | DetectMultivariateLastAnomalyDefaultResponse\n >;\n}\n\nexport interface Routes {\n /** Resource for '/timeseries/entire/detect' has methods for the following verbs: post */\n (path: \"/timeseries/entire/detect\"): DetectUnivariateEntireSeries;\n /** Resource for '/timeseries/last/detect' has methods for the following verbs: post */\n (path: \"/timeseries/last/detect\"): DetectUnivariateLastPoint;\n /** Resource for '/timeseries/changepoint/detect' has methods for the following verbs: post */\n (path: \"/timeseries/changepoint/detect\"): DetectUnivariateChangePoint;\n /** Resource for '/multivariate/detect-batch/\\{resultId\\}' has methods for the following verbs: get */\n (\n path: \"/multivariate/detect-batch/{resultId}\",\n resultId: string\n ): GetMultivariateBatchDetectionResult;\n /** Resource for '/multivariate/models' has methods for the following verbs: post, get */\n (path: \"/multivariate/models\"): TrainMultivariateModel;\n /** Resource for '/multivariate/models/\\{modelId\\}' has methods for the following verbs: delete, get */\n (path: \"/multivariate/models/{modelId}\", modelId: string): DeleteMultivariateModel;\n /** Resource for '/multivariate/models/\\{modelId\\}:detect-batch' has methods for the following verbs: post */\n (\n path: \"/multivariate/models/{modelId}:detect-batch\",\n modelId: string\n ): DetectMultivariateBatchAnomaly;\n /** Resource for '/multivariate/models/\\{modelId\\}:detect-last' has methods for the following verbs: post */\n (\n path: \"/multivariate/models/{modelId}:detect-last\",\n modelId: string\n ): DetectMultivariateLastAnomaly;\n}\n\nexport type AnomalyDetectorRestClient = Client & {\n path: Routes;\n};\n"]}
|
package/dist-esm/src/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,mBAAmB,MAAM,uBAAuB,CAAC;AAExD,cAAc,uBAAuB,CAAC;AACtC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,mBAAmB,MAAM,uBAAuB,CAAC;AAExD,cAAc,uBAAuB,CAAC;AACtC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AAEjC,eAAe,mBAAmB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport AnomalyDetectorRest from \"./anomalyDetectorRest\";\n\nexport * from \"./anomalyDetectorRest\";\nexport * from \"./parameters\";\nexport * from \"./responses\";\nexport * from \"./clientDefinitions\";\nexport * from \"./isUnexpected\";\nexport * from \"./models\";\nexport * from \"./outputModels\";\nexport * from \"./paginateHelper\";\n\nexport default AnomalyDetectorRest;\n"]}
|
|
@@ -10,7 +10,6 @@ const responseMap = {
|
|
|
10
10
|
"DELETE /multivariate/models/{modelId}": ["204"],
|
|
11
11
|
"GET /multivariate/models/{modelId}": ["200"],
|
|
12
12
|
"POST /multivariate/models/{modelId}:detect-batch": ["202"],
|
|
13
|
-
"GET /multivariate/models/{modelId}:detect-batch": ["202"],
|
|
14
13
|
"POST /multivariate/models/{modelId}:detect-last": ["200"],
|
|
15
14
|
};
|
|
16
15
|
export function isUnexpected(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,CAAC,GAAG,MAAA,cAAc,CAAC,CAAC,CAAC,0CAAE,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC,IAAI,CAC1E,SAAS,CAAC,CAAC,CAAC,IAAI,EAAE,CACnB,CAAC;gBAEF,IAAI,CAAC,SAAS,EAAE;oBACd,KAAK,GAAG,KAAK,CAAC;oBACd,MAAM;iBACP;gBACD,SAAS;aACV;YAED,8CAA8C;YAC9C,wDAAwD;YACxD,2CAA2C;YAC3C,IAAI,cAAc,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE;gBACtC,KAAK,GAAG,KAAK,CAAC;gBACd,MAAM;aACP;SACF;QAED,qDAAqD;QACrD,sEAAsE;QACtE,IAAI,KAAK,IAAI,aAAa,CAAC,MAAM,GAAG,UAAU,EAAE;YAC9C,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC;YAClC,YAAY,GAAG,KAAK,CAAC;SACtB;KACF;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 {\n DetectUnivariateEntireSeries200Response,\n DetectUnivariateEntireSeriesDefaultResponse,\n DetectUnivariateLastPoint200Response,\n DetectUnivariateLastPointDefaultResponse,\n DetectUnivariateChangePoint200Response,\n DetectUnivariateChangePointDefaultResponse,\n GetMultivariateBatchDetectionResult200Response,\n GetMultivariateBatchDetectionResultDefaultResponse,\n CreateAndTrainMultivariateModel201Response,\n CreateAndTrainMultivariateModelDefaultResponse,\n ListMultivariateModels200Response,\n ListMultivariateModelsDefaultResponse,\n DeleteMultivariateModel204Response,\n DeleteMultivariateModelDefaultResponse,\n GetMultivariateModel200Response,\n GetMultivariateModelDefaultResponse,\n DetectMultivariateBatchAnomaly202Response,\n DetectMultivariateBatchAnomalyDefaultResponse,\n DetectMultivariateLastAnomaly200Response,\n DetectMultivariateLastAnomalyDefaultResponse,\n} from \"./responses\";\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 \"GET /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:\n | CreateAndTrainMultivariateModel201Response\n | CreateAndTrainMultivariateModelDefaultResponse\n): response is CreateAndTrainMultivariateModelDefaultResponse;\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 | CreateAndTrainMultivariateModel201Response\n | CreateAndTrainMultivariateModelDefaultResponse\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 | CreateAndTrainMultivariateModelDefaultResponse\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"]}
|
|
1
|
+
{"version":3,"file":"isUnexpected.js","sourceRoot":"","sources":["../../src/isUnexpected.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAyBlC,MAAM,WA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AE;oBACd,KAAK,GAAG,KAAK,CAAC;oBACd,MAAM;iBACP;gBACD,SAAS;aACV;YAED,8CAA8C;YAC9C,wDAAwD;YACxD,2CAA2C;YAC3C,IAAI,cAAc,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE;gBACtC,KAAK,GAAG,KAAK,CAAC;gBACd,MAAM;aACP;SACF;QAED,qDAAqD;QACrD,sEAAsE;QACtE,IAAI,KAAK,IAAI,aAAa,CAAC,MAAM,GAAG,UAAU,EAAE;YAC9C,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC;YAClC,YAAY,GAAG,KAAK,CAAC;SACtB;KACF;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 {\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\";\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"]}
|
|
@@ -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 license.\n\n/** The request of entire or last anomaly detection. */\nexport interface
|
|
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"]}
|
|
@@ -1 +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\n/** The response of entire anomaly detection. */\nexport interface EntireDetectResponseOutput {\n /** Frequency extracted from the series, zero means no recurrent pattern has been found. */\n period: number;\n /** ExpectedValues contain expected value for each input point. The index of the array is consistent with the input series. */\n expectedValues: Array<number>;\n /** UpperMargins contain upper margin of each input point. UpperMargin is used to calculate upperBoundary, which equals to expectedValue + (100 - marginScale)*upperMargin. Anomalies in response can be filtered by upperBoundary and lowerBoundary. By adjusting marginScale value, less significant anomalies can be filtered in client side. The index of the array is consistent with the input series. */\n upperMargins: Array<number>;\n /** LowerMargins contain lower margin of each input point. LowerMargin is used to calculate lowerBoundary, which equals to expectedValue - (100 - marginScale)*lowerMargin. Points between the boundary can be marked as normal ones in client side. The index of the array is consistent with the input series. */\n lowerMargins: Array<number>;\n /** IsAnomaly contains anomaly properties for each input point. True means an anomaly either negative or positive has been detected. The index of the array is consistent with the input series. */\n isAnomaly: Array<boolean>;\n /** IsNegativeAnomaly contains anomaly status in negative direction for each input point. True means a negative anomaly has been detected. A negative anomaly means the point is detected as an anomaly and its real value is smaller than the expected one. The index of the array is consistent with the input series. */\n isNegativeAnomaly: Array<boolean>;\n /** IsPositiveAnomaly contain anomaly status in positive direction for each input point. True means a positive anomaly has been detected. A positive anomaly means the point is detected as an anomaly and its real value is larger than the expected one. The index of the array is consistent with the input series. */\n isPositiveAnomaly: Array<boolean>;\n /** The severity score for each input point. The larger the value is, the more sever the anomaly is. For normal points, the \"severity\" is always 0. */\n severity?: Array<number>;\n}\n\n/** Error information returned by the API. */\nexport interface AnomalyDetectorErrorOutput {\n /** The error code. */\n code?:\n | \"InvalidCustomInterval\"\n | \"BadArgument\"\n | \"InvalidGranularity\"\n | \"InvalidPeriod\"\n | \"InvalidModelArgument\"\n | \"InvalidSeries\"\n | \"InvalidJsonFormat\"\n | \"RequiredGranularity\"\n | \"RequiredSeries\"\n | \"InvalidImputeMode\"\n | \"InvalidImputeFixedValue\";\n /** A message explaining the error reported by the service. */\n message?: string;\n}\n\n/** The response of last anomaly detection. */\nexport interface LastDetectResponseOutput {\n /** Frequency extracted from the series, zero means no recurrent pattern has been found. */\n period: number;\n /** Suggested input series points needed for detecting the latest point. */\n suggestedWindow: number;\n /** Expected value of the latest point. */\n expectedValue: number;\n /** Upper margin of the latest point. UpperMargin is used to calculate upperBoundary, which equals to expectedValue + (100 - marginScale)*upperMargin. If the value of latest point is between upperBoundary and lowerBoundary, it should be treated as normal value. By adjusting marginScale value, anomaly status of latest point can be changed. */\n upperMargin: number;\n /** Lower margin of the latest point. LowerMargin is used to calculate lowerBoundary, which equals to expectedValue - (100 - marginScale)*lowerMargin. */\n lowerMargin: number;\n /** Anomaly status of the latest point, true means the latest point is an anomaly either in negative direction or positive direction. */\n isAnomaly: boolean;\n /** Anomaly status in negative direction of the latest point. True means the latest point is an anomaly and its real value is smaller than the expected one. */\n isNegativeAnomaly: boolean;\n /** Anomaly status in positive direction of the latest point. True means the latest point is an anomaly and its real value is larger than the expected one. */\n isPositiveAnomaly: boolean;\n /** The severity score for the last input point. The larger the value is, the more sever the anomaly is. For normal points, the \"severity\" is always 0. */\n severity?: number;\n}\n\n/** The response of change point detection. */\nexport interface ChangePointDetectResponseOutput {\n /** Frequency extracted from the series, zero means no recurrent pattern has been found. */\n period?: number;\n /** isChangePoint contains change point properties for each input point. True means an anomaly either negative or positive has been detected. The index of the array is consistent with the input series. */\n isChangePoint?: Array<boolean>;\n /** the change point confidence of each point */\n confidenceScores?: Array<number>;\n}\n\n/** Detection results for the given resultId. */\nexport interface DetectionResultOutput {\n /**\n * Result identifier, which is used to fetch the results of an inference call.\n *\n * Value may contain a UUID\n */\n resultId: string;\n /** Multivariate anomaly detection status. */\n summary: DetectionResultSummaryOutput;\n /** Detection result for each timestamp. */\n results: Array<AnomalyStateOutput>;\n}\n\n/** Multivariate anomaly detection status. */\nexport interface DetectionResultSummaryOutput {\n /** Status of detection results. One of CREATED, RUNNING, READY, and FAILED. */\n status: \"CREATED\" | \"RUNNING\" | \"READY\" | \"FAILED\";\n /** Error message when detection is failed. */\n errors?: Array<ErrorResponseOutput>;\n variableStates?: Array<VariableStateOutput>;\n /** Detection request for batch inference. This is an asynchronous inference which will need another API to get detection results. */\n setupInfo: DetectionRequestOutput;\n}\n\nexport interface ErrorResponseOutput {\n /** The error code. */\n code: string;\n /** The message explaining the error reported by the service. */\n message: string;\n}\n\nexport interface VariableStateOutput {\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?: string;\n /** Last valid timestamp with value of input data. */\n lastTimestamp?: string;\n}\n\n/** Detection request for batch inference. This is an asynchronous inference which will need another API to get detection results. */\nexport interface DetectionRequestOutput {\n /** Source link to the input data to indicate an accessible Azure storage Uri, either pointed to an Azure blob storage folder, or pointed to a CSV file in Azure blob storage based on you data schema selection. The data schema should be exactly the same with those used in the training phase. */\n dataSource: string;\n /** An optional field, which is used to specify the number of top contributed variables for one anomalous timestamp in the response. The default number is 10. */\n topContributorCount: number;\n /** A required field, indicating the start time of data for detection, which should be date-time of ISO 8601 format. */\n startTime: string;\n /** A required field, indicating the end time of data for detection, which should be date-time of ISO 8601 format. */\n endTime: string;\n}\n\nexport interface AnomalyStateOutput {\n /** The timestamp for this anomaly. */\n timestamp: string;\n value?: AnomalyValueOutput;\n /** Error message for the current timestamp. */\n errors?: Array<ErrorResponseOutput>;\n}\n\nexport interface AnomalyValueOutput {\n /** True if an anomaly is detected at the current timestamp. */\n isAnomaly: boolean;\n /** Indicates the significance of the anomaly. The higher the severity, the more significant the anomaly is. */\n severity: number;\n /** Raw anomaly score of severity, will help indicate the degree of abnormality as well. */\n score: number;\n interpretation?: Array<AnomalyValueInterpretationItemOutput>;\n}\n\n/** Interpretation contains more details of the anomaly, which will help with root cause analysis. */\nexport interface AnomalyValueInterpretationItemOutput extends AnomalyInterpretationOutput {}\n\nexport interface AnomalyInterpretationOutput {\n /** Variable. */\n variable?: string;\n /** This score shows the percentage contributing to the anomalous timestamp. A number between 0 and 1. */\n contributionScore?: number;\n correlationChanges?: CorrelationChangesOutput;\n}\n\nexport interface CorrelationChangesOutput {\n /** The correlated variables that have correlation changes under an anomaly. */\n changedVariables?: Array<string>;\n}\n\n/** Training result of a model including its status, errors and diagnostics information. */\nexport interface ModelInfoOutput {\n /** Source link to the input data to indicate an accessible Azure storage Uri, either pointed to an Azure blob storage folder, or pointed to a CSV file in Azure blob storage based on you data schema selection. */\n dataSource: string;\n /** Data schema of input data source: OneTable or MultiTable. The default DataSchema is OneTable. */\n dataSchema?: \"OneTable\" | \"MultiTable\";\n /** A required field, indicating the start time of training data, which should be date-time of ISO 8601 format. */\n startTime: string;\n /** A required field, indicating the end time of training data, which should be date-time of ISO 8601 format. */\n endTime: string;\n /** An optional field. The display name of the model whose maximum length is 24 characters. */\n displayName?: string;\n /** An optional field, indicating how many previous timestamps will be used to detect whether the timestamp is anomaly or not. */\n slidingWindow?: number;\n /** An optional field, indicating the manner to align multiple variables. */\n alignPolicy?: AlignPolicyOutput;\n /** Model status. One of CREATED, RUNNING, READY, and FAILED. */\n status?: \"CREATED\" | \"RUNNING\" | \"READY\" | \"FAILED\";\n /** Error messages when failed to create a model. */\n errors?: Array<ErrorResponseOutput>;\n /** Diagnostics information to help inspect the states of model or variable. */\n diagnosticsInfo?: DiagnosticsInfoOutput;\n}\n\n/** An optional field, indicating the manner to align multiple variables. */\nexport interface AlignPolicyOutput {\n /** An optional field, indicating how to align different variables to the same time-range. Either Inner or Outer. */\n alignMode?: \"Inner\" | \"Outer\";\n /** An optional field, indicating how missing values will be filled. One of Previous, Subsequent, Linear, Zero, Fixed. */\n fillNAMethod?: \"Previous\" | \"Subsequent\" | \"Linear\" | \"Zero\" | \"Fixed\";\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 DiagnosticsInfoOutput {\n modelState?: ModelStateOutput;\n variableStates?: Array<VariableStateOutput>;\n}\n\nexport interface ModelStateOutput {\n /** This indicates the number of passes of the entire training dataset the algorithm has completed. */\n epochIds?: Array<number>;\n /** List of metrics used to assess how the model fits the training data for each epoch. */\n trainLosses?: Array<number>;\n /** List of metrics used to assess how the model fits the validation set for each epoch. */\n validationLosses?: Array<number>;\n /** Latency for each epoch. */\n latenciesInSeconds?: Array<number>;\n}\n\n/** Response of getting a model. */\nexport interface ModelOutput {\n /**\n * Model identifier.\n *\n * Value may contain a UUID\n */\n modelId: string;\n /** Date and time (UTC) when the model was created. */\n createdTime: string;\n /** Date and time (UTC) when the model was last updated. */\n lastUpdatedTime: string;\n /** Training result of a model including its status, errors and diagnostics information. */\n modelInfo?: ModelInfoOutput;\n}\n\n/** Response of listing models. */\nexport interface ModelListOutput {\n /** List of models. */\n models: Array<ModelOutput>;\n /** Number of trained multivariate models. */\n currentCount: number;\n /** Maximum number of models that can be trained for this Anomaly Detector resource. */\n maxCount: number;\n /** The link to fetch more models. */\n nextLink?: string;\n}\n\nexport interface LastDetectionResultOutput {\n variableStates?: Array<VariableStateOutput>;\n results?: Array<AnomalyStateOutput>;\n}\n"]}
|
|
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\n/** The response of entire anomaly detection. */\nexport interface UnivariateEntireDetectionResultOutput {\n /**\n * Frequency extracted from the series, zero means no recurrent pattern has been\n * found.\n */\n period: number;\n /**\n * ExpectedValues contain expected value for each input point. The index of the\n * array is consistent with the input series.\n */\n expectedValues: number[];\n /**\n * UpperMargins contain upper margin of each input point. UpperMargin is used to\n * calculate upperBoundary, which equals to expectedValue + (100 -\n * marginScale)*upperMargin. Anomalies in response can be filtered by\n * upperBoundary and lowerBoundary. By adjusting marginScale value, less\n * significant anomalies can be filtered in client side. The index of the array is\n * consistent with the input series.\n */\n upperMargins: number[];\n /**\n * LowerMargins contain lower margin of each input point. LowerMargin is used to\n * calculate lowerBoundary, which equals to expectedValue - (100 -\n * marginScale)*lowerMargin. Points between the boundary can be marked as normal\n * ones in client side. The index of the array is consistent with the input\n * series.\n */\n lowerMargins: number[];\n /**\n * IsAnomaly contains anomaly properties for each input point. True means an\n * anomaly either negative or positive has been detected. The index of the array\n * is consistent with the input series.\n */\n isAnomaly: boolean[];\n /**\n * IsNegativeAnomaly contains anomaly status in negative direction for each input\n * point. True means a negative anomaly has been detected. A negative anomaly\n * means the point is detected as an anomaly and its real value is smaller than\n * the expected one. The index of the array is consistent with the input series.\n */\n isNegativeAnomaly: boolean[];\n /**\n * IsPositiveAnomaly contain anomaly status in positive direction for each input\n * point. True means a positive anomaly has been detected. A positive anomaly\n * means the point is detected as an anomaly and its real value is larger than the\n * expected one. The index of the array is consistent with the input series.\n */\n isPositiveAnomaly: boolean[];\n /**\n * The severity score for each input point. The larger the value is, the more\n * sever the anomaly is. For normal points, the \"severity\" is always 0.\n */\n severity?: number[];\n}\n\n/** Error information returned by the API. */\nexport interface AnomalyDetectorErrorOutput {\n /**\n * The error code.\n *\n * Possible values: InvalidCustomInterval, BadArgument, InvalidGranularity, InvalidPeriod, InvalidModelArgument, InvalidSeries, InvalidJsonFormat, RequiredGranularity, RequiredSeries, InvalidImputeMode, InvalidImputeFixedValue\n */\n code?: string;\n /** A message explaining the error reported by the service. */\n message?: string;\n}\n\n/** The response of last anomaly detection. */\nexport interface UnivariateLastDetectionResultOutput {\n /**\n * Frequency extracted from the series, zero means no recurrent pattern has been\n * found.\n */\n period: number;\n /** Suggested input series points needed for detecting the latest point. */\n suggestedWindow: number;\n /** Expected value of the latest point. */\n expectedValue: number;\n /**\n * Upper margin of the latest point. UpperMargin is used to calculate\n * upperBoundary, which equals to expectedValue + (100 - marginScale)*upperMargin.\n * If the value of latest point is between upperBoundary and lowerBoundary, it\n * should be treated as normal value. By adjusting marginScale value, anomaly\n * status of latest point can be changed.\n */\n upperMargin: number;\n /**\n * Lower margin of the latest point. LowerMargin is used to calculate\n * lowerBoundary, which equals to expectedValue - (100 - marginScale)*lowerMargin.\n *\n */\n lowerMargin: number;\n /**\n * Anomaly status of the latest point, true means the latest point is an anomaly\n * either in negative direction or positive direction.\n */\n isAnomaly: boolean;\n /**\n * Anomaly status in negative direction of the latest point. True means the latest\n * point is an anomaly and its real value is smaller than the expected one.\n */\n isNegativeAnomaly: boolean;\n /**\n * Anomaly status in positive direction of the latest point. True means the latest\n * point is an anomaly and its real value is larger than the expected one.\n */\n isPositiveAnomaly: boolean;\n /**\n * The severity score for the last input point. The larger the value is, the more\n * sever the anomaly is. For normal points, the \"severity\" is always 0.\n */\n severity?: number;\n}\n\n/** The response of change point detection. */\nexport interface UnivariateChangePointDetectionResultOutput {\n /**\n * Frequency extracted from the series, zero means no recurrent pattern has been\n * found.\n */\n readonly period?: number;\n /**\n * isChangePoint contains change point properties for each input point. True means\n * an anomaly either negative or positive has been detected. The index of the\n * array is consistent with the input series.\n */\n isChangePoint?: boolean[];\n /** the change point confidence of each point */\n confidenceScores?: number[];\n}\n\n/** Detection results for the given resultId. */\nexport interface MultivariateDetectionResultOutput {\n /** Result identifier, which is used to fetch the results of an inference call. */\n resultId: string;\n /** Multivariate anomaly detection status. */\n summary: MultivariateBatchDetectionResultSummaryOutput;\n /** Detection result for each timestamp. */\n results: Array<AnomalyStateOutput>;\n}\n\n/** Multivariate anomaly detection status. */\nexport interface MultivariateBatchDetectionResultSummaryOutput {\n /** Status of detection results. One of CREATED, RUNNING, READY, and FAILED. */\n status: \"CREATED\" | \"RUNNING\" | \"READY\" | \"FAILED\";\n /** Error message when detection is failed. */\n errors?: Array<ErrorResponseOutput>;\n /** Variable Status. */\n variableStates?: Array<VariableStateOutput>;\n /**\n * Detection request for batch inference. This is an asynchronous inference which\n * will need another API to get detection results.\n */\n setupInfo: MultivariateBatchDetectionOptionsOutput;\n}\n\n/** ErrorResponse contains code and message that shows the error information. */\nexport interface ErrorResponseOutput {\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 VariableStateOutput {\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?: string;\n /** Last valid timestamp with value of input data. */\n lastTimestamp?: 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 MultivariateBatchDetectionOptionsOutput {\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: 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: string;\n}\n\n/** Anomaly status and information. */\nexport interface AnomalyStateOutput {\n /** The timestamp for this anomaly. */\n timestamp: string;\n /** The detailed value of this anomalous timestamp. */\n value?: AnomalyValueOutput;\n /** Error message for the current timestamp. */\n errors?: Array<ErrorResponseOutput>;\n}\n\n/** Detailed information of the anomalous timestamp. */\nexport interface AnomalyValueOutput {\n /** True if an anomaly is detected at the current timestamp. */\n isAnomaly: boolean;\n /**\n * Indicates the significance of the anomaly. The higher the severity, the more\n * significant the anomaly is.\n */\n severity: number;\n /**\n * Raw anomaly score of severity, will help indicate the degree of abnormality as\n * well.\n */\n score: number;\n /** Interpretation of this anomalous timestamp. */\n interpretation?: Array<AnomalyInterpretationOutput>;\n}\n\n/** Interpretation of the anomalous timestamp. */\nexport interface AnomalyInterpretationOutput {\n /** Variable. */\n variable?: string;\n /**\n * This score shows the percentage contributing to the anomalous timestamp. A\n * number between 0 and 1.\n */\n contributionScore?: number;\n /** Correlation changes among the anomalous variables */\n correlationChanges?: CorrelationChangesOutput;\n}\n\n/** Correlation changes among the anomalous variables */\nexport interface CorrelationChangesOutput {\n /** The correlated variables that have correlation changes under an anomaly. */\n changedVariables?: string[];\n}\n\n/**\n * Training result of a model including its status, errors and diagnostics\n * information.\n */\nexport interface ModelInfoOutput {\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: 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: 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?: AlignPolicyOutput;\n /** Model status. One of CREATED, RUNNING, READY, and FAILED. */\n status?: \"CREATED\" | \"RUNNING\" | \"READY\" | \"FAILED\";\n /** Error messages when failed to create a model. */\n readonly errors?: Array<ErrorResponseOutput>;\n /** Diagnostics information to help inspect the states of model or variable. */\n diagnosticsInfo?: DiagnosticsInfoOutput;\n}\n\n/** An optional field, indicating the manner to align multiple variables. */\nexport interface AlignPolicyOutput {\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 DiagnosticsInfoOutput {\n /** Model status. */\n modelState?: ModelStateOutput;\n /** Variable Status. */\n variableStates?: Array<VariableStateOutput>;\n}\n\n/** Model status. */\nexport interface ModelStateOutput {\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/** Response of getting a model. */\nexport interface AnomalyDetectionModelOutput {\n /** Model identifier. */\n modelId: string;\n /** Date and time (UTC) when the model was created. */\n createdTime: string;\n /** Date and time (UTC) when the model was last updated. */\n lastUpdatedTime: string;\n /**\n * Training result of a model including its status, errors and diagnostics\n * information.\n */\n modelInfo?: ModelInfoOutput;\n}\n\n/** Response of listing models. */\nexport interface ModelListOutput {\n /** List of models. */\n models: Array<AnomalyDetectionModelOutput>;\n /** Number of trained multivariate models. */\n currentCount: number;\n /** Maximum number of models that can be trained for this Anomaly Detector resource. */\n maxCount: number;\n /** The link to fetch more models. */\n nextLink?: string;\n}\n\n/** Results of last detection. */\nexport interface MultivariateLastDetectionResultOutput {\n /** Variable Status. */\n variableStates?: Array<VariableStateOutput>;\n /** Anomaly status and information. */\n results?: Array<AnomalyStateOutput>;\n}\n"]}
|
|
@@ -1 +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
|
|
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 UnivariateDetectionOptions,\n UnivariateChangePointDetectionOptions,\n ModelInfo,\n MultivariateBatchDetectionOptions,\n MultivariateLastDetectionOptions,\n} from \"./models\";\n\nexport interface DetectUnivariateEntireSeriesBodyParam {\n /** Method of univariate anomaly detection. */\n body: UnivariateDetectionOptions;\n}\n\nexport type DetectUnivariateEntireSeriesParameters = DetectUnivariateEntireSeriesBodyParam &\n RequestParameters;\n\nexport interface DetectUnivariateLastPointBodyParam {\n /** Method of univariate anomaly detection. */\n body: UnivariateDetectionOptions;\n}\n\nexport type DetectUnivariateLastPointParameters = DetectUnivariateLastPointBodyParam &\n RequestParameters;\n\nexport interface DetectUnivariateChangePointBodyParam {\n /** Method of univariate anomaly detection. */\n body: UnivariateChangePointDetectionOptions;\n}\n\nexport type DetectUnivariateChangePointParameters = DetectUnivariateChangePointBodyParam &\n RequestParameters;\nexport type GetMultivariateBatchDetectionResultParameters = RequestParameters;\n\nexport interface TrainMultivariateModelBodyParam {\n /** Model information. */\n body: ModelInfo;\n}\n\nexport type TrainMultivariateModelParameters = TrainMultivariateModelBodyParam & RequestParameters;\n\nexport interface ListMultivariateModelsQueryParamProperties {\n /** Skip indicates how many models will be skipped. */\n skip?: number;\n /** Top indicates how many models will be fetched. */\n top?: number;\n}\n\nexport interface ListMultivariateModelsQueryParam {\n queryParameters?: ListMultivariateModelsQueryParamProperties;\n}\n\nexport type ListMultivariateModelsParameters = ListMultivariateModelsQueryParam & RequestParameters;\nexport type DeleteMultivariateModelParameters = RequestParameters;\nexport type GetMultivariateModelParameters = RequestParameters;\n\nexport interface DetectMultivariateBatchAnomalyBodyParam {\n /** Request of multivariate anomaly detection. */\n body: MultivariateBatchDetectionOptions;\n}\n\nexport type DetectMultivariateBatchAnomalyParameters = DetectMultivariateBatchAnomalyBodyParam &\n RequestParameters;\n\nexport interface DetectMultivariateLastAnomalyBodyParam {\n /** Request of last detection. */\n body: MultivariateLastDetectionOptions;\n}\n\nexport type DetectMultivariateLastAnomalyParameters = DetectMultivariateLastAnomalyBodyParam &\n RequestParameters;\n"]}
|
|
@@ -1 +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
|
|
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 UnivariateEntireDetectionResultOutput,\n AnomalyDetectorErrorOutput,\n UnivariateLastDetectionResultOutput,\n UnivariateChangePointDetectionResultOutput,\n MultivariateDetectionResultOutput,\n ErrorResponseOutput,\n AnomalyDetectionModelOutput,\n ModelListOutput,\n MultivariateLastDetectionResultOutput,\n} from \"./outputModels\";\n\n/** The request has succeeded. */\nexport interface DetectUnivariateEntireSeries200Response extends HttpResponse {\n status: \"200\";\n body: UnivariateEntireDetectionResultOutput;\n}\n\nexport interface DetectUnivariateEntireSeriesDefaultHeaders {\n /** Error code. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface DetectUnivariateEntireSeriesDefaultResponse extends HttpResponse {\n status: string;\n body: AnomalyDetectorErrorOutput;\n headers: RawHttpHeaders & DetectUnivariateEntireSeriesDefaultHeaders;\n}\n\n/** The request has succeeded. */\nexport interface DetectUnivariateLastPoint200Response extends HttpResponse {\n status: \"200\";\n body: UnivariateLastDetectionResultOutput;\n}\n\nexport interface DetectUnivariateLastPointDefaultHeaders {\n /** Error code. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface DetectUnivariateLastPointDefaultResponse extends HttpResponse {\n status: string;\n body: AnomalyDetectorErrorOutput;\n headers: RawHttpHeaders & DetectUnivariateLastPointDefaultHeaders;\n}\n\n/** The request has succeeded. */\nexport interface DetectUnivariateChangePoint200Response extends HttpResponse {\n status: \"200\";\n body: UnivariateChangePointDetectionResultOutput;\n}\n\nexport interface DetectUnivariateChangePointDefaultHeaders {\n /** Error code. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface DetectUnivariateChangePointDefaultResponse extends HttpResponse {\n status: string;\n body: AnomalyDetectorErrorOutput;\n headers: RawHttpHeaders & DetectUnivariateChangePointDefaultHeaders;\n}\n\n/** The request has succeeded. */\nexport interface GetMultivariateBatchDetectionResult200Response extends HttpResponse {\n status: \"200\";\n body: MultivariateDetectionResultOutput;\n}\n\nexport interface GetMultivariateBatchDetectionResultDefaultHeaders {\n /** Error code. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface GetMultivariateBatchDetectionResultDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponseOutput;\n headers: RawHttpHeaders & GetMultivariateBatchDetectionResultDefaultHeaders;\n}\n\nexport interface TrainMultivariateModel201Headers {\n /** Location and ID of the model. */\n location: string;\n}\n\n/** The request has succeeded and a new resource has been created as a result. */\nexport interface TrainMultivariateModel201Response extends HttpResponse {\n status: \"201\";\n body: AnomalyDetectionModelOutput;\n headers: RawHttpHeaders & TrainMultivariateModel201Headers;\n}\n\nexport interface TrainMultivariateModelDefaultHeaders {\n /** Error code. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface TrainMultivariateModelDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponseOutput;\n headers: RawHttpHeaders & TrainMultivariateModelDefaultHeaders;\n}\n\n/** The request has succeeded. */\nexport interface ListMultivariateModels200Response extends HttpResponse {\n status: \"200\";\n body: ModelListOutput;\n}\n\nexport interface ListMultivariateModelsDefaultHeaders {\n /** Error code. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface ListMultivariateModelsDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponseOutput;\n headers: RawHttpHeaders & ListMultivariateModelsDefaultHeaders;\n}\n\n/** There is no content to send for this request, but the headers may be useful. */\nexport interface DeleteMultivariateModel204Response extends HttpResponse {\n status: \"204\";\n}\n\nexport interface DeleteMultivariateModelDefaultHeaders {\n /** Error code. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface DeleteMultivariateModelDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponseOutput;\n headers: RawHttpHeaders & DeleteMultivariateModelDefaultHeaders;\n}\n\n/** The request has succeeded. */\nexport interface GetMultivariateModel200Response extends HttpResponse {\n status: \"200\";\n body: AnomalyDetectionModelOutput;\n}\n\nexport interface GetMultivariateModelDefaultHeaders {\n /** Error code. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface GetMultivariateModelDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponseOutput;\n headers: RawHttpHeaders & GetMultivariateModelDefaultHeaders;\n}\n\nexport interface DetectMultivariateBatchAnomaly202Headers {\n /** Id of the detection result. */\n \"operation-id\": string;\n /** Location of the detection result. */\n \"operation-location\": string;\n}\n\n/** The request has been accepted for processing, but processing has not yet completed. */\nexport interface DetectMultivariateBatchAnomaly202Response extends HttpResponse {\n status: \"202\";\n body: MultivariateDetectionResultOutput;\n headers: RawHttpHeaders & DetectMultivariateBatchAnomaly202Headers;\n}\n\nexport interface DetectMultivariateBatchAnomalyDefaultHeaders {\n /** Error code. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface DetectMultivariateBatchAnomalyDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponseOutput;\n headers: RawHttpHeaders & DetectMultivariateBatchAnomalyDefaultHeaders;\n}\n\n/** The request has succeeded. */\nexport interface DetectMultivariateLastAnomaly200Response extends HttpResponse {\n status: \"200\";\n body: MultivariateLastDetectionResultOutput;\n}\n\nexport interface DetectMultivariateLastAnomalyDefaultHeaders {\n /** Error code. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface DetectMultivariateLastAnomalyDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponseOutput;\n headers: RawHttpHeaders & DetectMultivariateLastAnomalyDefaultHeaders;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@azure-rest/ai-anomaly-detector",
|
|
3
3
|
"sdk-type": "client",
|
|
4
4
|
"author": "Microsoft Corporation",
|
|
5
|
-
"version": "1.0.0-
|
|
5
|
+
"version": "1.0.0-beta.1",
|
|
6
6
|
"description": "A generated SDK for AnomalyDetectorRest.",
|
|
7
7
|
"keywords": [
|
|
8
8
|
"node",
|
|
@@ -80,9 +80,9 @@
|
|
|
80
80
|
"rimraf": "^3.0.0",
|
|
81
81
|
"source-map-support": "^0.5.9",
|
|
82
82
|
"typescript": "~4.6.0",
|
|
83
|
-
"@azure/dev-tool": "
|
|
84
|
-
"@azure/eslint-plugin-azure-sdk": "
|
|
85
|
-
"@azure-tools/test-credential": "
|
|
83
|
+
"@azure/dev-tool": "^1.0.0",
|
|
84
|
+
"@azure/eslint-plugin-azure-sdk": "^3.0.0",
|
|
85
|
+
"@azure-tools/test-credential": "^1.0.0",
|
|
86
86
|
"@azure/identity": "^2.0.1",
|
|
87
87
|
"@azure-tools/test-recorder": "^2.0.0",
|
|
88
88
|
"mocha": "^7.1.1",
|