{"version":3,"file":"ServerTelemetryEntity.js","sources":["../../../src/cache/entities/ServerTelemetryEntity.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { SERVER_TELEM_CONSTANTS } from \"../../utils/Constants\";\n\nexport class ServerTelemetryEntity {\n failedRequests: Array;\n errors: string[];\n cacheHits: number;\n\n constructor() {\n this.failedRequests = [];\n this.errors = [];\n this.cacheHits = 0;\n }\n\n /**\n * validates if a given cache entry is \"Telemetry\", parses \n * @param key\n * @param entity\n */\n static isServerTelemetryEntity(key: string, entity?: object): boolean {\n\n const validateKey: boolean = key.indexOf(SERVER_TELEM_CONSTANTS.CACHE_KEY) === 0;\n let validateEntity: boolean = true;\n\n if (entity) {\n validateEntity =\n entity.hasOwnProperty(\"failedRequests\") &&\n entity.hasOwnProperty(\"errors\") &&\n entity.hasOwnProperty(\"cacheHits\");\n }\n\n return validateKey && validateEntity;\n }\n}\n"],"names":[],"mappings":";;;;AAAA;;;AAGG;AAIH,IAAA,qBAAA,kBAAA,YAAA;AAKI,IAAA,SAAA,qBAAA,GAAA;AACI,QAAA,IAAI,CAAC,cAAc,GAAG,EAAE,CAAC;AACzB,QAAA,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;AACjB,QAAA,IAAI,CAAC,SAAS,GAAG,CAAC,CAAC;KACtB;AAED;;;;AAIG;AACI,IAAA,qBAAA,CAAA,uBAAuB,GAA9B,UAA+B,GAAW,EAAE,MAAe,EAAA;AAEvD,QAAA,IAAM,WAAW,GAAY,GAAG,CAAC,OAAO,CAAC,sBAAsB,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QACjF,IAAI,cAAc,GAAY,IAAI,CAAC;AAEnC,QAAA,IAAI,MAAM,EAAE;YACR,cAAc;AACV,gBAAA,MAAM,CAAC,cAAc,CAAC,gBAAgB,CAAC;AACvC,oBAAA,MAAM,CAAC,cAAc,CAAC,QAAQ,CAAC;AAC/B,oBAAA,MAAM,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;AAC1C,SAAA;QAED,OAAO,WAAW,IAAI,cAAc,CAAC;KACxC,CAAA;IACL,OAAC,qBAAA,CAAA;AAAD,CAAC,EAAA;;;;"}