added all files to project

This commit is contained in:
2022-03-10 10:36:59 +01:00
parent 09dd957b33
commit 46a936d7de
25351 changed files with 3883356 additions and 0 deletions
@@ -0,0 +1,40 @@
import { KeyValue } from "./Utils";
export declare const arrayRegex: () => RegExp;
export declare class ArrayInfo {
readonly property: string;
readonly index: number;
readonly append: boolean;
constructor(property: string, index: any);
/**
* Check if the property want to access an Array
* @param property
*/
static processArray(property?: string): ArrayInfo | null;
/**
* Get the index for the array
* @param data
* @param avoidProperty
*/
getIndex(data: KeyValue, avoidProperty?: boolean): number;
/**
* Get the Data
* @param data
*/
getData(data: KeyValue): any;
/**
* Set the data for the array
* @param data
* @param value
*/
setData(data: KeyValue, value: any): void;
/**
* Delete the index from the array
* @param data
*/
delete(data: KeyValue): void;
/**
* Check if the ArrayInfo is valid for the given data
* @param data
*/
isValid(data: KeyValue): boolean;
}
@@ -0,0 +1,112 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ArrayInfo = exports.arrayRegex = void 0;
const Errors_1 = require("./Errors");
function isInt(value) {
return !isNaN(value) &&
Number(value) == value && !isNaN(parseInt(value, 10));
}
const arrayRegex = () => /^([\.0-9a-zA-Z_$\-][0-9a-zA-Z_\-$\.]*)\[((?!(\]|\[)).*|)\]$/gm;
exports.arrayRegex = arrayRegex;
const regexCache = {};
class ArrayInfo {
property;
index = 0;
append = false;
constructor(property, index) {
this.property = property;
this.append = index === "";
if (isInt(index)) {
this.index = parseInt(index);
}
else if (!this.append) {
throw new Errors_1.DataError("Only numerical values accepted for array index", 200);
}
}
/**
* Check if the property want to access an Array
* @param property
*/
static processArray(property) {
if (typeof property === 'undefined') {
return null;
}
if (regexCache[property]) {
return regexCache[property];
}
const arrayIndexRegex = (0, exports.arrayRegex)();
const match = arrayIndexRegex.exec(property.trim());
if (match != null) {
return (regexCache[property] = new ArrayInfo(match[1], match[2]));
}
return null;
}
/**
* Get the index for the array
* @param data
* @param avoidProperty
*/
getIndex(data, avoidProperty) {
if (avoidProperty === undefined) {
avoidProperty = false;
}
if (this.append) {
return -1;
}
const index = this.index;
if (index == -1) {
const dataIterable = avoidProperty ? data : data[this.property];
if (dataIterable.length === 0) {
return 0;
}
return dataIterable.length - 1;
}
return index;
}
/**
* Get the Data
* @param data
*/
getData(data) {
if (this.append) {
throw new Errors_1.DataError("Can't get data when appending", 100);
}
const index = this.getIndex(data);
return data[this.property][index];
}
/**
* Set the data for the array
* @param data
* @param value
*/
setData(data, value) {
if (this.append) {
data[this.property].push(value);
}
else {
const index = this.getIndex(data);
data[this.property][index] = value;
}
}
/**
* Delete the index from the array
* @param data
*/
delete(data) {
if (this.append) {
throw new Errors_1.DataError("Can't delete an appended data", 10);
}
const index = this.getIndex(data);
data[this.property].splice(index, 1);
}
/**
* Check if the ArrayInfo is valid for the given data
* @param data
*/
isValid(data) {
const index = this.getIndex(data);
return data[this.property].hasOwnProperty(index);
}
}
exports.ArrayInfo = ArrayInfo;
//# sourceMappingURL=ArrayInfo.js.map
@@ -0,0 +1 @@
{"version":3,"file":"ArrayInfo.js","sourceRoot":"","sources":["../../src/lib/ArrayInfo.ts"],"names":[],"mappings":";;;AAAA,qCAAkC;AAGlC,SAAS,KAAK,CAAC,KAAU;IACrB,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC;QAChB,MAAM,CAAC,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,CAAA;AAC7D,CAAC;AAEM,MAAM,UAAU,GAAG,GAAG,EAAE,CAAC,+DAA+D,CAAA;AAAlF,QAAA,UAAU,cAAwE;AAC/F,MAAM,UAAU,GAAG,EAAc,CAAA;AAEjC,MAAa,SAAS;IACT,QAAQ,CAAQ;IAChB,KAAK,GAAW,CAAC,CAAA;IACjB,MAAM,GAAY,KAAK,CAAA;IAGhC,YAAY,QAAgB,EAAE,KAAU;QACpC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;QACxB,IAAI,CAAC,MAAM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,IAAI,CAAC,QAAQ,CAAC,CAAC,cAAc,CAAC,KAAK,CAAC,CAAA;IACpD,CAAC;CACJ;AA7GD,8BA6GC"}
@@ -0,0 +1,27 @@
import { KeyValue } from "./Utils";
import { JsonDB } from "../JsonDB";
export declare class DBParentData {
readonly parent?: string;
readonly data: KeyValue;
readonly db: JsonDB;
readonly dataPath: string;
constructor(data: any, db: JsonDB, dataPath: string, parent?: string);
/**
* Check if it's an array
* @param deletion
*/
private checkArray;
/**
* Get the data linked to this path
*/
getData(): any;
/**
* Set the data to the wanted path
* @param toSet
*/
setData(toSet: any): void;
/**
* Delete the data of the current path
*/
delete(): void;
}
@@ -0,0 +1,84 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DBParentData = void 0;
const ArrayInfo_1 = require("./ArrayInfo");
const Errors_1 = require("./Errors");
class DBParentData {
parent;
data;
db;
dataPath;
constructor(data, db, dataPath, parent) {
this.parent = parent;
this.data = data;
this.db = db;
this.dataPath = dataPath;
}
/**
* Check if it's an array
* @param deletion
*/
checkArray(deletion = false) {
const arrayInfo = ArrayInfo_1.ArrayInfo.processArray(this.parent);
if (arrayInfo && (!arrayInfo.append || deletion) && !arrayInfo.isValid(this.data)) {
throw new Errors_1.DataError("DataPath: /" + this.dataPath + ". Can't find index " + arrayInfo.index + " in array " + arrayInfo.property, 10);
}
return arrayInfo;
}
/**
* Get the data linked to this path
*/
getData() {
if (this.parent === undefined) {
return this.data;
}
const arrayInfo = this.checkArray();
if (arrayInfo) {
return arrayInfo.getData(this.data);
}
else {
return this.data[this.parent];
}
}
/**
* Set the data to the wanted path
* @param toSet
*/
setData(toSet) {
if (this.parent === undefined) {
this.db.resetData(toSet);
return;
}
const arrayInfo = ArrayInfo_1.ArrayInfo.processArray(this.parent);
if (arrayInfo) {
if (!this.data.hasOwnProperty(arrayInfo.property)) {
this.data[arrayInfo.property] = [];
}
else if (!Array.isArray(this.data[arrayInfo.property])) {
throw new Errors_1.DataError("DataPath: /" + this.dataPath + ". " + arrayInfo.property + " is not an array.", 11);
}
arrayInfo.setData(this.data, toSet);
}
else {
this.data[this.parent] = toSet;
}
}
/**
* Delete the data of the current path
*/
delete() {
if (this.parent === undefined) {
this.db.resetData({});
return;
}
const arrayInfo = this.checkArray(true);
if (arrayInfo) {
arrayInfo.delete(this.data);
}
else {
delete this.data[this.parent];
}
}
}
exports.DBParentData = DBParentData;
//# sourceMappingURL=DBParentData.js.map
@@ -0,0 +1 @@
{"version":3,"file":"DBParentData.js","sourceRoot":"","sources":["../../src/lib/DBParentData.ts"],"names":[],"mappings":";;;AAAA,2CAAqC;AACrC,qCAAkC;AAIlC,MAAa,YAAY;IACZ,MAAM,CAAS;IACf,IAAI,CAAU;IACd,EAAE,CAAQ;IACV,QAAQ,CAAQ;IAGzB,YAAY,IAAS,EAAE,EAAU,EAAE,QAAgB,EAAE,MAAe;QAChE,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAChB,IAAI,CAAC,EAAE,GAAG,EAAE,CAAA;QACZ,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;IAC5B,CAAC;IAED;;;OAGG;IACK,UAAU,CAAC,WAAoB,KAAK;QACxC,MAAM,SAAS,GAAG,qBAAS,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QACrD,IAAI,SAAS,IAAI,CAAC,CAAC,SAAS,CAAC,MAAM,IAAI,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;YAC/E,MAAM,IAAI,kBAAS,CAAC,aAAa,GAAG,IAAI,CAAC,QAAQ,GAAG,qBAAqB,GAAG,SAAS,CAAC,KAAK,GAAG,YAAY,GAAG,SAAS,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAA;SACvI;QAED,OAAO,SAAS,CAAA;IACpB,CAAC;IAED;;OAEG;IACI,OAAO;QACV,IAAI,IAAI,CAA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C3B,IAAI,CAAC,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC,CAAA;YACrB,OAAM;SACT;QACD,MAAM,SAAS,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAA;QACvC,IAAI,SAAS,EAAE;YACX,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;SAC9B;aAAM;YACH,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;SAChC;IACL,CAAC;CACJ;AAjFD,oCAiFC"}
@@ -0,0 +1,10 @@
export declare abstract class NestedError extends Error {
readonly inner?: Error;
readonly id: Number;
constructor(message: string, id: Number, inner?: Error);
toString(): string;
}
export declare class DatabaseError extends NestedError {
}
export declare class DataError extends NestedError {
}
+28
View File
@@ -0,0 +1,28 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DataError = exports.DatabaseError = exports.NestedError = void 0;
class NestedError extends Error {
inner;
id;
constructor(message, id, inner) {
super(message);
this.inner = inner;
this.id = id;
this.name = this.constructor.name;
}
toString() {
const string = this.name + ": " + this.message;
if (this.inner) {
return string + ':\n' + this.inner;
}
return string;
}
}
exports.NestedError = NestedError;
class DatabaseError extends NestedError {
}
exports.DatabaseError = DatabaseError;
class DataError extends NestedError {
}
exports.DataError = DataError;
//# sourceMappingURL=Errors.js.map
@@ -0,0 +1 @@
{"version":3,"file":"Errors.js","sourceRoot":"","sources":["../../src/lib/Errors.ts"],"names":[],"mappings":";;;AAAA,MAAsB,WAAY,SAAQ,KAAK;IAClC,KAAK,CAAQ;IACb,EAAE,CAAQ;IAGnB,YAAmB,OAAe,EAAE,EAAU,EAAE,KAAa;QACzD,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;QAClB,IAAI,CAAC,EAAE,GAAG,EAAE,CAAA;QACZ,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAA;IACrC,CAAC;IAGD,QAAQ;QACJ,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC,OAAO,CAAA;QAC9C,IAAI,IAAI,CAAC,KAAK,EAAE;YACZ,OAAO,MAAM,GAAG,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;SACrC;QACD,OAAO,MAAM,CAAA;IACjB,CAAC;CACJ;AApBD,kCAoBC;AAED,MAAa,aAAc,SAAQ,WAAW;CAC7C;AADD,sCACC;AAED,MAAa,SAAU,SAAQ,WAAW;CACzC;AADD,8BACC"}
@@ -0,0 +1,13 @@
export interface JsonDBConfig {
filename: string;
saveOnPush: boolean;
humanReadable: boolean;
separator: string;
}
export declare class Config implements JsonDBConfig {
filename: string;
humanReadable: boolean;
saveOnPush: boolean;
separator: string;
constructor(filename: string, saveOnPush?: boolean, humanReadable?: boolean, separator?: string);
}
@@ -0,0 +1,22 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Config = void 0;
const path = require("path");
class Config {
filename;
humanReadable;
saveOnPush;
separator;
constructor(filename, saveOnPush = true, humanReadable = false, separator = '/') {
this.filename = filename;
// Force json if no extension
if (path.extname(filename) === "") {
this.filename += ".json";
}
this.humanReadable = humanReadable;
this.saveOnPush = saveOnPush;
this.separator = separator;
}
}
exports.Config = Config;
//# sourceMappingURL=JsonDBConfig.js.map
@@ -0,0 +1 @@
{"version":3,"file":"JsonDBConfig.js","sourceRoot":"","sources":["../../src/lib/JsonDBConfig.ts"],"names":[],"mappings":";;;AAAA,6BAA6B;AAS7B,MAAa,MAAM;IACjB,QAAQ,CAAQ;IAChB,aAAa,CAAS;IACtB,UAAU,CAAS;IACnB,SAAS,CAAQ;IAGjB,YAAY,QAAgB,EAAE,aAAsB,IAAI,EAAE,gBAAyB,KAAK,EAAE,YAAoB,GAAG;QAC/G,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;QAExB,6BAA6B;QAC7B,IAAI,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,EAAE,EAAE;YACjC,IAAI,CAAC,QAAQ,IAAI,OAAO,CAAA;SACzB;QAED,IAAI,CAAC,aAAa,GAAG,aAAa,CAAA;QAClC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAC5B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAA;IAC5B,CAAC;CACF;AAnBD,wBAmBC"}
@@ -0,0 +1,5 @@
export interface KeyValue {
[key: string]: any;
}
export declare const merge: (...arrays: KeyValue[]) => KeyValue;
export declare const removeTrailingChar: (dataPath: string, trailing: string) => string;
+36
View File
@@ -0,0 +1,36 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.removeTrailingChar = exports.merge = void 0;
const merge = (...arrays) => {
const destination = {};
arrays.forEach(function (source) {
var prop;
for (prop in source) {
if (prop in destination && destination[prop] === null) {
destination[prop] = source[prop];
}
else if (prop in destination && Array.isArray(destination[prop])) {
// Concat Arrays
destination[prop] = destination[prop].concat(source[prop]);
}
else if (prop in destination && typeof destination[prop] === "object") {
// Merge Objects
destination[prop] = (0, exports.merge)(destination[prop], source[prop]);
}
else {
// Set new values
destination[prop] = source[prop];
}
}
});
return destination;
};
exports.merge = merge;
const removeTrailingChar = (dataPath, trailing) => {
if (dataPath.length > 1 && dataPath.endsWith(trailing)) {
return dataPath.substring(0, dataPath.length - 1);
}
return dataPath;
};
exports.removeTrailingChar = removeTrailingChar;
//# sourceMappingURL=Utils.js.map
@@ -0,0 +1 @@
{"version":3,"file":"Utils.js","sourceRoot":"","sources":["../../src/lib/Utils.ts"],"names":[],"mappings":";;;AAIO,MAAM,KAAK,GAAG,CAAC,GAAG,MAAkB,EAAY,EAAE;IACrD,MAAM,WAAW,GAAG,EAAc,CAAA;IAClC,MAAM,CAAC,OAAO,CAAC,UAAU,MAAM;QAC3B,IAAI,IAAI,CAAA;QACR,KAAK,IAAI,IAAI,MAAM,EAAE;YAEjB,IAAI,IAAI,IAAI,WAAW,IAAI,WAA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