UNPKG

@sap_oss/wdio-qmate-service

Version:

[![REUSE status](https://api.reuse.software/badge/github.com/SAP/wdio-qmate-service)](https://api.reuse.software/info/github.com/SAP/wdio-qmate-service)[![Node.js CI](https://github.com/SAP/wdio-qmate-service/actions/workflows/node.js.yml/badge.svg)](http

33 lines 995 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.createUsage = createUsage; const undici_1 = require("undici"); async function createUsage(usageData) { const urlUsage = "https://stats.qmate.proc.only.sap/api/usage/qmate"; try { const response = await (0, undici_1.fetch)(urlUsage, { method: "POST", headers: { "Content-Type": "application/json", }, body: JSON.stringify(usageData), dispatcher: new undici_1.Agent({ connect: { rejectUnauthorized: false, } }) }); if (!response.ok) { return null; } else { const responseText = await response.text(); const responseData = JSON.parse(responseText); return responseData.id; } } catch (error) { return null; } } //# sourceMappingURL=createUsage.js.map