@kumologica/sdk 4.0.0-beta10 → 4.0.0-beta11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/cli/utils/license.js
CHANGED
|
@@ -70,8 +70,10 @@ async function promptForLicenseKey() {
|
|
|
70
70
|
|
|
71
71
|
console.log(`📧 Developer license will be requested for: ${email}`);
|
|
72
72
|
|
|
73
|
-
await tools.license.subscribe(email);
|
|
74
|
-
|
|
73
|
+
const res = await tools.license.subscribe(email);
|
|
74
|
+
if (res) {
|
|
75
|
+
console.log(`Follow the instructions in your email to complete the process.`);
|
|
76
|
+
}
|
|
75
77
|
|
|
76
78
|
return false;
|
|
77
79
|
} else {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kumologica/sdk",
|
|
3
|
-
"version": "4.0.0-
|
|
3
|
+
"version": "4.0.0-beta11",
|
|
4
4
|
"productName": "Kumologica Designer",
|
|
5
5
|
"copyright": "Copyright 2020 Kumologica Pty Ltd, All Rights Reserved.",
|
|
6
6
|
"author": "Kumologica Pty Ltd <contact@kumologica.com>",
|
|
@@ -88,9 +88,9 @@
|
|
|
88
88
|
"@aws-sdk/signature-v4": "^3.370.0",
|
|
89
89
|
"@aws-sdk/types": "^3.936.0",
|
|
90
90
|
"@electron/remote": "^2.0.8",
|
|
91
|
-
"@kumologica/builder": "4.0.0-
|
|
92
|
-
"@kumologica/devkit": "4.0.0-
|
|
93
|
-
"@kumologica/runtime": "4.0.0-
|
|
91
|
+
"@kumologica/builder": "4.0.0-beta11",
|
|
92
|
+
"@kumologica/devkit": "4.0.0-beta11",
|
|
93
|
+
"@kumologica/runtime": "4.0.0-beta11",
|
|
94
94
|
"ajv": "8.10.0",
|
|
95
95
|
"archive-type": "^4.0.0",
|
|
96
96
|
"basic-auth": "2.0.1",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var e,o,n,
|
|
1
|
+
var e,o,n,r,s=require("crypto"),t=require("fs"),c=require("path");function l(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function i(){if(!o){o=1;let l="base64";e={subscribe:async function(e){console.log("Requesting license for email: "+e);try{var o=await fetch("https://api.infra.kumologica.com/p/signup?x-api-key=RjibYF3qZb2AzmTrPOnV35LfRV798e3Z87vp4izo",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:e})});if(o.ok)return!0;{let e=await o.text();return console.error(`License request failed: ${o.status} `+e),!1}}catch(e){return console.error("Fetch failed (network/socket level):",e.message),console.log("Node version:",process.version),console.log("Timeout being used (default 300s if not set):",fetch.Timeout||"not set"),e.cause&&(console.error("Underlying cause:",e.cause),console.error("Cause name:",e.cause.name),console.error("Cause message:",e.cause.message),console.error("Cause code (if any):",e.cause.code)),!1}},display:function(e){e?(console.log("-------- License Details ----------"),console.log("Subscriber: "+e.sub),console.log("Email: "+e.email),console.log("License Type: "+e.licenseType),console.log("Issued For: "+(e.name||e.email)),console.log("Issued By: "+e.iss),console.log("Issued At: "+new Date(e.iat).toLocaleString()),console.log("Expiry: "+("perpetual"===e.exp?"Perpetual":new Date(e.exp).toLocaleString())),console.log("-----------------------------------")):console.error("Invalid license data.")},verify:function(e){publicKeyPem=(()=>{var r=Buffer.from("XkI1bxBWOXhHBztkdXIuEXlKLBcSIWstZlEzOEADPyFCCVkUeQNIIxwWDU4QEiEyLHpfOjwHCVNlL3tTFiIvMGkcZCkOBnNgIjtybUckA3x7BRARDElXRxECPlB4OgF4aWIRDQAGLBI2Jns3eTINDkx+XSN9bAAFDHllInIdCEg8SzICC2JJJyl4CGk5JAB/EBQcLW4+dzcuMGxhLglhbHUZF2ZwFQMJEl08cAVfWGd5ADtje34SDUJCHxUlWh83aghXDnJXXwxxCFsUNANhCzJ0MHoiVyEvLlh2OC5gf2UwdGZhDxAvMllUcCgSWl1w",l).toString().split("").reverse().join("");let n="";for(let o=0;o<r.length;o++){let e="34jfd#d-cDFG23@W096ml".charCodeAt(o%21);n+=String.fromCharCode(r.charCodeAt(o)^e)}return Buffer.from(n,l).toString()})();var o=s,[e,r]=e.split(".");if(!e||!r)throw new Error("Invalid license format. License may have been tampered.");var e=Buffer.from(e,"base64url").toString("utf-8"),n=JSON.parse(e),e=Buffer.from(e,"utf-8"),r=Buffer.from(r,l),o=o.createVerify("SHA256");if(o.update(e),o.end(),!o.verify(publicKeyPem,r))throw new Error("Invalid license signature. License may have been tampered.");if(!(n&&n.sub&&n.email&&n.iss&&n.iat))throw new Error("Invalid license data. License may have been tampered.");if(n.exp&&("Perpetual"===n.exp||Date.now()>n.exp))throw new Error("License has expired. Please renew your license, contact Kumologica support at contact@kumologica.com.");return n},save:function(e,o){var r=t,n=c,n=(console.log("saving key to: "+e),n.join(e,"kumologica.license"));try{r.writeFileSync(n,o,"utf-8"),console.log("License saved successfully at: "+n)}catch(e){console.error("Failed to save license: "+e.message)}},read:function(e){var o=t,r=c.join(e,"kumologica.license");try{let e=o.readFileSync(r,"utf-8");return console.log("License read successfully from: "+r),e}catch(e){return null}}}}return e}var a=(()=>{if(r)return n;r=1;var e=i();return n={license:e}})(),u=l(a);module.exports=u;
|