@egi/smart-db 2.4.1 → 2.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/helpers/extract-db-api.js +1 -1
- package/models/smart-db-core-table-model.d.ts +7 -7
- package/models/smart-db-core-table-model.js +1 -1
- package/models/smart-db-log-model.d.ts +21 -21
- package/models/smart-db-log-model.js +1 -1
- package/models/smart-db-version-model.d.ts +23 -23
- package/models/smart-db-version-model.js +1 -1
- package/models/smart-db-version-view-model.d.ts +27 -26
- package/models/smart-db-version-view-model.js +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
import fs from"fs";import _ from"lodash";import process from"process";import{SmartDbBetterSqlite3}from"../drivers/smart-db-better-sqlite3";import{SmartDbCoreTableModel}from"../models/smart-db-core-table-model";import{SqliteMasterModel}from"../models/sqlite-master-model";import{IN,NE}from"../smart-db-globals";function getType(e){let t;return t=e?e.match(/varchar/i)||e.match(/text/i)?"string":e.match(/integer\(1\)/i)?"boolean":e.match(/date/i)?"Date":e.match(/integer/i)||e.match(/number/i)?"number":e||"SqlValueType":"SqlValueType",t}function extractDbApi(e){console.log(`extract interface from '${e.db.getDbConnector()}' to '${e.modelDirectory}'`),fs.existsSync(e.modelDirectory)||fs.mkdirSync(e.modelDirectory,{recursive:!0});const t=e.db.getAllSync(SqliteMasterModel,{type:IN(["table","view"]),name:NE("sqlite_sequence")});if(!1===t)console.error(e.db.getLastError()),process.abort();else{let
|
|
1
|
+
import fs from"fs";import _ from"lodash";import process from"process";import{SmartDbBetterSqlite3}from"../drivers/smart-db-better-sqlite3";import{SmartDbCoreTableModel}from"../models/smart-db-core-table-model";import{SqliteMasterModel}from"../models/sqlite-master-model";import{IN,NE}from"../smart-db-globals";function getType(e){let t;return t=e?e.match(/varchar/i)||e.match(/text/i)?"string":e.match(/integer\(1\)/i)?"boolean":e.match(/date/i)?"Date":e.match(/integer/i)||e.match(/number/i)?"number":e||"SqlValueType":"SqlValueType",t}function extractDbApi(e){console.log(`extract interface from '${e.db.getDbConnector()}' to '${e.modelDirectory}'`),fs.existsSync(e.modelDirectory)||fs.mkdirSync(e.modelDirectory,{recursive:!0});const t=e.db.getAllSync(SqliteMasterModel,{type:IN(["table","view"]),name:NE("sqlite_sequence")});if(!1===t)console.error(e.db.getLastError()),process.abort();else{let r=[];if(!e.includeCoreTables&&e.db.existsSync(SmartDbCoreTableModel)){const t=e.db.getAllSync(SmartDbCoreTableModel);if(!1===t)throw e.db.getLastError();t.forEach(e=>{r.push(e.name)})}const n=[];t.forEach(t=>{if(!r.includes(t.name)){const r=t.name[0].toUpperCase()+_.camelCase(t.name.substr(1))+"Model";n.push(r);const a=[];e.db.getTableInfo(t.name).then(n=>{const s=n.fields;let o=!1,i="",l="",c="",m="",p="";const b=t.name.replace(/[^[a-z0-9]/g,"-")+"-model";if(i+="/* eslint-disable @typescript-eslint/member-ordering */\n",i+="// noinspection JSUnusedGlobalSymbols\n",s){e.abstractModelModule==e.smartDbInterfaces?e.separateApi?(c+=`import {GenericModelData} from "${e.abstractModelModule}";\n`,p+=`import {AbstractModel, ModelAttributeMap} from "${e.abstractModelModule}";\n`,p+=`import {${r}Data} from "./${b}-api";\n`):p+=`import {AbstractModel, GenericModelData, ModelAttributeMap} from "${e.abstractModelModule}";\n`:e.separateApi?(c+=`import {GenericModelData} from "${e.smartDbInterfaces}";\n`,p+=`import {ModelAttributeMap} from "${e.smartDbInterfaces}";\n`,p+=`import {AbstractModel} from "${e.abstractModelModule}";\n`,p+=`import {${r}Data} from "./${b}-api";\n`):(p+=`import {GenericModelData, ModelAttributeMap} from "${e.smartDbInterfaces}";\n`,p+=`import {AbstractModel} from "${e.abstractModelModule}";\n`),l+=`export interface ${r}Data extends GenericModelData {\n`;let n,d="",u="",f=!1;const h=[];s.forEach(e=>{const t=e.name.match(/([a-z0-9]{1,4})_/i);e.isPk&&(d=e.name,t&&(u=t[1])),t?h.includes(t[1])||h.push(t[1]):f=!0}),u||f||1!=h.length||(u=h[0]),u&&(n=new RegExp(`^${u}_(.*)$`));const g={};s.forEach(r=>{const s=getType(r.type);let i;o||"SqlValueType"!=s||(p+=`import {SqlValueType} from "${e.smartDbInterfaces}";\n`,o=!0);const c=n&&r.name.match(n);i=c?_.camelCase(c[1]):_.camelCase(r.name);let m=!0;i!=r.name&&(a.push({name:i,attribute:i,type:s,typeScriptStyle:m,alias:r.name}),m=!1),a.push({name:r.name,attribute:i,type:s,physical:void 0!==r.cid,typeScriptStyle:m}),g[i]=s,"user"==t.name&&"name"==i&&(l+=" // @ts-ignore"),l+=` ${i}?: ${s};\n`}),l+="}\n",m+=`export class ${r} extends AbstractModel<${r}, ${r}Data> {\n`,_.forEach(g,(e,t)=>{m+=` private _${t}?: ${e};\n`}),"user"==t.name&&(m+=" private _hash?: string;\n",m+=" private _privileges?: string[];\n"),m+="\n",m+=" static readonly attributeMap: ModelAttributeMap = {\n",a.forEach((e,t)=>{t>0&&(m+=",\n"),m+=` ${e.name}: {\n`,e.physical&&(m+=" physical: true,\n"),e.alias&&(m+=` alias: "${e.alias}",\n`),e.virtual&&(m+=" virtual: true,\n"),e.typeScriptStyle&&(m+=" typeScriptStyle: true,\n"),m+=` type: "${e.type}",\n`,m+=` attribute: "_${e.attribute}"\n`,m+=" }"}),m+="\n",m+=" };\n",m+="\n",m+=" static getClassName(): string {\n",m+=` return "${r}";\n`,m+=" }\n",m+="\n",m+=" static getTableName(): string {\n",m+=` return "${t.name}";\n`,m+=" }\n",m+="\n",m+=" static getPrimaryKey(): string {\n",m+=` return "${d}";\n`,m+=" }\n",m+="\n",m+=` static from(other: ${r} | ${r}Data): ${r} {\n`,m+=` let value: ${r} = null;\n`,m+=" if (other) {\n",m+=` value = new ${r}();\n`,m+=` if (other instanceof ${r}) {\n`,m+=" Object.assign(value, other);\n",m+=" } else {\n",m+=" value.assign(other);\n",m+=" }\n",m+=" }\n",m+=" return value;\n",m+=" }\n",m+="\n",m+=` constructor(data?: ${r} | ${r}Data) {\n`,m+=" super();\n",m+=" if (data) {\n",m+=" this.assign(data);\n",m+=" }\n",m+=" }\n",m+="\n",m+=` public clone(): ${r} {\n`,m+=` return ${r}.from(this);\n`,m+=" }\n",m+="\n",m+=" public getClassName(): string {\n",m+=` return "${r}";\n`,m+=" }\n",m+="\n",m+=" public getTableName(): string {\n",m+=` return "${t.name}";\n`,m+=" }\n",m+="\n",m+=" public getPrimaryKey(): string {\n",m+=` return "${d}";\n`,m+=" }\n",m+="\n",m+=" public getAttributeMap(): ModelAttributeMap {\n",m+=` return ${r}.attributeMap;\n`,m+=" }\n",a.forEach(e=>{let t;m+="\n",t=e.name.length<3||e.name.match(/_/)?"FunctionNamingConventionJS":"",""!==t&&(m+=` // noinspection ${t}\n`),m+=` get ${e.name}(): ${e.type} {\n`,m+=` return this._${e.attribute};\n`,m+=" }\n\n",""!==t&&(m+=` // noinspection ${t}\n`),m+=` set ${e.name}(${e.attribute}: ${e.type}) {\n`,m+=` this._${e.attribute} = ${e.attribute};\n`,m+=" }\n"}),"user"==t.name&&(m+="\n",m+=" get hash(): string {\n",m+=" return this._hash;\n",m+=" }\n\n",m+=" set hash(hash: string) {\n",m+=" this._hash = hash;\n",m+=" }\n",m+="\n",m+=" get privileges(): string[] {\n",m+=" return this._privileges;\n",m+=" }\n\n",m+=" set privileges(p: string[]) {\n",m+=" this._privileges = p;\n",m+=" }\n"),m+="}\n",e.separateApi?(l=i+"\n"+c+"\n"+l,fs.writeFileSync(`${e.modelDirectory}/${b+"-api.ts"}`,l),m=i+"\n"+p+"\n"+m):m=i+"\n"+p+"\n"+l+"\n"+m,fs.writeFileSync(`${e.modelDirectory}/${b+".ts"}`,m)}else console.log("error: table has no fields")}).catch(e=>{console.error(e),process.abort()})}});let a=`import {AbstractModel} from "${e.abstractModelModule}";\n`;_.forEach(n,e=>{a+=`import {${e}} from "./${_.kebabCase(e)}";\n`}),a+="\n",a+="interface SmartDbDictionaryEntry {\n",a+=" cls: "+n.map(e=>"typeof "+e).join(" |\n "),a+=";\n",a+="}\n\n",a+="export class SmartDbDictionary {\n",a+=" static models: { [relation: string]: SmartDbDictionaryEntry; } = {\n",_.forEach(n,e=>{a+=` ${e}: {\n`,a+=` cls: ${e}\n`,a+=" },\n"}),a=a.substring(0,a.length-2)+"\n",a+=" };\n",a+="}\n",fs.writeFileSync(e.modelDirectory+"/smart-db-dictionary.ts",a)}e.db.closeSync()}(()=>{let e=!1;const t=Array.from(process.argv);if(console.log(t),"--separate-api"==t[2]&&(e=!0,t.splice(2,1)),console.log(t),4==t.length){extractDbApi({modelDirectory:t[3],smartDbInterfaces:"@egi/smart-db",abstractModelModule:"@egi/smart-db",separateApi:e,db:new SmartDbBetterSqlite3(t[2],{verbose:(e,...t)=>{console.log("DB LOG",e,...t)}})})}else if(2==t.length&&fs.existsSync("src/helpers/extract-db-api.ts")){const t=`/tmp/smart-db-core.${process.pid}.sqlite3`,r={includeCoreTables:!0,modelDirectory:"src/models",smartDbInterfaces:"../smart-db-interfaces",abstractModelModule:"./abstract-model",separateApi:e,db:new SmartDbBetterSqlite3(t,{verbose:(e,...t)=>{console.log("DB LOG",e,...t)}})};r.db.initDb({module:"smart-db-core",sqlFilesDirectory:"assets/sqlite3"}).then(()=>{extractDbApi(r),fs.unlinkSync(t),r.db.closeSync()})}else console.log("usage: extract-db-api {db-connector|path-to-db} {target-models-directory}")})();
|
|
@@ -10,26 +10,26 @@ export declare class SmartDbCoreTableModel extends AbstractModel<SmartDbCoreTabl
|
|
|
10
10
|
private _name?;
|
|
11
11
|
private _type?;
|
|
12
12
|
static readonly attributeMap: ModelAttributeMap;
|
|
13
|
-
constructor(data?: SmartDbCoreTableModel | SmartDbCoreTableModelData);
|
|
14
13
|
static getClassName(): string;
|
|
15
14
|
static getTableName(): string;
|
|
16
15
|
static getPrimaryKey(): string;
|
|
17
16
|
static from(other: SmartDbCoreTableModel | SmartDbCoreTableModelData): SmartDbCoreTableModel;
|
|
17
|
+
constructor(data?: SmartDbCoreTableModel | SmartDbCoreTableModelData);
|
|
18
18
|
clone(): SmartDbCoreTableModel;
|
|
19
19
|
getClassName(): string;
|
|
20
20
|
getTableName(): string;
|
|
21
21
|
getPrimaryKey(): string;
|
|
22
22
|
getAttributeMap(): ModelAttributeMap;
|
|
23
|
-
get ctb_id(): number;
|
|
24
|
-
set ctb_id(id: number);
|
|
25
|
-
get ctb_name(): string;
|
|
26
|
-
set ctb_name(name: string);
|
|
27
|
-
get ctb_type(): string;
|
|
28
|
-
set ctb_type(type: string);
|
|
29
23
|
get id(): number;
|
|
30
24
|
set id(id: number);
|
|
25
|
+
get ctb_id(): number;
|
|
26
|
+
set ctb_id(id: number);
|
|
31
27
|
get name(): string;
|
|
32
28
|
set name(name: string);
|
|
29
|
+
get ctb_name(): string;
|
|
30
|
+
set ctb_name(name: string);
|
|
33
31
|
get type(): string;
|
|
34
32
|
set type(type: string);
|
|
33
|
+
get ctb_type(): string;
|
|
34
|
+
set ctb_type(type: string);
|
|
35
35
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{AbstractModel}from"./abstract-model";export class SmartDbCoreTableModel extends AbstractModel{constructor(t){super(),t&&this.assign(t)}static getClassName(){return"SmartDbCoreTableModel"}static getTableName(){return"smart_db_core_table"}static getPrimaryKey(){return"ctb_id"}static from(t){let e=null;return t&&(e=new SmartDbCoreTableModel,t instanceof SmartDbCoreTableModel?Object.assign(e,t):e.assign(t)),e}clone(){return SmartDbCoreTableModel.from(this)}getClassName(){return"SmartDbCoreTableModel"}getTableName(){return"smart_db_core_table"}getPrimaryKey(){return"ctb_id"}getAttributeMap(){return SmartDbCoreTableModel.attributeMap}get
|
|
1
|
+
import{AbstractModel}from"./abstract-model";export class SmartDbCoreTableModel extends AbstractModel{constructor(t){super(),t&&this.assign(t)}static getClassName(){return"SmartDbCoreTableModel"}static getTableName(){return"smart_db_core_table"}static getPrimaryKey(){return"ctb_id"}static from(t){let e=null;return t&&(e=new SmartDbCoreTableModel,t instanceof SmartDbCoreTableModel?Object.assign(e,t):e.assign(t)),e}clone(){return SmartDbCoreTableModel.from(this)}getClassName(){return"SmartDbCoreTableModel"}getTableName(){return"smart_db_core_table"}getPrimaryKey(){return"ctb_id"}getAttributeMap(){return SmartDbCoreTableModel.attributeMap}get id(){return this._id}set id(t){this._id=t}get ctb_id(){return this._id}set ctb_id(t){this._id=t}get name(){return this._name}set name(t){this._name=t}get ctb_name(){return this._name}set ctb_name(t){this._name=t}get type(){return this._type}set type(t){this._type=t}get ctb_type(){return this._type}set ctb_type(t){this._type=t}}SmartDbCoreTableModel.attributeMap={id:{alias:"ctb_id",typeScriptStyle:!0,type:"number",attribute:"_id"},ctb_id:{physical:!0,type:"number",attribute:"_id"},name:{alias:"ctb_name",typeScriptStyle:!0,type:"string",attribute:"_name"},ctb_name:{physical:!0,type:"string",attribute:"_name"},type:{alias:"ctb_type",typeScriptStyle:!0,type:"string",attribute:"_type"},ctb_type:{physical:!0,type:"string",attribute:"_type"}};
|
|
@@ -20,46 +20,46 @@ export declare class SmartDbLogModel extends AbstractModel<SmartDbLogModel, Smar
|
|
|
20
20
|
private _user?;
|
|
21
21
|
private _timestamp?;
|
|
22
22
|
static readonly attributeMap: ModelAttributeMap;
|
|
23
|
-
constructor(data?: SmartDbLogModel | SmartDbLogModelData);
|
|
24
23
|
static getClassName(): string;
|
|
25
24
|
static getTableName(): string;
|
|
26
25
|
static getPrimaryKey(): string;
|
|
27
26
|
static from(other: SmartDbLogModel | SmartDbLogModelData): SmartDbLogModel;
|
|
27
|
+
constructor(data?: SmartDbLogModel | SmartDbLogModelData);
|
|
28
28
|
clone(): SmartDbLogModel;
|
|
29
29
|
getClassName(): string;
|
|
30
30
|
getTableName(): string;
|
|
31
31
|
getPrimaryKey(): string;
|
|
32
32
|
getAttributeMap(): ModelAttributeMap;
|
|
33
|
-
get data(): string;
|
|
34
|
-
set data(data: string);
|
|
35
33
|
get id(): number;
|
|
36
34
|
set id(id: number);
|
|
37
|
-
get info(): string;
|
|
38
|
-
set info(info: string);
|
|
39
|
-
get location(): string;
|
|
40
|
-
set location(location: string);
|
|
41
|
-
get log_data(): string;
|
|
42
|
-
set log_data(data: string);
|
|
43
35
|
get log_id(): number;
|
|
44
36
|
set log_id(id: number);
|
|
45
|
-
get
|
|
46
|
-
set
|
|
47
|
-
get log_location(): string;
|
|
48
|
-
set log_location(location: string);
|
|
37
|
+
get severity(): string;
|
|
38
|
+
set severity(severity: string);
|
|
49
39
|
get log_severity(): string;
|
|
50
40
|
set log_severity(severity: string);
|
|
51
|
-
get
|
|
52
|
-
set
|
|
41
|
+
get type(): string;
|
|
42
|
+
set type(type: string);
|
|
53
43
|
get log_type(): string;
|
|
54
44
|
set log_type(type: string);
|
|
45
|
+
get location(): string;
|
|
46
|
+
set location(location: string);
|
|
47
|
+
get log_location(): string;
|
|
48
|
+
set log_location(location: string);
|
|
49
|
+
get info(): string;
|
|
50
|
+
set info(info: string);
|
|
51
|
+
get log_info(): string;
|
|
52
|
+
set log_info(info: string);
|
|
53
|
+
get data(): string;
|
|
54
|
+
set data(data: string);
|
|
55
|
+
get log_data(): string;
|
|
56
|
+
set log_data(data: string);
|
|
57
|
+
get user(): string;
|
|
58
|
+
set user(user: string);
|
|
55
59
|
get log_user(): string;
|
|
56
60
|
set log_user(user: string);
|
|
57
|
-
get severity(): string;
|
|
58
|
-
set severity(severity: string);
|
|
59
61
|
get timestamp(): Date;
|
|
60
62
|
set timestamp(timestamp: Date);
|
|
61
|
-
get
|
|
62
|
-
set
|
|
63
|
-
get user(): string;
|
|
64
|
-
set user(user: string);
|
|
63
|
+
get log_timestamp(): Date;
|
|
64
|
+
set log_timestamp(timestamp: Date);
|
|
65
65
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{AbstractModel}from"./abstract-model";export class SmartDbLogModel extends AbstractModel{constructor(t){super(),t&&this.assign(t)}static getClassName(){return"SmartDbLogModel"}static getTableName(){return"smart_db_log"}static getPrimaryKey(){return"log_id"}static from(t){let e=null;return t&&(e=new SmartDbLogModel,t instanceof SmartDbLogModel?Object.assign(e,t):e.assign(t)),e}clone(){return SmartDbLogModel.from(this)}getClassName(){return"SmartDbLogModel"}getTableName(){return"smart_db_log"}getPrimaryKey(){return"log_id"}getAttributeMap(){return SmartDbLogModel.attributeMap}get
|
|
1
|
+
import{AbstractModel}from"./abstract-model";export class SmartDbLogModel extends AbstractModel{constructor(t){super(),t&&this.assign(t)}static getClassName(){return"SmartDbLogModel"}static getTableName(){return"smart_db_log"}static getPrimaryKey(){return"log_id"}static from(t){let e=null;return t&&(e=new SmartDbLogModel,t instanceof SmartDbLogModel?Object.assign(e,t):e.assign(t)),e}clone(){return SmartDbLogModel.from(this)}getClassName(){return"SmartDbLogModel"}getTableName(){return"smart_db_log"}getPrimaryKey(){return"log_id"}getAttributeMap(){return SmartDbLogModel.attributeMap}get id(){return this._id}set id(t){this._id=t}get log_id(){return this._id}set log_id(t){this._id=t}get severity(){return this._severity}set severity(t){this._severity=t}get log_severity(){return this._severity}set log_severity(t){this._severity=t}get type(){return this._type}set type(t){this._type=t}get log_type(){return this._type}set log_type(t){this._type=t}get location(){return this._location}set location(t){this._location=t}get log_location(){return this._location}set log_location(t){this._location=t}get info(){return this._info}set info(t){this._info=t}get log_info(){return this._info}set log_info(t){this._info=t}get data(){return this._data}set data(t){this._data=t}get log_data(){return this._data}set log_data(t){this._data=t}get user(){return this._user}set user(t){this._user=t}get log_user(){return this._user}set log_user(t){this._user=t}get timestamp(){return this._timestamp}set timestamp(t){this._timestamp=t}get log_timestamp(){return this._timestamp}set log_timestamp(t){this._timestamp=t}}SmartDbLogModel.attributeMap={id:{alias:"log_id",typeScriptStyle:!0,type:"number",attribute:"_id"},log_id:{physical:!0,type:"number",attribute:"_id"},severity:{alias:"log_severity",typeScriptStyle:!0,type:"string",attribute:"_severity"},log_severity:{physical:!0,type:"string",attribute:"_severity"},type:{alias:"log_type",typeScriptStyle:!0,type:"string",attribute:"_type"},log_type:{physical:!0,type:"string",attribute:"_type"},location:{alias:"log_location",typeScriptStyle:!0,type:"string",attribute:"_location"},log_location:{physical:!0,type:"string",attribute:"_location"},info:{alias:"log_info",typeScriptStyle:!0,type:"string",attribute:"_info"},log_info:{physical:!0,type:"string",attribute:"_info"},data:{alias:"log_data",typeScriptStyle:!0,type:"string",attribute:"_data"},log_data:{physical:!0,type:"string",attribute:"_data"},user:{alias:"log_user",typeScriptStyle:!0,type:"string",attribute:"_user"},log_user:{physical:!0,type:"string",attribute:"_user"},timestamp:{alias:"log_timestamp",typeScriptStyle:!0,type:"Date",attribute:"_timestamp"},log_timestamp:{physical:!0,type:"Date",attribute:"_timestamp"}};
|
|
@@ -20,11 +20,11 @@ export declare class SmartDbVersionModel extends AbstractModel<SmartDbVersionMod
|
|
|
20
20
|
private _releaseType?;
|
|
21
21
|
private _installDate?;
|
|
22
22
|
static readonly attributeMap: ModelAttributeMap;
|
|
23
|
-
constructor(data?: SmartDbVersionModel | SmartDbVersionModelData);
|
|
24
23
|
static getClassName(): string;
|
|
25
24
|
static getTableName(): string;
|
|
26
25
|
static getPrimaryKey(): string;
|
|
27
26
|
static from(other: SmartDbVersionModel | SmartDbVersionModelData): SmartDbVersionModel;
|
|
27
|
+
constructor(data?: SmartDbVersionModel | SmartDbVersionModelData);
|
|
28
28
|
clone(): SmartDbVersionModel;
|
|
29
29
|
getClassName(): string;
|
|
30
30
|
getTableName(): string;
|
|
@@ -32,34 +32,34 @@ export declare class SmartDbVersionModel extends AbstractModel<SmartDbVersionMod
|
|
|
32
32
|
getAttributeMap(): ModelAttributeMap;
|
|
33
33
|
get id(): number;
|
|
34
34
|
set id(id: number);
|
|
35
|
-
get installDate(): Date;
|
|
36
|
-
set installDate(installDate: Date);
|
|
37
|
-
get module(): string;
|
|
38
|
-
set module(module: string);
|
|
39
|
-
get releaseType(): string;
|
|
40
|
-
set releaseType(releaseType: string);
|
|
41
|
-
get revision(): string;
|
|
42
|
-
set revision(revision: string);
|
|
43
|
-
get sequence(): number;
|
|
44
|
-
set sequence(sequence: number);
|
|
45
|
-
get subVersion(): string;
|
|
46
|
-
set subVersion(subVersion: string);
|
|
47
35
|
get ver_id(): number;
|
|
48
36
|
set ver_id(id: number);
|
|
49
|
-
get
|
|
50
|
-
set
|
|
37
|
+
get module(): string;
|
|
38
|
+
set module(module: string);
|
|
51
39
|
get ver_module(): string;
|
|
52
40
|
set ver_module(module: string);
|
|
53
|
-
get
|
|
54
|
-
set
|
|
55
|
-
get ver_revision(): string;
|
|
56
|
-
set ver_revision(revision: string);
|
|
41
|
+
get sequence(): number;
|
|
42
|
+
set sequence(sequence: number);
|
|
57
43
|
get ver_sequence(): number;
|
|
58
44
|
set ver_sequence(sequence: number);
|
|
59
|
-
get ver_sub_version(): string;
|
|
60
|
-
set ver_sub_version(subVersion: string);
|
|
61
|
-
get ver_version(): string;
|
|
62
|
-
set ver_version(version: string);
|
|
63
45
|
get version(): string;
|
|
64
46
|
set version(version: string);
|
|
47
|
+
get ver_version(): string;
|
|
48
|
+
set ver_version(version: string);
|
|
49
|
+
get subVersion(): string;
|
|
50
|
+
set subVersion(subVersion: string);
|
|
51
|
+
get ver_sub_version(): string;
|
|
52
|
+
set ver_sub_version(subVersion: string);
|
|
53
|
+
get revision(): string;
|
|
54
|
+
set revision(revision: string);
|
|
55
|
+
get ver_revision(): string;
|
|
56
|
+
set ver_revision(revision: string);
|
|
57
|
+
get releaseType(): string;
|
|
58
|
+
set releaseType(releaseType: string);
|
|
59
|
+
get ver_release_type(): string;
|
|
60
|
+
set ver_release_type(releaseType: string);
|
|
61
|
+
get installDate(): Date;
|
|
62
|
+
set installDate(installDate: Date);
|
|
63
|
+
get ver_install_date(): Date;
|
|
64
|
+
set ver_install_date(installDate: Date);
|
|
65
65
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{AbstractModel}from"./abstract-model";export class SmartDbVersionModel extends AbstractModel{constructor(e){super(),e&&this.assign(e)}static getClassName(){return"SmartDbVersionModel"}static getTableName(){return"smart_db_version"}static getPrimaryKey(){return"ver_id"}static from(e){let t=null;return e&&(t=new SmartDbVersionModel,e instanceof SmartDbVersionModel?Object.assign(t,e):t.assign(e)),t}clone(){return SmartDbVersionModel.from(this)}getClassName(){return"SmartDbVersionModel"}getTableName(){return"smart_db_version"}getPrimaryKey(){return"ver_id"}getAttributeMap(){return SmartDbVersionModel.attributeMap}get id(){return this._id}set id(e){this._id=e}get
|
|
1
|
+
import{AbstractModel}from"./abstract-model";export class SmartDbVersionModel extends AbstractModel{constructor(e){super(),e&&this.assign(e)}static getClassName(){return"SmartDbVersionModel"}static getTableName(){return"smart_db_version"}static getPrimaryKey(){return"ver_id"}static from(e){let t=null;return e&&(t=new SmartDbVersionModel,e instanceof SmartDbVersionModel?Object.assign(t,e):t.assign(e)),t}clone(){return SmartDbVersionModel.from(this)}getClassName(){return"SmartDbVersionModel"}getTableName(){return"smart_db_version"}getPrimaryKey(){return"ver_id"}getAttributeMap(){return SmartDbVersionModel.attributeMap}get id(){return this._id}set id(e){this._id=e}get ver_id(){return this._id}set ver_id(e){this._id=e}get module(){return this._module}set module(e){this._module=e}get ver_module(){return this._module}set ver_module(e){this._module=e}get sequence(){return this._sequence}set sequence(e){this._sequence=e}get ver_sequence(){return this._sequence}set ver_sequence(e){this._sequence=e}get version(){return this._version}set version(e){this._version=e}get ver_version(){return this._version}set ver_version(e){this._version=e}get subVersion(){return this._subVersion}set subVersion(e){this._subVersion=e}get ver_sub_version(){return this._subVersion}set ver_sub_version(e){this._subVersion=e}get revision(){return this._revision}set revision(e){this._revision=e}get ver_revision(){return this._revision}set ver_revision(e){this._revision=e}get releaseType(){return this._releaseType}set releaseType(e){this._releaseType=e}get ver_release_type(){return this._releaseType}set ver_release_type(e){this._releaseType=e}get installDate(){return this._installDate}set installDate(e){this._installDate=e}get ver_install_date(){return this._installDate}set ver_install_date(e){this._installDate=e}}SmartDbVersionModel.attributeMap={id:{alias:"ver_id",typeScriptStyle:!0,type:"number",attribute:"_id"},ver_id:{physical:!0,type:"number",attribute:"_id"},module:{alias:"ver_module",typeScriptStyle:!0,type:"string",attribute:"_module"},ver_module:{physical:!0,type:"string",attribute:"_module"},sequence:{alias:"ver_sequence",typeScriptStyle:!0,type:"number",attribute:"_sequence"},ver_sequence:{physical:!0,type:"number",attribute:"_sequence"},version:{alias:"ver_version",typeScriptStyle:!0,type:"string",attribute:"_version"},ver_version:{physical:!0,type:"string",attribute:"_version"},subVersion:{alias:"ver_sub_version",typeScriptStyle:!0,type:"string",attribute:"_subVersion"},ver_sub_version:{physical:!0,type:"string",attribute:"_subVersion"},revision:{alias:"ver_revision",typeScriptStyle:!0,type:"string",attribute:"_revision"},ver_revision:{physical:!0,type:"string",attribute:"_revision"},releaseType:{alias:"ver_release_type",typeScriptStyle:!0,type:"string",attribute:"_releaseType"},ver_release_type:{physical:!0,type:"string",attribute:"_releaseType"},installDate:{alias:"ver_install_date",typeScriptStyle:!0,type:"Date",attribute:"_installDate"},ver_install_date:{physical:!0,type:"Date",attribute:"_installDate"}};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { GenericModelData, ModelAttributeMap
|
|
1
|
+
import { GenericModelData, ModelAttributeMap } from "../smart-db-interfaces";
|
|
2
2
|
import { AbstractModel } from "./abstract-model";
|
|
3
|
+
import { SqlValueType } from "../smart-db-interfaces";
|
|
3
4
|
export interface SmartDbVersionViewModelData extends GenericModelData {
|
|
4
5
|
id?: number;
|
|
5
6
|
module?: string;
|
|
@@ -22,11 +23,11 @@ export declare class SmartDbVersionViewModel extends AbstractModel<SmartDbVersio
|
|
|
22
23
|
private _installDate?;
|
|
23
24
|
private _versionString?;
|
|
24
25
|
static readonly attributeMap: ModelAttributeMap;
|
|
25
|
-
constructor(data?: SmartDbVersionViewModel | SmartDbVersionViewModelData);
|
|
26
26
|
static getClassName(): string;
|
|
27
27
|
static getTableName(): string;
|
|
28
28
|
static getPrimaryKey(): string;
|
|
29
29
|
static from(other: SmartDbVersionViewModel | SmartDbVersionViewModelData): SmartDbVersionViewModel;
|
|
30
|
+
constructor(data?: SmartDbVersionViewModel | SmartDbVersionViewModelData);
|
|
30
31
|
clone(): SmartDbVersionViewModel;
|
|
31
32
|
getClassName(): string;
|
|
32
33
|
getTableName(): string;
|
|
@@ -34,38 +35,38 @@ export declare class SmartDbVersionViewModel extends AbstractModel<SmartDbVersio
|
|
|
34
35
|
getAttributeMap(): ModelAttributeMap;
|
|
35
36
|
get id(): number;
|
|
36
37
|
set id(id: number);
|
|
37
|
-
get installDate(): Date;
|
|
38
|
-
set installDate(installDate: Date);
|
|
39
|
-
get module(): string;
|
|
40
|
-
set module(module: string);
|
|
41
|
-
get releaseType(): string;
|
|
42
|
-
set releaseType(releaseType: string);
|
|
43
|
-
get revision(): string;
|
|
44
|
-
set revision(revision: string);
|
|
45
|
-
get sequence(): number;
|
|
46
|
-
set sequence(sequence: number);
|
|
47
|
-
get subVersion(): string;
|
|
48
|
-
set subVersion(subVersion: string);
|
|
49
38
|
get ver_id(): number;
|
|
50
39
|
set ver_id(id: number);
|
|
51
|
-
get
|
|
52
|
-
set
|
|
40
|
+
get module(): string;
|
|
41
|
+
set module(module: string);
|
|
53
42
|
get ver_module(): string;
|
|
54
43
|
set ver_module(module: string);
|
|
55
|
-
get
|
|
56
|
-
set
|
|
57
|
-
get ver_revision(): string;
|
|
58
|
-
set ver_revision(revision: string);
|
|
44
|
+
get sequence(): number;
|
|
45
|
+
set sequence(sequence: number);
|
|
59
46
|
get ver_sequence(): number;
|
|
60
47
|
set ver_sequence(sequence: number);
|
|
61
|
-
get ver_sub_version(): string;
|
|
62
|
-
set ver_sub_version(subVersion: string);
|
|
63
|
-
get ver_version(): string;
|
|
64
|
-
set ver_version(version: string);
|
|
65
|
-
get ver_version_string(): SqlValueType;
|
|
66
|
-
set ver_version_string(versionString: SqlValueType);
|
|
67
48
|
get version(): string;
|
|
68
49
|
set version(version: string);
|
|
50
|
+
get ver_version(): string;
|
|
51
|
+
set ver_version(version: string);
|
|
52
|
+
get subVersion(): string;
|
|
53
|
+
set subVersion(subVersion: string);
|
|
54
|
+
get ver_sub_version(): string;
|
|
55
|
+
set ver_sub_version(subVersion: string);
|
|
56
|
+
get revision(): string;
|
|
57
|
+
set revision(revision: string);
|
|
58
|
+
get ver_revision(): string;
|
|
59
|
+
set ver_revision(revision: string);
|
|
60
|
+
get releaseType(): string;
|
|
61
|
+
set releaseType(releaseType: string);
|
|
62
|
+
get ver_release_type(): string;
|
|
63
|
+
set ver_release_type(releaseType: string);
|
|
64
|
+
get installDate(): Date;
|
|
65
|
+
set installDate(installDate: Date);
|
|
66
|
+
get ver_install_date(): Date;
|
|
67
|
+
set ver_install_date(installDate: Date);
|
|
69
68
|
get versionString(): SqlValueType;
|
|
70
69
|
set versionString(versionString: SqlValueType);
|
|
70
|
+
get ver_version_string(): SqlValueType;
|
|
71
|
+
set ver_version_string(versionString: SqlValueType);
|
|
71
72
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{AbstractModel}from"./abstract-model";export class SmartDbVersionViewModel extends AbstractModel{constructor(e){super(),e&&this.assign(e)}static getClassName(){return"SmartDbVersionViewModel"}static getTableName(){return"smart_db_version_view"}static getPrimaryKey(){return""}static from(e){let t=null;return e&&(t=new SmartDbVersionViewModel,e instanceof SmartDbVersionViewModel?Object.assign(t,e):t.assign(e)),t}clone(){return SmartDbVersionViewModel.from(this)}getClassName(){return"SmartDbVersionViewModel"}getTableName(){return"smart_db_version_view"}getPrimaryKey(){return""}getAttributeMap(){return SmartDbVersionViewModel.attributeMap}get id(){return this._id}set id(e){this._id=e}get
|
|
1
|
+
import{AbstractModel}from"./abstract-model";export class SmartDbVersionViewModel extends AbstractModel{constructor(e){super(),e&&this.assign(e)}static getClassName(){return"SmartDbVersionViewModel"}static getTableName(){return"smart_db_version_view"}static getPrimaryKey(){return""}static from(e){let t=null;return e&&(t=new SmartDbVersionViewModel,e instanceof SmartDbVersionViewModel?Object.assign(t,e):t.assign(e)),t}clone(){return SmartDbVersionViewModel.from(this)}getClassName(){return"SmartDbVersionViewModel"}getTableName(){return"smart_db_version_view"}getPrimaryKey(){return""}getAttributeMap(){return SmartDbVersionViewModel.attributeMap}get id(){return this._id}set id(e){this._id=e}get ver_id(){return this._id}set ver_id(e){this._id=e}get module(){return this._module}set module(e){this._module=e}get ver_module(){return this._module}set ver_module(e){this._module=e}get sequence(){return this._sequence}set sequence(e){this._sequence=e}get ver_sequence(){return this._sequence}set ver_sequence(e){this._sequence=e}get version(){return this._version}set version(e){this._version=e}get ver_version(){return this._version}set ver_version(e){this._version=e}get subVersion(){return this._subVersion}set subVersion(e){this._subVersion=e}get ver_sub_version(){return this._subVersion}set ver_sub_version(e){this._subVersion=e}get revision(){return this._revision}set revision(e){this._revision=e}get ver_revision(){return this._revision}set ver_revision(e){this._revision=e}get releaseType(){return this._releaseType}set releaseType(e){this._releaseType=e}get ver_release_type(){return this._releaseType}set ver_release_type(e){this._releaseType=e}get installDate(){return this._installDate}set installDate(e){this._installDate=e}get ver_install_date(){return this._installDate}set ver_install_date(e){this._installDate=e}get versionString(){return this._versionString}set versionString(e){this._versionString=e}get ver_version_string(){return this._versionString}set ver_version_string(e){this._versionString=e}}SmartDbVersionViewModel.attributeMap={id:{alias:"ver_id",typeScriptStyle:!0,type:"number",attribute:"_id"},ver_id:{physical:!0,type:"number",attribute:"_id"},module:{alias:"ver_module",typeScriptStyle:!0,type:"string",attribute:"_module"},ver_module:{physical:!0,type:"string",attribute:"_module"},sequence:{alias:"ver_sequence",typeScriptStyle:!0,type:"number",attribute:"_sequence"},ver_sequence:{physical:!0,type:"number",attribute:"_sequence"},version:{alias:"ver_version",typeScriptStyle:!0,type:"string",attribute:"_version"},ver_version:{physical:!0,type:"string",attribute:"_version"},subVersion:{alias:"ver_sub_version",typeScriptStyle:!0,type:"string",attribute:"_subVersion"},ver_sub_version:{physical:!0,type:"string",attribute:"_subVersion"},revision:{alias:"ver_revision",typeScriptStyle:!0,type:"string",attribute:"_revision"},ver_revision:{physical:!0,type:"string",attribute:"_revision"},releaseType:{alias:"ver_release_type",typeScriptStyle:!0,type:"string",attribute:"_releaseType"},ver_release_type:{physical:!0,type:"string",attribute:"_releaseType"},installDate:{alias:"ver_install_date",typeScriptStyle:!0,type:"Date",attribute:"_installDate"},ver_install_date:{physical:!0,type:"Date",attribute:"_installDate"},versionString:{alias:"ver_version_string",typeScriptStyle:!0,type:"SqlValueType",attribute:"_versionString"},ver_version_string:{physical:!0,type:"SqlValueType",attribute:"_versionString"}};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@egi/smart-db",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.2",
|
|
4
4
|
"description": "Unified Smart DB Access",
|
|
5
5
|
"author": "Marcel Egloff",
|
|
6
6
|
"type": "module",
|
|
@@ -72,8 +72,8 @@
|
|
|
72
72
|
"glob": "^7.1.7",
|
|
73
73
|
"mocha": "^8.4.0",
|
|
74
74
|
"npm-run-all": "^4.1.5",
|
|
75
|
-
"
|
|
76
|
-
"
|
|
75
|
+
"terser": "^4.8.0",
|
|
76
|
+
"uglify-js": "^3.13.10"
|
|
77
77
|
},
|
|
78
78
|
"optionalDependencies": {
|
|
79
79
|
"better-sqlite3": "^7.1.0",
|