@kumologica/sdk 4.0.0-beta6 → 4.0.0-beta7
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.
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
const path = require('path');
|
|
2
|
+
|
|
3
|
+
exports.command = 'request [email]';
|
|
4
|
+
exports.desc = `Requests a kumologica license for the specified email address.`;
|
|
5
|
+
|
|
6
|
+
exports.builder = (yargs) => {
|
|
7
|
+
yargs
|
|
8
|
+
.positional('email', {
|
|
9
|
+
describe: 'The email address to request the license for.',
|
|
10
|
+
type: 'string',
|
|
11
|
+
|
|
12
|
+
demandOption: true // Makes the positional argument required
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
function isValidEmail(email) {
|
|
17
|
+
return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
exports.handler = async function (argv) {
|
|
21
|
+
|
|
22
|
+
if(!argv.email || !isValidEmail(argv.email)) {
|
|
23
|
+
console.error('Invalid or missing email address. Please provide a valid email address.');
|
|
24
|
+
process.exit(1);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
try {
|
|
28
|
+
const tools = require('../../../src/app/lib/utils/tools.min.js');
|
|
29
|
+
|
|
30
|
+
await tools.license.subscribe(argv.email);
|
|
31
|
+
console.log(`Follow the instructions in your email to complete the license request process.`);
|
|
32
|
+
|
|
33
|
+
} catch (e) {
|
|
34
|
+
console.log(`${e.message}`);
|
|
35
|
+
process.exit(1);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
const path = require('path');
|
|
2
2
|
|
|
3
3
|
exports.command = 'save [key]';
|
|
4
|
-
exports.desc = `Saves kumologica license in local file system
|
|
5
|
-
|
|
6
|
-
Documentation:
|
|
7
|
-
https://docs.kumologica.com/docs/references/cli/LicenseSave.html`;
|
|
4
|
+
exports.desc = `Saves kumologica license in local file system.`;
|
|
8
5
|
|
|
9
6
|
exports.builder = (yargs) => {
|
|
10
7
|
yargs
|
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-beta7",
|
|
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>",
|
|
@@ -84,9 +84,9 @@
|
|
|
84
84
|
"@aws-sdk/credential-providers": "^3.556.0",
|
|
85
85
|
"@aws-sdk/lib-dynamodb": "^3.549.0",
|
|
86
86
|
"@electron/remote": "^2.0.8",
|
|
87
|
-
"@kumologica/builder": "4.0.0-
|
|
88
|
-
"@kumologica/devkit": "4.0.0-
|
|
89
|
-
"@kumologica/runtime": "4.0.0-
|
|
87
|
+
"@kumologica/builder": "4.0.0-beta7",
|
|
88
|
+
"@kumologica/devkit": "4.0.0-beta7",
|
|
89
|
+
"@kumologica/runtime": "4.0.0-beta7",
|
|
90
90
|
"adm-zip": "0.4.13",
|
|
91
91
|
"ajv": "8.10.0",
|
|
92
92
|
"archive-type": "^4.0.0",
|
package/src/app/lib/aws/index.js
CHANGED
|
@@ -575,8 +575,6 @@ if (s.cwevents && s.cwevents.length > 0) {
|
|
|
575
575
|
args["flow-file-name"] = projectInfo.projectFlowName;
|
|
576
576
|
args["zip-file-name"] = settings.zipFileName;
|
|
577
577
|
args.skipPrepare = "true"; // no need for cloudformation prepare
|
|
578
|
-
|
|
579
|
-
this.log(`args: ${JSON.stringify(args)}`);
|
|
580
578
|
|
|
581
579
|
const scriptFileName = exp("cloudformation", "aws", args);
|
|
582
580
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var e,o,n,t,r=require("crypto"),
|
|
1
|
+
var e,o,n,t,r=require("crypto"),s=require("fs"),i=require("path");function l(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function c(){if(!o){o=1;let l="base64";e={subscribe:async function(e){console.log("Requesting license for email: "+e);var r=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(r.ok)return!0;{let e=await r.text();return console.error(`License request failed: ${r.status} `+e),!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 o=Buffer.from("XkI1bxBWOXhHBztkdXIuEXlKLBcSIWstZlEzOEADPyFCCVkUeQNIIxwWDU4QEiEyLHpfOjwHCVNlL3tTFiIvMGkcZCkOBnNgIjtybUckA3x7BRARDElXRxECPlB4OgF4aWIRDQAGLBI2Jns3eTINDkx+XSN9bAAFDHllInIdCEg8SzICC2JJJyl4CGk5JAB/EBQcLW4+dzcuMGxhLglhbHUZF2ZwFQMJEl08cAVfWGd5ADtje34SDUJCHxUlWh83aghXDnJXXwxxCFsUNANhCzJ0MHoiVyEvLlh2OC5gf2UwdGZhDxAvMllUcCgSWl1w",l).toString().split("").reverse().join("");let t="";for(let r=0;r<o.length;r++){let e="34jfd#d-cDFG23@W096ml".charCodeAt(r%21);t+=String.fromCharCode(o.charCodeAt(r)^e)}return Buffer.from(t,l).toString()})();var o=r,[e,t]=e.split(".");if(!e||!t)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"),t=Buffer.from(t,l),o=o.createVerify("SHA256");if(o.update(e),o.end(),!o.verify(publicKeyPem,t))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,r){var o=s,t=i,t=(console.log("saving key to: "+e),t.join(e,"kumologica.license"));try{o.writeFileSync(t,r,"utf-8"),console.log("License saved successfully at: "+t)}catch(e){console.error("Failed to save license: "+e.message)}},read:function(e){var r=s,o=i.join(e,"kumologica.license");try{let e=r.readFileSync(o,"utf-8");return console.log("License read successfully from: "+o),e}catch(e){return null}}}}return e}var a=(()=>{if(t)return n;t=1;var e=c();return n={license:e}})(),u=l(a);module.exports=u;
|