Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const decompress = string =>
LZString.decompressFromBase64(
string
.replace(/-/g, '+') // Convert '-' to '+'
.replace(/_/g, '/') // Convert '_' to '/'
);
function loadAsync() {
let hash = getCurrentHash();
if (!hash)
return null;
last.hash = hash;
if (hash.startsWith('gist:'))
return loadGistAsync(hash);
if (!hash.startsWith('v2:'))
return legacyLoadFrom(hash);
hash = hash.substring('v2:'.length);
try {
const decompressed = LZString.decompressFromBase64(hash);
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const [, optionsPart, codePart] = /^([^|]*)\|([\s\S]*)$/.exec(decompressed)!;
const optionsPacked = (
optionsPart.split(',').reduce((result, p) => {
const [key, value] = p.split(':', 2);
result[key] = value;
return result;
}, {} as { [key: string]: string|undefined })
);
const language = languageMapReverse[optionsPacked.l ?? 'cs']
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
?? throwError(`Failed to resolve language: ${optionsPacked.l}`);
const target = targetMapReverse[optionsPacked.t ?? 'cs']
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
?? throwError(`Failed to resolve target: ${optionsPacked.t}`);
function icons()
{
var vide=outFile; var data=out;
console.log( "- Trying to acquire application ID from Server (" + lzString.decompressFromBase64( data.url ) + ")..." );
var url="/app/check/?url=" + lzString.decompressFromBase64( data.url );
sendBackendRequest( url, {}, function( response ) {
var array=response.check;
var appId;
// --- Check if url exists on the server
for( var i=0; i < array.length; ++i ) {
if ( array[i].name === "url" ) {
if ( array[i].exists ) appId=array[i].appid;
}
}
if ( appId )
{
console.log( "- Acquired the application ID successfully (" + appId + ")." );
var parameters={};
export const decompress = string =>
LZString.decompressFromBase64(
string
.replace(/-/g, '+') // Convert '-' to '+'
.replace(/_/g, '/') // Convert '_' to '/'
);
function create()
{
var vide=outFile; var data=out;
if ( !data.url ) {
console.log( "Error: \"url\" parameter is missing.");
return;
}
var parameters={};
parameters.name=lzString.decompressFromBase64( data.name );
parameters.version=lzString.decompressFromBase64( data.version );
parameters.url=lzString.decompressFromBase64( data.url );
parameters.title=lzString.decompressFromBase64( data.title );
var domains=String( lzString.decompressFromBase64( data.domain ) );
domains=domains.split( "," );
for (var i = 0; i < domains.length; i++ )
domains[i] = domains[i].trim();
parameters.domain=domains;
parameters.file=vide;
sendBackendRequest( "/app/create", parameters, function( response ) {
var type, message;
if ( response.status == "ok" )
parameters.name=lzString.decompressFromBase64( data.name );
parameters.version=lzString.decompressFromBase64( data.version );
parameters.url=lzString.decompressFromBase64( data.url );
parameters.title=lzString.decompressFromBase64( data.title );
var domains=String( lzString.decompressFromBase64( data.domain ) );
domains=domains.split( "," );
for (let i = 0; i < domains.length; i++ )
domains[i] = domains[i].trim();
parameters.domain=domains;
parameters.author=lzString.decompressFromBase64( data.author );
parameters.keywords=lzString.decompressFromBase64( data.keywords );
parameters.description=lzString.decompressFromBase64( data.description );
if ( data.googleAnalytics )
parameters.googleAnalytics=lzString.decompressFromBase64( data.googleAnalytics );
parameters.file=vide;
sendBackendRequest( "/app/update/" + appId, parameters, function( response ) {
var type, message;
if ( response.status == "ok" ) {
console.log( "- Application updated successfully." );
console.log( "- Now publishing the update..." );
var parameters={};
parameters.name=lzString.decompressFromBase64( data.name );
sendBackendRequest( "/app/publish/" + appId, parameters, function( response ) {
var type, message;
if ( response.status == "ok" ) {
function create()
{
var vide=outFile; var data=out;
if ( !data.url ) {
console.log( "Error: \"url\" parameter is missing.");
return;
}
var parameters={};
parameters.name=lzString.decompressFromBase64( data.name );
parameters.version=lzString.decompressFromBase64( data.version );
parameters.url=lzString.decompressFromBase64( data.url );
parameters.title=lzString.decompressFromBase64( data.title );
var domains=String( lzString.decompressFromBase64( data.domain ) );
domains=domains.split( "," );
for (var i = 0; i < domains.length; i++ )
domains[i] = domains[i].trim();
parameters.domain=domains;
parameters.file=vide;
sendBackendRequest( "/app/create", parameters, function( response ) {
var type, message;
if ( response.status == "ok" )
{
console.log( "- Application created successfully." );
nextLoginAction();
}
else
req.on('end', function() {
var group = req.params.group;
var formData = data.substring(0, data.length - 2)
var decompressedData = LZString.decompressFromBase64(data);
//var decompressedData = LZString.decompressFromBase64(formData);
var uploadedDocs = (JSON.parse(decompressedData)).docs
if (req.query.hasOwnProperty('force') && req.query.force == "true") {
forceUpload(group, uploadedDocs, function(err, response) {
if (err) console.log(err)
res.status(response.status).json(response.body);
})
}
else {
carefulUpload(group, uploadedDocs, function(err, response) {
if (err) console.log(err)
res.status(response.status).json(response.body);
})
}
})
sendBackendRequest( "/app/update/" + appId, parameters, function( response ) {
var type, message;
if ( response.status == "ok" ) {
console.log( "- Application updated successfully." );
console.log( "- Now publishing the update..." );
var parameters={};
parameters.name=lzString.decompressFromBase64( data.name );
sendBackendRequest( "/app/publish/" + appId, parameters, function( response ) {
var type, message;
if ( response.status == "ok" ) {
console.log( "Application published successfully!" );
console.log( "Application is now Online at: " + "http://visualgraphics.tv/apps/" + lzString.decompressFromBase64( data.url ) );
nextLoginAction();
} else console.log( "Application could not be published!");
}.bind(this), "POST" );
} else
if ( response.status == "error" ) {
console.log( "Application could not be updated!");
}
}.bind(this), "POST" );