18 lines
447 B
JavaScript
18 lines
447 B
JavaScript
const { generateEncryptedKey } = require('../utils/retellEncryption');
|
|
|
|
const input = process.argv[2];
|
|
if (!input) {
|
|
console.error('Usage: node src/scripts/generateRetellKey.js "{\"userId\":123}"');
|
|
process.exit(1);
|
|
}
|
|
|
|
let payload;
|
|
try {
|
|
payload = JSON.parse(input);
|
|
} catch (e) {
|
|
console.error('Invalid JSON payload');
|
|
process.exit(1);
|
|
}
|
|
|
|
const encryptedKey = generateEncryptedKey(payload);
|
|
console.log('Encrypted Key:', encryptedKey);
|