msRestUserAgentPolicy.ts 650 B

123456789101112131415161718192021222324
  1. // Copyright (c) Microsoft Corporation. All rights reserved.
  2. // Licensed under the MIT License. See License.txt in the project root for license information.
  3. import * as os from "os";
  4. import { TelemetryInfo } from "./userAgentPolicy";
  5. import { Constants } from "../util/constants";
  6. export function getDefaultUserAgentKey(): string {
  7. return Constants.HeaderConstants.USER_AGENT;
  8. }
  9. export function getPlatformSpecificData(): TelemetryInfo[] {
  10. const runtimeInfo = {
  11. key: "Node",
  12. value: process.version
  13. };
  14. const osInfo = {
  15. key: "OS",
  16. value: `(${os.arch()}-${os.type()}-${os.release()})`
  17. };
  18. return [runtimeInfo, osInfo];
  19. }