1"use strict"; 2var __importDefault = (this && this.__importDefault) || function (mod) { 3 return (mod && mod.__esModule) ? mod : { "default": mod }; 4}; 5Object.defineProperty(exports, "__esModule", { value: true }); 6exports.getUserAgent = void 0; 7/* 8Copyright 2022 The Sigstore Authors. 9 10Licensed under the Apache License, Version 2.0 (the "License"); 11you may not use this file except in compliance with the License. 12You may obtain a copy of the License at 13 14 http://www.apache.org/licenses/LICENSE-2.0 15 16Unless required by applicable law or agreed to in writing, software 17distributed under the License is distributed on an "AS IS" BASIS, 18WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19See the License for the specific language governing permissions and 20limitations under the License. 21*/ 22const os_1 = __importDefault(require("os")); 23// Format User-Agent: <product> / <product-version> (<platform>) 24// source: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent 25const getUserAgent = () => { 26 // eslint-disable-next-line @typescript-eslint/no-var-requires 27 const packageVersion = require('../../package.json').version; 28 const nodeVersion = process.version; 29 const platformName = os_1.default.platform(); 30 const archName = os_1.default.arch(); 31 return `sigstore-js/${packageVersion} (Node ${nodeVersion}) (${platformName}/${archName})`; 32}; 33exports.getUserAgent = getUserAgent; 34