UNPKG

lisenser

Version:

Official JavaScript SDK for Lisenser API (https://lisenser.com/)

87 lines (81 loc) 3.68 kB
import * as $hgUW1$process from "process"; import $hgUW1$axios from "axios"; const $149c1bd638913645$var$API_URL = "https://api.lisenser.com/v1"; async function $149c1bd638913645$export$ebe47cd59cea4b9b(req) { const { licenseKey: key , machineId: machineId , productId: productId } = req; const urlSuffix = req.polling ? "?plg=true" : ""; const url = `${$149c1bd638913645$var$API_URL}/license/status${urlSuffix}`; const resp = await (0, $hgUW1$axios).post(url, { key: key, machineId: machineId, productId: productId }, $149c1bd638913645$var$getHeaders()); return resp.data.data; } async function $149c1bd638913645$export$acdc80cc207756da(req) { const { licenseKey: key , machineId: machineId , productId: productId } = req; const url = `${$149c1bd638913645$var$API_URL}/license/activate`; const resp = await (0, $hgUW1$axios).post(url, { key: key, machineId: machineId, productId: productId }, $149c1bd638913645$var$getHeaders()); return resp.data.data; } async function $149c1bd638913645$export$f75056ad8bae6312(productId, machineId) { const url = `${$149c1bd638913645$var$API_URL}/trial/status`; const resp = await (0, $hgUW1$axios).post(url, { machineId: machineId, productId: productId }, $149c1bd638913645$var$getHeaders()); return resp.data.data; } async function $149c1bd638913645$export$50b198a3e49f7f52(productId, machineId) { const url = `${$149c1bd638913645$var$API_URL}/trial/activate`; const resp = await (0, $hgUW1$axios).post(url, { machineId: machineId, productId: productId }, $149c1bd638913645$var$getHeaders()); return resp.data.data; } async function $149c1bd638913645$export$6d8f8f07e4537969(productId, licenseKey) { const url = `${$149c1bd638913645$var$API_URL}/license/reset/send-otp`; const resp = await (0, $hgUW1$axios).post(url, { key: licenseKey, productId: productId }, $149c1bd638913645$var$getHeaders()); return resp.data.data?.sent; } async function $149c1bd638913645$export$7f962e2ef5df702b(otp, productId, licenseKey) { const url = `${$149c1bd638913645$var$API_URL}/license/reset/commit`; const resp = await (0, $hgUW1$axios).post(url, { key: licenseKey, productId: productId, otp: otp }, $149c1bd638913645$var$getHeaders()); return resp.data.data?.reset; } async function $149c1bd638913645$export$6c2bd30bee35e307(req) { const { licenseKey: key , machineId: machineId , productId: productId } = req; const url = `${$149c1bd638913645$var$API_URL}/3rd-party-token/generate`; const resp = await (0, $hgUW1$axios).post(url, { key: key, machineId: machineId, productId: productId }, $149c1bd638913645$var$getHeaders()); return resp.data.data.token; } function $149c1bd638913645$var$getHeaders() { // @ts-ignore if (typeof $hgUW1$process === "undefined") return {}; // @ts-ignore const { platform: platform } = $hgUW1$process; if (!platform) return {}; return { headers: { "User-Agent": `Lisenser JS SDK / ${platform}` } }; } export {$149c1bd638913645$export$ebe47cd59cea4b9b as getLicenseStatus, $149c1bd638913645$export$acdc80cc207756da as activateLicenseKey, $149c1bd638913645$export$f75056ad8bae6312 as getTrialStatus, $149c1bd638913645$export$50b198a3e49f7f52 as startTrial, $149c1bd638913645$export$6d8f8f07e4537969 as requestOtpForLicenseReset, $149c1bd638913645$export$7f962e2ef5df702b as resetLicense, $149c1bd638913645$export$6c2bd30bee35e307 as generate3rdPartyToken}; //# sourceMappingURL=module.js.map