mirror of
https://github.com/janishutz/libreevent.git
synced 2026-09-22 13:15:25 +02:00
move db to a more accessible folder
This commit is contained in:
1 parent
fb8c3b1824
commit
a9a12d0dc3
11 files changed
+11
-31
No files matched your search
@@ -1 +0,0 @@
|
||||
{"test4":{"secAr4s7":{"id":"secAr4s7","component":1,"ticketOption":"1","eventID":"test4","category":"1","name":"Row 5, Seat 8"},"secAr6s14":{"id":"secAr6s14","component":1,"ticketOption":"2","eventID":"test4","category":"1","name":"Row 7, Seat 15"},"secAr6s10":{"id":"secAr6s10","component":1,"ticketOption":"2","eventID":"test4","category":"1","name":"Row 7, Seat 11"}},"test3":{"ticket1_1":{"id":"ticket1_1","component":1,"ticketOption":"1","eventID":"test3","count":1,"category":"1","name":"Category 1 (Child)"}}}
|
||||
@@ -1 +0,0 @@
|
||||
{"db":{"libreevent_temp":{},"libreevent_admin":{},"libreevent_orders":{},"libreevent_users":{}},"index":{"libreevent_temp":0,"libreevent_admin":0,"libreevent_orders":0,"libreevent_users":0}}
|
||||
@@ -1 +0,0 @@
|
||||
{"test4":{"name":"Test4Event","description":"Let's see what happens if I update the description, how fast it is reflected in the UI","location":"test2","date":"2023-10-30T10:00:00.000Z","categories":{"1":{"price":{"1":20,"2":30},"bg":"#ff0000","fg":"#ff0000","name":"Category 1","id":"1","ticketCount":1}},"ageGroups":{"1":{"id":1,"name":"Child","age":"0 - 15.99"},"2":{"id":2,"name":"Adult"}},"maxTickets":0,"eventID":"test4","time":"10:00:00.000","startingPrice":20,"currency":"CHF","isDraft":true,"locationName":"TestLocation2","hasSeatplan":true,"totalSeats":353},"test3":{"name":"TestEvent3","description":"This is another test event, this time without seat plan","location":"test","date":"2023-11-25T19:00:00.000Z","categories":{"1":{"price":{"1":20,"2":25},"bg":"#FFFFFF","fg":"#000000","name":"Category 1","id":1,"ticketCount":50},"2":{"price":{"1":30,"2":35},"bg":"#FFFFFF","fg":"#000000","name":"Category 2","id":2,"ticketCount":50}},"ageGroups":{"1":{"id":1,"name":"Child","age":"0 - 15.99"},"2":{"id":2,"name":"Adult"}},"maxTickets":0,"eventID":"test3","time":"19:00:00.000","startingPrice":20,"currency":"CHF","locationName":"TestLocation","hasSeatplan":false,"totalSeats":100},"testStanding":{"name":"Standing Test event","description":"Teststsatahadsf","location":"testLocationNoSeatplan","date":"2023-11-25T10:00:00.000Z","categories":{"1":{"price":{"1":10,"2":15},"bg":"#FFFFFF","fg":"#ff0000","name":"Category 1","id":"1","ticketCount":1}},"ageGroups":{"1":{"id":1,"name":"Child","age":"0 - 15.99"},"2":{"id":2,"name":"Adult"}},"maxTickets":0,"eventID":"testStanding","time":"10:00:00.000","startingPrice":10,"currency":"CHF","locationName":"TestLocationWithoutSeatplan","hasSeatplan":true,"totalSeats":1}}
|
||||
@@ -1 +0,0 @@
|
||||
{"test4":{"name":"Test4Event","description":"Let's see what happens if I update the description, how fast it is reflected in the UI","location":"test2","date":"2023-10-30T10:00:00.000Z","categories":{"1":{"price":{"1":20,"2":30},"bg":"#ff0000","fg":"#ff0000","name":"Category 1","id":"1","ticketCount":1}},"ageGroups":{"1":{"id":1,"name":"Child","age":"0 - 15.99"},"2":{"id":2,"name":"Adult"}},"maxTickets":0,"eventID":"test4","time":"10:00:00.000","startingPrice":20,"currency":"CHF","isDraft":true,"locationName":"TestLocation2","hasSeatplan":true,"totalSeats":353},"test3":{"name":"TestEvent3","description":"This is another test event, this time without seat plan","location":"test","date":"2023-11-25T19:00:00.000Z","categories":{"1":{"price":{"1":20,"2":25},"bg":"#FFFFFF","fg":"#000000","name":"Category 1","id":1,"ticketCount":50},"2":{"price":{"1":30,"2":35},"bg":"#FFFFFF","fg":"#000000","name":"Category 2","id":2,"ticketCount":50}},"ageGroups":{"1":{"id":1,"name":"Child","age":"0 - 15.99"},"2":{"id":2,"name":"Adult"}},"maxTickets":0,"eventID":"test3","time":"19:00:00.000","startingPrice":20,"currency":"CHF","locationName":"TestLocation","hasSeatplan":false,"totalSeats":100},"testStanding":{"name":"Standing Test event","description":"Teststsatahadsf","location":"testLocationNoSeatplan","date":"2023-11-25T10:00:00.000Z","categories":{"1":{"price":{"1":10,"2":15},"bg":"#FFFFFF","fg":"#ff0000","name":"Category 1","id":"1","ticketCount":1}},"ageGroups":{"1":{"id":1,"name":"Child","age":"0 - 15.99"},"2":{"id":2,"name":"Adult"}},"maxTickets":0,"eventID":"testStanding","time":"10:00:00.000","startingPrice":10,"currency":"CHF","locationName":"TestLocationWithoutSeatplan","hasSeatplan":true,"totalSeats":1}}
|
||||
@@ -1 +0,0 @@
|
||||
{"test2":{"locationID":"test2","name":"TestLocation2","seatplan-enabled":true,"totalSeats":352},"test":{"locationID":"test","name":"TestLocation","seatplan-enabled":false},"testLocationNoSeatplan":{"locationID":"testLocationNoSeatplan","name":"TestLocationWithoutSeatplan","seatplan-enabled":true,"totalSeats":0}}
|
||||
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"pass": "$2b$10$56u70OdMWo/Jv5lrqaNq8OV7TxTDOPGC9tP8Ea.1zhGluHYTzuTd.",
|
||||
"email": "development@janishutz.com"
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
{"test2":{"draft":{"seatInfo":{"data":{"1":{"0":22,"1":22,"2":22,"3":22,"4":22,"5":22,"6":22,"7":22,"8":22,"9":22,"10":22,"11":22,"12":22,"13":22,"14":22,"15":22}},"count":352},"data":{"1":{"x":296.892,"y":13.495,"h":560.66,"w":728.735,"active":false,"draggable":true,"resizable":true,"id":1,"origin":1,"shape":"rectangular","type":"seat","startingRow":1,"seatNumberingPosition":1,"sector":"A","text":{"text":"TestText","textSize":20,"colour":"#20FFFF"},"numberingDirection":"left","category":"1"},"2":{"x":357.007,"y":660.033,"h":117.775,"w":601.145,"active":false,"draggable":true,"resizable":true,"id":2,"origin":3,"shape":"rectangular","type":"stage","startingRow":1,"seatNumberingPosition":1,"sector":"A","text":{"text":"TestText","textSize":20,"colour":"#20FFFF"},"ticketCount":1,"numberingDirection":"left","category":"1"},"3":{"x":517.721,"y":669.847,"h":80.971,"w":304.253,"active":false,"draggable":true,"resizable":true,"id":3,"origin":1,"shape":"rectangular","type":"text","startingRow":1,"seatNumberingPosition":2,"sector":"A","text":{"text":"Stage","textSize":25,"colour":"#2160ff"},"ticketCount":1,"numberingDirection":"left","category":"1"}}},"save":{"seatInfo":{"data":{"1":{"0":22,"1":22,"2":22,"3":22,"4":22,"5":22,"6":22,"7":22,"8":22,"9":22,"10":22,"11":22,"12":22,"13":22,"14":22,"15":22}},"count":0},"data":{"1":{"x":296.892,"y":13.495,"h":560.66,"w":728.735,"active":false,"draggable":true,"resizable":true,"id":1,"origin":1,"shape":"rectangular","type":"seat","startingRow":1,"seatNumberingPosition":1,"sector":"A","text":{"text":"TestText","textSize":20,"colour":"#20FFFF"},"numberingDirection":"left","category":"1"},"2":{"x":357.375,"y":660.049,"h":117.775,"w":601.145,"active":false,"draggable":true,"resizable":true,"id":2,"origin":3,"shape":"rectangular","type":"stage","startingRow":1,"seatNumberingPosition":1,"sector":"A","text":{"text":"TestText","textSize":20,"colour":"#20FFFF"},"ticketCount":1,"numberingDirection":"left","category":"1"},"3":{"x":517.828,"y":670.99,"h":80.971,"w":304.253,"active":false,"draggable":true,"resizable":true,"id":3,"origin":1,"shape":"rectangular","type":"text","startingRow":1,"seatNumberingPosition":2,"sector":"A","text":{"text":"Stage","textSize":25,"colour":"#2160ff"},"ticketCount":1,"numberingDirection":"left","category":"1"}}}},"test":{"draft":{},"save":{"seatInfo":{"data":{"1":{"0":22}},"count":0},"data":{"1":{"x":427.696,"y":160.539,"h":371.324,"w":734.069,"active":false,"draggable":true,"resizable":true,"id":1,"origin":1,"shape":"rectangular","type":"stand","startingRow":1,"seatNumberingPosition":1,"sector":"A","text":{"text":"TestText","textSize":20,"colour":"#20FFFF"},"numberingDirection":"left","category":"1","ticketCount":50}}}},"testLocationNoSeatplan":{"draft":{},"save":{"seatInfo":{"data":{"1":{"0":9,"1":9,"2":9,"startingRow":1}},"count":0},"data":{"1":{"x":375,"y":169.118,"h":294.118,"w":750,"active":false,"draggable":true,"resizable":true,"id":1,"origin":1,"shape":"rectangular","type":"stand","startingRow":1,"seatNumberingPosition":1,"sector":"A","text":{"text":"TestText","textSize":20,"colour":"#20FFFF"},"numberingDirection":"left","category":"1","ticketCount":50}}}}}
|
||||
@@ -1 +0,0 @@
|
||||
{"test2":{"basePdf":"data:application/pdf;base64,JVBERi0xLjUKJdDUxdgKNiAwIG9iago8PAovTGVuZ3RoIDQ1OSAgICAgICAKL0ZpbHRlciAvRmxhdGVEZWNvZGUKPj4Kc3RyZWFtCnjajVS5jtswEO31FVPKhWaHl0h2iwCJgXQG1ARBCkexHWMlO9kj+f0MKVJiBBvYwhzP4xxvHikSnIBgW9HKCl4JBBiF0kswzqEwFvqx+g0ctIUYWREq7wz8hQlm5OHX6fjY7wWy9xICCDRKI7yDcXIlSdTGKANDBjQ6UhYEelKtZqBFS1bpOXVBeqi006i14YQFHgLMjldWlvnMu/U2hqYmJZSJxKIZzj2HEszUliZxsplJ8EKVlBtczs9ZwQ2/0s+hnPUTqiNUu0lE9NbcEFKgFlaJUswMCWZpqJV2omxROiJ9D/5vvAxKbF2rVRyPBHnOzv3mETNSjJkhrpUrzKSSXeN3xl5Ny0i+gcKg8Ww8n5+NN1AkNSdFl//9mBJPnLYt7FSoaR06p6CxTiGFqzRWH7rq4ZNidiw7cZfuCCkqB3U/4Gv9ZeNUfX173jRKqbo79xvp6qewHF4Dputm2hrO358Phz9x5xLWtH0DGveX/ekwFpiqX67D2+v5etl86z7P/PMn+bGbR1lx5EF2i2BNUqwpJNu9W2ePXop3qEx3Ho5sbxGaa090LnFdvzhNenKa4s25cUySh/OCpbDYmnRMIupW6PUPawb8PwplbmRzdHJlYW0KZW5kb2JqCjExIDAgb2JqCjw8Ci9MZW5ndGgxIDE2NDkKL0xlbmd0aDIgMTE2MzQKL0xlbmd0aDMgMAovTGVuZ3RoIDEyNzA2ICAgICAKL0ZpbHRlciAvRmxhdGVEZWNvZGUKPj4Kc3RyZWFt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HQxH7r4lvFRmK3teFwvsk4r2McZtMgw9Nyvf2GrfV0z6bmngArC/ciGru1lOOhMigmoJWhl5a9YN9x06pWoOpd2UkeWWOi1b0XHNfkFluLVJ+oXZmx6/Ec9pedKSDm+m15HmyRaj0pZl1ZNQ4t8WKiX7z4xfLZkjnrlylg0XLfQZaMZleNcwaIkMUUOJo0aLgvsCFCvm8noXG4bZ16hIzbZobHCNYST8GqPpC1THN8acnkgxwVx4pPjW/9NpU330SCCzJ+m7WfGUJy6BGk9Lk/pXNmQ6ncEL9+QevF9Wr5A1rbHX1mVHFrjcPS8aIjqVPDd4j0QoBKOh44OKbEtp2FYlyINKsvswHAxkKvx195o9Iizq9CyBStuyjoOWvR6/xiOqI8psbFWJ6EIubtdI5dpvVkMYCPa+RCkjMjYcN9SNwiXvOzrWzKl7qaj1duIdk3WAA+9ninB7nyUJcAuzjb+vi3YhOPoZGW7CCfcjQroDaV9MfzaVsiQV4yZRWtCzdx7xJ9YYIzb9lDhF0vynhpmIp3uyJwav4oM7aY+UU+E7UZ6l4ED2oTJuXaFdfX3Q2u2koYgLrJV65JodmxiqIrUlIqGSaKuSg412YXaa4ifiqFK3C6q2qwrVuttXdl08t+kGxYCawXXlb+rzVeFnMEk3dbvFU4tSAydrDjSWfNjfxt0F/QInwurN+ft3XwXxAnKvZ28McV5vYVAiW96c2NNSy3J08kWkKtQxvUtNY3ONiF8zI/JziEHcNuZYodUVBYTplNdAjQ7z0rB35GgQs4AUfroL+QUGz5lRMFX3rl9ZQnmastDRJv/u7+IDlcXAOw07NtdHWTDXj3DCcwfLine truncated
|
||||
@@ -105,7 +105,7 @@ module.exports.checkDataAvailability = ( db, column, searchQuery ) => {
|
||||
|
||||
module.exports.getJSONData = ( file ) => {
|
||||
return new Promise( ( resolve, reject ) => {
|
||||
fs.readFile( path.join( __dirname + '/data/' + file + '.json' ), ( error, data ) => {
|
||||
fs.readFile( path.join( __dirname + '/../../data/' + file + '.json' ), ( error, data ) => {
|
||||
if ( error ) {
|
||||
reject( 'Error occurred: Error trace: ' + error );
|
||||
} else {
|
||||
@@ -121,7 +121,7 @@ module.exports.getJSONData = ( file ) => {
|
||||
|
||||
module.exports.getJSONDataSimple = ( file, identifier ) => {
|
||||
return new Promise( ( resolve, reject ) => {
|
||||
fs.readFile( path.join( __dirname + '/data/' + file + '.json' ), ( error, data ) => {
|
||||
fs.readFile( path.join( __dirname + '/../../data/' + file + '.json' ), ( error, data ) => {
|
||||
if ( error ) {
|
||||
reject( 'Error occurred: Error trace: ' + error );
|
||||
} else {
|
||||
@@ -141,7 +141,7 @@ module.exports.getJSONDataSync = ( file ) => {
|
||||
|
||||
module.exports.writeJSONDataSimple = ( db, identifier, values ) => {
|
||||
return new Promise( ( resolve, reject ) => {
|
||||
fs.readFile( path.join( __dirname + '/data/' + db + '.json' ), ( error, data ) => {
|
||||
fs.readFile( path.join( __dirname + '/../../data/' + db + '.json' ), ( error, data ) => {
|
||||
if ( error ) {
|
||||
reject( 'Error occurred: Error trace: ' + error );
|
||||
} else {
|
||||
@@ -150,7 +150,7 @@ module.exports.writeJSONDataSimple = ( db, identifier, values ) => {
|
||||
dat = JSON.parse( data ) ?? {};
|
||||
}
|
||||
dat[ identifier ] = values;
|
||||
fs.writeFile( path.join( __dirname + '/data/' + db + '.json' ), JSON.stringify( dat ), ( error ) => {
|
||||
fs.writeFile( path.join( __dirname + '/../../data/' + db + '.json' ), JSON.stringify( dat ), ( error ) => {
|
||||
if ( error ) {
|
||||
reject( 'Error occurred: Error trace: ' + error );
|
||||
}
|
||||
@@ -163,7 +163,7 @@ module.exports.writeJSONDataSimple = ( db, identifier, values ) => {
|
||||
|
||||
module.exports.writeJSONData = ( db, data ) => {
|
||||
return new Promise( ( resolve, reject ) => {
|
||||
fs.writeFile( path.join( __dirname + '/data/' + db + '.json' ), JSON.stringify( data ), ( error ) => {
|
||||
fs.writeFile( path.join( __dirname + '/../../data/' + db + '.json' ), JSON.stringify( data ), ( error ) => {
|
||||
if ( error ) {
|
||||
reject( 'Error occurred: Error trace: ' + error );
|
||||
} else {
|
||||
@@ -175,7 +175,7 @@ module.exports.writeJSONData = ( db, data ) => {
|
||||
|
||||
module.exports.deleteJSONDataSimple = ( db, identifier ) => {
|
||||
return new Promise( ( resolve, reject ) => {
|
||||
fs.readFile( path.join( __dirname + '/data/' + db + '.json' ), ( error, data ) => {
|
||||
fs.readFile( path.join( __dirname + '/../../data/' + db + '.json' ), ( error, data ) => {
|
||||
if ( error ) {
|
||||
reject( 'Error occurred: Error trace: ' + error );
|
||||
} else {
|
||||
@@ -184,7 +184,7 @@ module.exports.deleteJSONDataSimple = ( db, identifier ) => {
|
||||
dat = JSON.parse( data ) ?? {};
|
||||
}
|
||||
delete dat[ identifier ];
|
||||
fs.writeFile( path.join( __dirname + '/data/' + db + '.json' ), JSON.stringify( dat ), ( error ) => {
|
||||
fs.writeFile( path.join( __dirname + '/../../data/' + db + '.json' ), JSON.stringify( dat ), ( error ) => {
|
||||
if ( error ) {
|
||||
reject( 'Error occurred: Error trace: ' + error );
|
||||
}
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
/*
|
||||
* libreevent - jsonDataHelper.js
|
||||
*
|
||||
* Created by Janis Hutz 07/16/2023, Licensed under the GPL V3 License
|
||||
* https://janishutz.com, development@janishutz.com
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
// IMPORTANT: Do not use this helper in any other context than in the jsondb.js file!
|
||||
// It is specifically designed for that thing and therefore doesn't use any unnecessary resources!
|
||||
|
||||
|
||||
class DataHelper {
|
||||
constructor () {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = DataHelper;
|
||||
@@ -21,7 +21,7 @@ class JSONDB {
|
||||
connect () {
|
||||
let data = {};
|
||||
try {
|
||||
JSON.parse( fs.readFileSync( path.join( __dirname + '/data/db.json' ) ) );
|
||||
JSON.parse( fs.readFileSync( path.join( __dirname + '/../../data/db.json' ) ) );
|
||||
} catch ( err ) {
|
||||
console.error( '[ JSON-DB ] CRITICAL INITIALIZATION FAILURE!' + err );
|
||||
throw ( 'JSONDB failed to start!' );
|
||||
@@ -44,7 +44,7 @@ class JSONDB {
|
||||
}
|
||||
|
||||
save () {
|
||||
fs.writeFile( path.join( __dirname + '/data/db.json' ), JSON.stringify( { 'db': this.db, 'index': this.dbIndex } ), ( err ) => {
|
||||
fs.writeFile( path.join( __dirname + '/../../data/db.json' ), JSON.stringify( { 'db': this.db, 'index': this.dbIndex } ), ( err ) => {
|
||||
if ( err ) console.error( '[ JSON-DB ] An error occurred during saving: ' + err );
|
||||
this.isSaving = false;
|
||||
if ( this.awaitingSaving ) {
|
||||
@@ -56,13 +56,13 @@ class JSONDB {
|
||||
async resetDB () {
|
||||
this.db = { 'libreevent_temp': {}, 'libreevent_admin': {}, 'libreevent_orders': {}, 'libreevent_users': {} };
|
||||
this.dbIndex = { 'libreevent_temp': 0, 'libreevent_admin': 0, 'libreevent_orders': 0, 'libreevent_users': 0 };
|
||||
fs.writeFile( path.join( __dirname + '/data/db.json' ), JSON.stringify( { 'db': this.db, 'index': this.dbIndex } ) );
|
||||
fs.writeFile( path.join( __dirname + '/../../data/db.json' ), JSON.stringify( { 'db': this.db, 'index': this.dbIndex } ) );
|
||||
}
|
||||
|
||||
async setupDB () {
|
||||
this.db = { 'libreevent_temp': {}, 'libreevent_admin': {}, 'libreevent_orders': {}, 'libreevent_users': {} };
|
||||
this.dbIndex = { 'libreevent_temp': 0, 'libreevent_admin': 0, 'libreevent_orders': 0, 'libreevent_users': 0 };
|
||||
fs.writeFile( path.join( __dirname + '/data/db.json' ), JSON.stringify( { 'db': this.db, 'index': this.dbIndex } ) );
|
||||
fs.writeFile( path.join( __dirname + '/../../data/db.json' ), JSON.stringify( { 'db': this.db, 'index': this.dbIndex } ) );
|
||||
}
|
||||
|
||||
query ( operation, table ) {
|
||||
|
||||
Reference in new issue
Block a user