2022-12-05 20:53:16 +00:00
|
|
|
module.exports = {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
friendlyName: 'Generate license key',// FUTURE: Rename this to avoid confusion w/ generators. For example: 'Build license key'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
description: 'Generate and return a Fleet Premium license key.',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inputs: {
|
|
|
|
|
numberOfHosts: {
|
|
|
|
|
type: 'number',
|
|
|
|
|
required: true,
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
organization: {
|
|
|
|
|
type: 'string',
|
|
|
|
|
required: true,
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
expiresAt: {
|
|
|
|
|
type: 'number',
|
|
|
|
|
required: true,
|
2023-01-11 17:11:43 +00:00
|
|
|
description: 'A JS timestamp representing when this license will expire.',
|
2022-12-05 20:53:16 +00:00
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
exits: {
|
|
|
|
|
success: {
|
|
|
|
|
outputFriendlyName: 'License key',
|
|
|
|
|
outputType: 'string',
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fn: async function ({numberOfHosts, organization, expiresAt}) {
|
|
|
|
|
|
|
|
|
|
let licenseKey = await sails.helpers.createLicenseKey.with({
|
|
|
|
|
numberOfHosts: numberOfHosts,
|
|
|
|
|
organization: organization,
|
|
|
|
|
expiresAt: expiresAt
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return licenseKey;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
};
|