namirasoft-site 1.4.21 → 1.4.23
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/dist/NSBaseMetaDatabase.d.ts +2 -2
- package/dist/NSBaseMetaDatabase.js +3 -0
- package/dist/NSBaseMetaDatabase.js.map +1 -1
- package/dist/NSBaseMetaTable.d.ts +2 -2
- package/dist/NSBaseMetaTable.js.map +1 -1
- package/dist/NSBaseMetaTable_Backend.d.ts +5 -5
- package/dist/NSBaseMetaTable_Frontend.d.ts +1 -1
- package/dist/NSBaseMetaTable_Frontend.js.map +1 -1
- package/dist/NSNameParser.d.ts +22 -0
- package/dist/NSNameParser.js +67 -0
- package/dist/NSNameParser.js.map +1 -0
- package/dist/NameParser.d.ts +22 -0
- package/dist/NameParser.js +67 -0
- package/dist/NameParser.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/NSBaseMetaDatabase.ts +5 -2
- package/src/NSBaseMetaTable.ts +3 -3
- package/src/NSBaseMetaTable_Backend.ts +3 -3
- package/src/NSBaseMetaTable_Frontend.ts +2 -2
- package/src/NSNameParser.ts +133 -0
- package/src/index.ts +1 -0
|
@@ -2,9 +2,9 @@ import { BaseMetaDatabase } from "namirasoft-core";
|
|
|
2
2
|
import { NSBaseMetaTable } from "./NSBaseMetaTable";
|
|
3
3
|
import { NSBaseServer } from "./NSBaseServer";
|
|
4
4
|
export declare abstract class NSBaseMetaDatabase<Server extends NSBaseServer> extends BaseMetaDatabase {
|
|
5
|
-
static getServerBaseURL
|
|
5
|
+
static getServerBaseURL(product_name: string): string;
|
|
6
6
|
tables: {
|
|
7
|
-
[name: string]: NSBaseMetaTable<Server>;
|
|
7
|
+
[name: string]: NSBaseMetaTable<Server, any>;
|
|
8
8
|
};
|
|
9
9
|
product: {
|
|
10
10
|
id: string;
|
|
@@ -3,6 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.NSBaseMetaDatabase = void 0;
|
|
4
4
|
const namirasoft_core_1 = require("namirasoft-core");
|
|
5
5
|
class NSBaseMetaDatabase extends namirasoft_core_1.BaseMetaDatabase {
|
|
6
|
+
static getServerBaseURL(product_name) {
|
|
7
|
+
throw new Error(`NSBaseMetaDatabase.getServerBaseURL was not overriden. Requested: ${product_name}`);
|
|
8
|
+
}
|
|
6
9
|
constructor(product) {
|
|
7
10
|
super();
|
|
8
11
|
this.tables = {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NSBaseMetaDatabase.js","sourceRoot":"","sources":["../src/NSBaseMetaDatabase.ts"],"names":[],"mappings":";;;AAAA,qDAAmD;AAInD,MAAsB,kBAAgD,SAAQ,kCAAgB;
|
|
1
|
+
{"version":3,"file":"NSBaseMetaDatabase.js","sourceRoot":"","sources":["../src/NSBaseMetaDatabase.ts"],"names":[],"mappings":";;;AAAA,qDAAmD;AAInD,MAAsB,kBAAgD,SAAQ,kCAAgB;IAEnF,MAAM,CAAC,gBAAgB,CAAC,YAAoB;QAE/C,MAAM,IAAI,KAAK,CAAC,qEAAqE,YAAY,EAAE,CAAC,CAAC;IACzG,CAAC;IAWD,YAAY,OAOX;QAEG,KAAK,EAAE,CAAC;QAnBH,WAAM,GAAsD,EAAE,CAAC;QAoBpE,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IAC3B,CAAC;CACJ;AA5BD,gDA4BC;AAAA,CAAC"}
|
|
@@ -3,12 +3,12 @@ import { NSBaseMetaTable_Frontend } from "./NSBaseMetaTable_Frontend";
|
|
|
3
3
|
import { NSBaseMetaDatabase } from "./NSBaseMetaDatabase";
|
|
4
4
|
import { NSBaseMetaTable_Backend } from "./NSBaseMetaTable_Backend";
|
|
5
5
|
import { NSBaseServer } from "./NSBaseServer";
|
|
6
|
-
export declare abstract class NSBaseMetaTable<Server extends NSBaseServer> extends BaseMetaTable {
|
|
6
|
+
export declare abstract class NSBaseMetaTable<Server extends NSBaseServer, Row> extends BaseMetaTable {
|
|
7
7
|
private static field_tables;
|
|
8
8
|
database: NSBaseMetaDatabase<Server>;
|
|
9
9
|
uuid: BaseUUID;
|
|
10
10
|
front_end: NSBaseMetaTable_Frontend;
|
|
11
|
-
back_end: NSBaseMetaTable_Backend
|
|
11
|
+
back_end: NSBaseMetaTable_Backend<Row>;
|
|
12
12
|
constructor(database: NSBaseMetaDatabase<Server>, name: string, text: string, uuid: BaseUUID);
|
|
13
13
|
isFieldTables(): boolean;
|
|
14
14
|
hasFieldTables(): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NSBaseMetaTable.js","sourceRoot":"","sources":["../src/NSBaseMetaTable.ts"],"names":[],"mappings":";;;AAAA,qDAA0D;AAC1D,yEAAsE;AAEtE,uEAAoE;AAGpE,MAAsB,
|
|
1
|
+
{"version":3,"file":"NSBaseMetaTable.js","sourceRoot":"","sources":["../src/NSBaseMetaTable.ts"],"names":[],"mappings":";;;AAAA,qDAA0D;AAC1D,yEAAsE;AAEtE,uEAAoE;AAGpE,MAAsB,eAAkD,SAAQ,+BAAa;IAOzF,YAAY,QAAoC,EAAE,IAAY,EAAE,IAAY,EAAE,IAAc;QAExF,KAAK,CAAC,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;QAC5B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,SAAS,GAAG,IAAI,mDAAwB,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAC1D,IAAI,CAAC,QAAQ,GAAG,IAAI,iDAAuB,EAAO,CAAC;IACvD,CAAC;IACD,aAAa;QAET,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,eAAe,CAAC,YAAY,CAAC,MAAM,EAAE,CAAC,EAAE,EAC5D,CAAC;YACG,MAAM,KAAK,GAAG,eAAe,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;YAC9C,IAAI,IAAI,CAAC,IAAI,KAAK,KAAK;gBACnB,IAAI,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,GAAG,KAAK,CAAC;oBAC/B,OAAO,IAAI,CAAC;QACxB,CAAC;QACD,OAAO,KAAK,CAAC;IACjB,CAAC;IACD,cAAc;QAEV,IAAI,IAAI,CAAC,QAAQ;YACb,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,eAAe,CAAC,YAAY,CAAC,MAAM,EAAE,CAAC,EAAE;gBACxD,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,GAAG,GAAG,GAAG,eAAe,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;oBACvE,OAAO,IAAI,CAAC;QACxB,OAAO,KAAK,CAAC;IACjB,CAAC;;AAjCL,0CAkCC;AAhCkB,4BAAY,GAAG,CAAC,KAAK,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;AAgC9D,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { FilterItem, SortItem } from "namirasoft-core";
|
|
2
|
-
export declare class NSBaseMetaTable_Backend {
|
|
3
|
-
get?: (id: string) =>
|
|
4
|
-
list?: (filters: FilterItem[] | null, page: (number | null), size: (number | null), sorts: SortItem[]) => {
|
|
5
|
-
rows:
|
|
2
|
+
export declare class NSBaseMetaTable_Backend<Row> {
|
|
3
|
+
get?: (id: string) => Promise<Row>;
|
|
4
|
+
list?: (filters: FilterItem[] | null, page: (number | null), size: (number | null), sorts: SortItem[]) => Promise<{
|
|
5
|
+
rows: Row[];
|
|
6
6
|
count: number;
|
|
7
|
-
}
|
|
7
|
+
}>;
|
|
8
8
|
}
|
|
@@ -2,7 +2,7 @@ import { NSBaseMetaTable } from "./NSBaseMetaTable";
|
|
|
2
2
|
export declare class NSBaseMetaTable_Frontend {
|
|
3
3
|
private table;
|
|
4
4
|
private base;
|
|
5
|
-
constructor(table: NSBaseMetaTable<any>, name: string);
|
|
5
|
+
constructor(table: NSBaseMetaTable<any, any>, name: string);
|
|
6
6
|
getBaseLink(): string;
|
|
7
7
|
getListLink(): string;
|
|
8
8
|
getNewLink(): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NSBaseMetaTable_Frontend.js","sourceRoot":"","sources":["../src/NSBaseMetaTable_Frontend.ts"],"names":[],"mappings":";;;AAAA,qDAAmD;AAGnD,MAAa,wBAAwB;IAIjC,YAAY,
|
|
1
|
+
{"version":3,"file":"NSBaseMetaTable_Frontend.js","sourceRoot":"","sources":["../src/NSBaseMetaTable_Frontend.ts"],"names":[],"mappings":";;;AAAA,qDAAmD;AAGnD,MAAa,wBAAwB;IAIjC,YAAY,KAAgC,EAAE,IAAY;QAEtD,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,IAAI,GAAG,kCAAgB,CAAC,qBAAqB,CAAC,OAAO,CAAC,IAAI,EAAE,kCAAgB,CAAC,gBAAgB,CAAC,CAAA;IACvG,CAAC;IACM,WAAW;QAEd,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,GAAG,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC;IAC9D,CAAC;IACM,WAAW;QAEd,OAAO,IAAI,CAAC,WAAW,EAAE,GAAG,OAAO,CAAC;IACxC,CAAC;IACM,UAAU;QAEb,OAAO,IAAI,CAAC,WAAW,EAAE,GAAG,MAAM,CAAC;IACvC,CAAC;IACM,WAAW,CAAC,EAAU;QAEzB,OAAO,IAAI,CAAC,WAAW,EAAE,GAAG,GAAG,GAAG,EAAE,GAAG,OAAO,CAAC;IACnD,CAAC;IACM,aAAa,CAAC,EAAU;QAE3B,OAAO,IAAI,CAAC,WAAW,EAAE,GAAG,GAAG,GAAG,EAAE,GAAG,OAAO,CAAC;IACnD,CAAC;CACJ;AA7BD,4DA6BC;AAAA,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export type NSNameParserStructure = {
|
|
2
|
+
name_namirasoft: string;
|
|
3
|
+
name_short: string;
|
|
4
|
+
title_namirasoft: string;
|
|
5
|
+
title_short: string;
|
|
6
|
+
class_namirasoft: string;
|
|
7
|
+
class_short: string;
|
|
8
|
+
};
|
|
9
|
+
export declare class NSNameParser {
|
|
10
|
+
name_full: string;
|
|
11
|
+
title_full: string;
|
|
12
|
+
isAPI: boolean;
|
|
13
|
+
isConsole: boolean;
|
|
14
|
+
isLibrary: boolean;
|
|
15
|
+
isNPM: boolean;
|
|
16
|
+
isPHP: boolean;
|
|
17
|
+
isAccountAPI: boolean;
|
|
18
|
+
api: NSNameParserStructure;
|
|
19
|
+
console: NSNameParserStructure;
|
|
20
|
+
library: NSNameParserStructure;
|
|
21
|
+
constructor(name_full: string, title_full: string);
|
|
22
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NSNameParser = void 0;
|
|
4
|
+
const namirasoft_core_1 = require("namirasoft-core");
|
|
5
|
+
class NSNameParser {
|
|
6
|
+
constructor(name_full, title_full) {
|
|
7
|
+
this.api = {
|
|
8
|
+
name_namirasoft: "",
|
|
9
|
+
name_short: "",
|
|
10
|
+
title_namirasoft: "",
|
|
11
|
+
title_short: "",
|
|
12
|
+
class_namirasoft: "",
|
|
13
|
+
class_short: "",
|
|
14
|
+
};
|
|
15
|
+
this.console = {
|
|
16
|
+
name_namirasoft: "",
|
|
17
|
+
name_short: "",
|
|
18
|
+
title_namirasoft: "",
|
|
19
|
+
title_short: "",
|
|
20
|
+
class_namirasoft: "",
|
|
21
|
+
class_short: "",
|
|
22
|
+
};
|
|
23
|
+
this.library = {
|
|
24
|
+
name_namirasoft: "",
|
|
25
|
+
name_short: "",
|
|
26
|
+
title_namirasoft: "",
|
|
27
|
+
title_short: "",
|
|
28
|
+
class_namirasoft: "",
|
|
29
|
+
class_short: "",
|
|
30
|
+
};
|
|
31
|
+
this.name_full = name_full;
|
|
32
|
+
this.title_full = title_full;
|
|
33
|
+
this.isAPI = /^namirasoft(-\w*)*-api(-\w*)*-v\d+$/gm.test(name_full);
|
|
34
|
+
this.isConsole = /^namirasoft-(\w+-)+console$/gm.test(name_full);
|
|
35
|
+
this.isLibrary = !this.isAPI && !this.isConsole && /^namirasoft-\w+/gm.test(name_full);
|
|
36
|
+
this.isNPM = this.isLibrary && /NPM Package$/gm.test(title_full);
|
|
37
|
+
this.isPHP = this.isLibrary && /PHP Package$/gm.test(title_full);
|
|
38
|
+
this.isAccountAPI = /^namirasoft-account-api-v\d+$/gm.test(name_full);
|
|
39
|
+
if (this.isAPI) {
|
|
40
|
+
this.api.name_namirasoft = this.name_full.replace(/(-api)?-v\d+$/gm, "");
|
|
41
|
+
this.api.name_short = this.api.name_namirasoft.replace(/^namirasoft-/gm, "");
|
|
42
|
+
this.api.title_namirasoft = this.title_full.replace(/(\sAPI)?\sV\d+$/gm, "");
|
|
43
|
+
this.api.title_short = this.api.title_namirasoft.replace(/^Namirasoft\s/gm, "");
|
|
44
|
+
this.api.class_namirasoft = namirasoft_core_1.NamingConvention.auto.convert(this.api.title_namirasoft, namirasoft_core_1.NamingConvention.Pascal_Case);
|
|
45
|
+
this.api.class_short = namirasoft_core_1.NamingConvention.auto.convert(this.api.title_short, namirasoft_core_1.NamingConvention.Pascal_Case);
|
|
46
|
+
}
|
|
47
|
+
if (this.isConsole) {
|
|
48
|
+
this.console.name_namirasoft = this.name_full.replace(/-console$/gm, "");
|
|
49
|
+
this.console.name_short = this.console.name_namirasoft.replace(/^namirasoft-/gm, "");
|
|
50
|
+
this.console.title_namirasoft = this.title_full.replace(/\sConsole$/gm, "");
|
|
51
|
+
this.console.title_short = this.console.title_namirasoft.replace(/^Namirasoft\s/gm, "");
|
|
52
|
+
this.console.class_namirasoft = namirasoft_core_1.NamingConvention.auto.convert(this.console.title_namirasoft, namirasoft_core_1.NamingConvention.Pascal_Case);
|
|
53
|
+
this.console.class_short = namirasoft_core_1.NamingConvention.auto.convert(this.console.title_short, namirasoft_core_1.NamingConvention.Pascal_Case);
|
|
54
|
+
}
|
|
55
|
+
if (this.isLibrary) {
|
|
56
|
+
this.library.name_namirasoft = this.name_full;
|
|
57
|
+
this.library.name_short = this.library.name_namirasoft.replace(/^namirasoft-/gm, "");
|
|
58
|
+
this.library.title_namirasoft = this.title_full.replace(/\s(NPM|PHP)\sPackage$/gm, "");
|
|
59
|
+
this.library.title_short = this.library.title_namirasoft.replace(/^Namirasoft\s/gm, "");
|
|
60
|
+
this.library.class_namirasoft = namirasoft_core_1.NamingConvention.auto.convert(this.library.title_namirasoft, namirasoft_core_1.NamingConvention.Pascal_Case);
|
|
61
|
+
this.library.class_short = namirasoft_core_1.NamingConvention.auto.convert(this.library.title_short, namirasoft_core_1.NamingConvention.Pascal_Case);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
exports.NSNameParser = NSNameParser;
|
|
66
|
+
;
|
|
67
|
+
//# sourceMappingURL=NSNameParser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NSNameParser.js","sourceRoot":"","sources":["../src/NSNameParser.ts"],"names":[],"mappings":";;;AAAA,qDAAmD;AAiBnD,MAAa,YAAY;IAwDrB,YAAY,SAAiB,EAAE,UAAkB;QA1C1C,QAAG,GAA0B;YAEhC,eAAe,EAAE,EAAE;YACnB,UAAU,EAAE,EAAE;YAGd,gBAAgB,EAAE,EAAE;YACpB,WAAW,EAAE,EAAE;YAGf,gBAAgB,EAAE,EAAE;YACpB,WAAW,EAAE,EAAE;SAClB,CAAC;QAEK,YAAO,GAA0B;YAEpC,eAAe,EAAE,EAAE;YACnB,UAAU,EAAE,EAAE;YAGd,gBAAgB,EAAE,EAAE;YACpB,WAAW,EAAE,EAAE;YAGf,gBAAgB,EAAE,EAAE;YACpB,WAAW,EAAE,EAAE;S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C,WAAW,CAAC,CAAC;QACrH,CAAC;QAED,IAAI,IAAI,CAAC,SAAS,EAClB,CAAC;YAEG,IAAI,CAAC,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC,SAAS,CAAC;YAC9C,IAAI,CAAC,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,OAAO,CAAC,gBAAgB,EAAE,EAAE,CAAC,CAAC;YAGrF,IAAI,CAAC,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,yBAAyB,EAAE,EAAE,CAAC,CAAC;YACvF,IAAI,CAAC,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,OAAO,CAAC,iBAAiB,EAAE,EAAE,CAAC,CAAC;YAGxF,IAAI,CAAC,OAAO,CAAC,gBAAgB,GAAG,kCAAgB,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,gBAAgB,EAAE,kCAAgB,CAAC,WAAW,CAAC,CAAC;YAC3H,IAAI,CAAC,OAAO,CAAC,WAAW,GAAG,kCAAgB,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,kCAAgB,CAAC,WAAW,CAAC,CAAC;QACrH,CAAC;IACL,CAAC;CACJ;AAnHD,oCAmHC;AAAA,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export type NameParserStructure = {
|
|
2
|
+
name_namirasoft: string;
|
|
3
|
+
name_short: string;
|
|
4
|
+
title_namirasoft: string;
|
|
5
|
+
title_short: string;
|
|
6
|
+
class_namirasoft: string;
|
|
7
|
+
class_short: string;
|
|
8
|
+
};
|
|
9
|
+
export declare class NameParser {
|
|
10
|
+
name_full: string;
|
|
11
|
+
title_full: string;
|
|
12
|
+
isAPI: boolean;
|
|
13
|
+
isConsole: boolean;
|
|
14
|
+
isLibrary: boolean;
|
|
15
|
+
isNPM: boolean;
|
|
16
|
+
isPHP: boolean;
|
|
17
|
+
isAccountAPI: boolean;
|
|
18
|
+
api: NameParserStructure;
|
|
19
|
+
console: NameParserStructure;
|
|
20
|
+
library: NameParserStructure;
|
|
21
|
+
constructor(name_full: string, title_full: string);
|
|
22
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NameParser = void 0;
|
|
4
|
+
const namirasoft_core_1 = require("namirasoft-core");
|
|
5
|
+
class NameParser {
|
|
6
|
+
constructor(name_full, title_full) {
|
|
7
|
+
this.api = {
|
|
8
|
+
name_namirasoft: "",
|
|
9
|
+
name_short: "",
|
|
10
|
+
title_namirasoft: "",
|
|
11
|
+
title_short: "",
|
|
12
|
+
class_namirasoft: "",
|
|
13
|
+
class_short: "",
|
|
14
|
+
};
|
|
15
|
+
this.console = {
|
|
16
|
+
name_namirasoft: "",
|
|
17
|
+
name_short: "",
|
|
18
|
+
title_namirasoft: "",
|
|
19
|
+
title_short: "",
|
|
20
|
+
class_namirasoft: "",
|
|
21
|
+
class_short: "",
|
|
22
|
+
};
|
|
23
|
+
this.library = {
|
|
24
|
+
name_namirasoft: "",
|
|
25
|
+
name_short: "",
|
|
26
|
+
title_namirasoft: "",
|
|
27
|
+
title_short: "",
|
|
28
|
+
class_namirasoft: "",
|
|
29
|
+
class_short: "",
|
|
30
|
+
};
|
|
31
|
+
this.name_full = name_full;
|
|
32
|
+
this.title_full = title_full;
|
|
33
|
+
this.isAPI = /^namirasoft(-\w*)*-api(-\w*)*-v\d+$/gm.test(name_full);
|
|
34
|
+
this.isConsole = /^namirasoft-(\w+-)+console$/gm.test(name_full);
|
|
35
|
+
this.isLibrary = !this.isAPI && !this.isConsole && /^namirasoft-\w+/gm.test(name_full);
|
|
36
|
+
this.isNPM = this.isLibrary && /NPM Package$/gm.test(title_full);
|
|
37
|
+
this.isPHP = this.isLibrary && /PHP Package$/gm.test(title_full);
|
|
38
|
+
this.isAccountAPI = /^namirasoft-account-api-v\d+$/gm.test(name_full);
|
|
39
|
+
if (this.isAPI) {
|
|
40
|
+
this.api.name_namirasoft = this.name_full.replace(/(-api)?-v\d+$/gm, "");
|
|
41
|
+
this.api.name_short = this.api.name_namirasoft.replace(/^namirasoft-/gm, "");
|
|
42
|
+
this.api.title_namirasoft = this.title_full.replace(/(\sAPI)?\sV\d+$/gm, "");
|
|
43
|
+
this.api.title_short = this.api.title_namirasoft.replace(/^Namirasoft\s/gm, "");
|
|
44
|
+
this.api.class_namirasoft = namirasoft_core_1.NamingConvention.auto.convert(this.api.title_namirasoft, namirasoft_core_1.NamingConvention.Pascal_Case);
|
|
45
|
+
this.api.class_short = namirasoft_core_1.NamingConvention.auto.convert(this.api.title_short, namirasoft_core_1.NamingConvention.Pascal_Case);
|
|
46
|
+
}
|
|
47
|
+
if (this.isConsole) {
|
|
48
|
+
this.console.name_namirasoft = this.name_full.replace(/-console$/gm, "");
|
|
49
|
+
this.console.name_short = this.console.name_namirasoft.replace(/^namirasoft-/gm, "");
|
|
50
|
+
this.console.title_namirasoft = this.title_full.replace(/\sConsole$/gm, "");
|
|
51
|
+
this.console.title_short = this.console.title_namirasoft.replace(/^Namirasoft\s/gm, "");
|
|
52
|
+
this.console.class_namirasoft = namirasoft_core_1.NamingConvention.auto.convert(this.console.title_namirasoft, namirasoft_core_1.NamingConvention.Pascal_Case);
|
|
53
|
+
this.console.class_short = namirasoft_core_1.NamingConvention.auto.convert(this.console.title_short, namirasoft_core_1.NamingConvention.Pascal_Case);
|
|
54
|
+
}
|
|
55
|
+
if (this.isLibrary) {
|
|
56
|
+
this.library.name_namirasoft = this.name_full;
|
|
57
|
+
this.library.name_short = this.library.name_namirasoft.replace(/^namirasoft-/gm, "");
|
|
58
|
+
this.library.title_namirasoft = this.title_full.replace(/\s(NPM|PHP)\sPackage$/gm, "");
|
|
59
|
+
this.library.title_short = this.library.title_namirasoft.replace(/^Namirasoft\s/gm, "");
|
|
60
|
+
this.library.class_namirasoft = namirasoft_core_1.NamingConvention.auto.convert(this.library.title_namirasoft, namirasoft_core_1.NamingConvention.Pascal_Case);
|
|
61
|
+
this.library.class_short = namirasoft_core_1.NamingConvention.auto.convert(this.library.title_short, namirasoft_core_1.NamingConvention.Pascal_Case);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
exports.NameParser = NameParser;
|
|
66
|
+
;
|
|
67
|
+
//# sourceMappingURL=NameParser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NameParser.js","sourceRoot":"","sources":["../src/NameParser.ts"],"names":[],"mappings":";;;AAAA,qDAAmD;AAiBnD,MAAa,UAAU;IAyDnB,YAAY,SAAiB,EAAE,UAAkB;QA1C1C,QAAG,GAAwB;YAE9B,eAAe,EAAE,EAAE;YACnB,UAAU,EAAE,EAAE;YAGd,gBAAgB,EAAE,EAAE;YACpB,WAAW,EAAE,EAAE;YAGf,gBAAgB,EAAE,EAAE;YACpB,WAAW,EAAE,EAAE;SAClB,CAAC;QAEK,YAAO,GAAwB;YAElC,eAAe,EAAE,EAAE;YACnB,UAAU,EAAE,EAAE;YAGd,gBAAgB,EAAE,EAAE;YACpB,WAAW,EAAE,EAAE;YAGf,gBAAgB,EAAE,EAAE;YACpB,WAAW,EAAE,EAAE;SAClB,CAAC;QAEK,YAAO,GAAwB;YAElC,eAAe,EAAE,EAAE;YACnB,UAAU,EAAE,EAAE;YAGd,gBAAgB,EAAE,EAAE;YACpB,WAAW,EAAE,EAAE;YAGf,gBAAgB,EAAE,EAAE;YACpB,WAAW,EAAE,EAAE;SAClB,CAAC;QAKE,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAG7B,IAAI,CAAC,KAAK,GAAG,uCAAuC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACrE,IAAI,CAAC,SAAS,GAAG,+BAA+B,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AC,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,OAAO,CAAC,iBAAiB,EAAE,EAAE,CAAC,CAAC;YAGxF,IAAI,CAAC,OAAO,CAAC,gBAAgB,GAAG,kCAAgB,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,gBAAgB,EAAE,kCAAgB,CAAC,WAAW,CAAC,CAAC;YAC3H,IAAI,CAAC,OAAO,CAAC,WAAW,GAAG,kCAAgB,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,kCAAgB,CAAC,WAAW,CAAC,CAAC;QACrH,CAAC;IACL,CAAC;CACJ;AApHD,gCAoHC;AAAA,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export * from "./NSBaseMetaDatabase";
|
|
|
3
3
|
export * from "./NSBaseMetaTable";
|
|
4
4
|
export * from "./NSCookiesHeader";
|
|
5
5
|
export * from "./NSHeader";
|
|
6
|
+
export * from "./NSNameParser";
|
|
6
7
|
export * from "./NSReqHeader";
|
|
7
8
|
export * from "./NSResHeader";
|
|
8
9
|
export * from "./ProductUUID";
|
package/dist/index.js
CHANGED
|
@@ -19,6 +19,7 @@ __exportStar(require("./NSBaseMetaDatabase"), exports);
|
|
|
19
19
|
__exportStar(require("./NSBaseMetaTable"), exports);
|
|
20
20
|
__exportStar(require("./NSCookiesHeader"), exports);
|
|
21
21
|
__exportStar(require("./NSHeader"), exports);
|
|
22
|
+
__exportStar(require("./NSNameParser"), exports);
|
|
22
23
|
__exportStar(require("./NSReqHeader"), exports);
|
|
23
24
|
__exportStar(require("./NSResHeader"), exports);
|
|
24
25
|
__exportStar(require("./ProductUUID"), exports);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA+B;AAC/B,uDAAqC;AACrC,oDAAkC;AAClC,oDAAkC;AAClC,6CAA2B;AAC3B,gDAA8B;AAC9B,gDAA8B;AAC9B,gDAA8B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA+B;AAC/B,uDAAqC;AACrC,oDAAkC;AAClC,oDAAkC;AAClC,6CAA2B;AAC3B,iDAA+B;AAC/B,gDAA8B;AAC9B,gDAA8B;AAC9B,gDAA8B"}
|
package/package.json
CHANGED
|
@@ -4,8 +4,11 @@ import { NSBaseServer } from "./NSBaseServer";
|
|
|
4
4
|
|
|
5
5
|
export abstract class NSBaseMetaDatabase<Server extends NSBaseServer> extends BaseMetaDatabase
|
|
6
6
|
{
|
|
7
|
-
public static getServerBaseURL
|
|
8
|
-
|
|
7
|
+
public static getServerBaseURL(product_name: string): string
|
|
8
|
+
{
|
|
9
|
+
throw new Error(`NSBaseMetaDatabase.getServerBaseURL was not overriden. Requested: ${product_name}`);
|
|
10
|
+
}
|
|
11
|
+
override tables: { [name: string]: NSBaseMetaTable<Server, any>; } = {};
|
|
9
12
|
public product: {
|
|
10
13
|
id: string;
|
|
11
14
|
name: string;
|
package/src/NSBaseMetaTable.ts
CHANGED
|
@@ -4,20 +4,20 @@ import { NSBaseMetaDatabase } from "./NSBaseMetaDatabase";
|
|
|
4
4
|
import { NSBaseMetaTable_Backend } from "./NSBaseMetaTable_Backend";
|
|
5
5
|
import { NSBaseServer } from "./NSBaseServer";
|
|
6
6
|
|
|
7
|
-
export abstract class NSBaseMetaTable<Server extends NSBaseServer> extends BaseMetaTable
|
|
7
|
+
export abstract class NSBaseMetaTable<Server extends NSBaseServer, Row> extends BaseMetaTable
|
|
8
8
|
{
|
|
9
9
|
private static field_tables = ["tag", "category", "field"];
|
|
10
10
|
override database: NSBaseMetaDatabase<Server>;
|
|
11
11
|
public uuid: BaseUUID;
|
|
12
12
|
public front_end: NSBaseMetaTable_Frontend;
|
|
13
|
-
public back_end: NSBaseMetaTable_Backend
|
|
13
|
+
public back_end: NSBaseMetaTable_Backend<Row>;
|
|
14
14
|
constructor(database: NSBaseMetaDatabase<Server>, name: string, text: string, uuid: BaseUUID)
|
|
15
15
|
{
|
|
16
16
|
super(database, name, text);
|
|
17
17
|
this.database = database;
|
|
18
18
|
this.uuid = uuid;
|
|
19
19
|
this.front_end = new NSBaseMetaTable_Frontend(this, name);
|
|
20
|
-
this.back_end = new NSBaseMetaTable_Backend();
|
|
20
|
+
this.back_end = new NSBaseMetaTable_Backend<Row>();
|
|
21
21
|
}
|
|
22
22
|
isFieldTables(): boolean
|
|
23
23
|
{
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FilterItem, SortItem } from "namirasoft-core";
|
|
2
2
|
|
|
3
|
-
export class NSBaseMetaTable_Backend
|
|
3
|
+
export class NSBaseMetaTable_Backend<Row>
|
|
4
4
|
{
|
|
5
|
-
get?: (id: string) =>
|
|
6
|
-
list?: (filters: FilterItem[] | null, page: (number | null), size: (number | null), sorts: SortItem[]) => { rows:
|
|
5
|
+
get?: (id: string) => Promise<Row>;
|
|
6
|
+
list?: (filters: FilterItem[] | null, page: (number | null), size: (number | null), sorts: SortItem[]) => Promise<{ rows: Row[], count: number }>;
|
|
7
7
|
};
|
|
@@ -3,9 +3,9 @@ import { NSBaseMetaTable } from "./NSBaseMetaTable";
|
|
|
3
3
|
|
|
4
4
|
export class NSBaseMetaTable_Frontend
|
|
5
5
|
{
|
|
6
|
-
private table: NSBaseMetaTable<any>;
|
|
6
|
+
private table: NSBaseMetaTable<any, any>;
|
|
7
7
|
private base: string;
|
|
8
|
-
constructor(table: NSBaseMetaTable<any>, name: string)
|
|
8
|
+
constructor(table: NSBaseMetaTable<any, any>, name: string)
|
|
9
9
|
{
|
|
10
10
|
this.table = table;
|
|
11
11
|
this.base = NamingConvention.lower_case_underscore.convert(name, NamingConvention.lower_case_slash)
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { NamingConvention } from "namirasoft-core";
|
|
2
|
+
|
|
3
|
+
export type NSNameParserStructure =
|
|
4
|
+
{
|
|
5
|
+
// Name
|
|
6
|
+
name_namirasoft: string;
|
|
7
|
+
name_short: string;
|
|
8
|
+
|
|
9
|
+
// Title
|
|
10
|
+
title_namirasoft: string;
|
|
11
|
+
title_short: string;
|
|
12
|
+
|
|
13
|
+
// Class
|
|
14
|
+
class_namirasoft: string;
|
|
15
|
+
class_short: string;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export class NSNameParser
|
|
19
|
+
{
|
|
20
|
+
// Input
|
|
21
|
+
public name_full: string;
|
|
22
|
+
public title_full: string;
|
|
23
|
+
|
|
24
|
+
// Is
|
|
25
|
+
public isAPI: boolean;
|
|
26
|
+
public isConsole: boolean;
|
|
27
|
+
public isLibrary: boolean;
|
|
28
|
+
public isNPM: boolean;
|
|
29
|
+
public isPHP: boolean;
|
|
30
|
+
public isAccountAPI: boolean;
|
|
31
|
+
|
|
32
|
+
public api: NSNameParserStructure = {
|
|
33
|
+
// Name
|
|
34
|
+
name_namirasoft: "",
|
|
35
|
+
name_short: "",
|
|
36
|
+
|
|
37
|
+
// Title
|
|
38
|
+
title_namirasoft: "",
|
|
39
|
+
title_short: "",
|
|
40
|
+
|
|
41
|
+
// Class
|
|
42
|
+
class_namirasoft: "",
|
|
43
|
+
class_short: "",
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
public console: NSNameParserStructure = {
|
|
47
|
+
// Name
|
|
48
|
+
name_namirasoft: "",
|
|
49
|
+
name_short: "",
|
|
50
|
+
|
|
51
|
+
// Title
|
|
52
|
+
title_namirasoft: "",
|
|
53
|
+
title_short: "",
|
|
54
|
+
|
|
55
|
+
// Class
|
|
56
|
+
class_namirasoft: "",
|
|
57
|
+
class_short: "",
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
public library: NSNameParserStructure = {
|
|
61
|
+
// Name
|
|
62
|
+
name_namirasoft: "",
|
|
63
|
+
name_short: "",
|
|
64
|
+
|
|
65
|
+
// Title
|
|
66
|
+
title_namirasoft: "",
|
|
67
|
+
title_short: "",
|
|
68
|
+
|
|
69
|
+
// Class
|
|
70
|
+
class_namirasoft: "",
|
|
71
|
+
class_short: "",
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
constructor(name_full: string, title_full: string)
|
|
75
|
+
{
|
|
76
|
+
// Input
|
|
77
|
+
this.name_full = name_full;
|
|
78
|
+
this.title_full = title_full;
|
|
79
|
+
|
|
80
|
+
// Is
|
|
81
|
+
this.isAPI = /^namirasoft(-\w*)*-api(-\w*)*-v\d+$/gm.test(name_full);
|
|
82
|
+
this.isConsole = /^namirasoft-(\w+-)+console$/gm.test(name_full);
|
|
83
|
+
this.isLibrary = !this.isAPI && !this.isConsole && /^namirasoft-\w+/gm.test(name_full);
|
|
84
|
+
this.isNPM = this.isLibrary && /NPM Package$/gm.test(title_full);
|
|
85
|
+
this.isPHP = this.isLibrary && /PHP Package$/gm.test(title_full);
|
|
86
|
+
this.isAccountAPI = /^namirasoft-account-api-v\d+$/gm.test(name_full);
|
|
87
|
+
|
|
88
|
+
if (this.isAPI)
|
|
89
|
+
{
|
|
90
|
+
// Name
|
|
91
|
+
this.api.name_namirasoft = this.name_full.replace(/(-api)?-v\d+$/gm, "");
|
|
92
|
+
this.api.name_short = this.api.name_namirasoft.replace(/^namirasoft-/gm, "");
|
|
93
|
+
|
|
94
|
+
// Title
|
|
95
|
+
this.api.title_namirasoft = this.title_full.replace(/(\sAPI)?\sV\d+$/gm, "");
|
|
96
|
+
this.api.title_short = this.api.title_namirasoft.replace(/^Namirasoft\s/gm, "");
|
|
97
|
+
|
|
98
|
+
// Class
|
|
99
|
+
this.api.class_namirasoft = NamingConvention.auto.convert(this.api.title_namirasoft, NamingConvention.Pascal_Case);
|
|
100
|
+
this.api.class_short = NamingConvention.auto.convert(this.api.title_short, NamingConvention.Pascal_Case);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
if (this.isConsole)
|
|
104
|
+
{
|
|
105
|
+
// Name
|
|
106
|
+
this.console.name_namirasoft = this.name_full.replace(/-console$/gm, "");
|
|
107
|
+
this.console.name_short = this.console.name_namirasoft.replace(/^namirasoft-/gm, "");
|
|
108
|
+
|
|
109
|
+
// Title
|
|
110
|
+
this.console.title_namirasoft = this.title_full.replace(/\sConsole$/gm, "");
|
|
111
|
+
this.console.title_short = this.console.title_namirasoft.replace(/^Namirasoft\s/gm, "");
|
|
112
|
+
|
|
113
|
+
// Class
|
|
114
|
+
this.console.class_namirasoft = NamingConvention.auto.convert(this.console.title_namirasoft, NamingConvention.Pascal_Case);
|
|
115
|
+
this.console.class_short = NamingConvention.auto.convert(this.console.title_short, NamingConvention.Pascal_Case);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
if (this.isLibrary)
|
|
119
|
+
{
|
|
120
|
+
// Name
|
|
121
|
+
this.library.name_namirasoft = this.name_full;
|
|
122
|
+
this.library.name_short = this.library.name_namirasoft.replace(/^namirasoft-/gm, "");
|
|
123
|
+
|
|
124
|
+
// Title
|
|
125
|
+
this.library.title_namirasoft = this.title_full.replace(/\s(NPM|PHP)\sPackage$/gm, "");
|
|
126
|
+
this.library.title_short = this.library.title_namirasoft.replace(/^Namirasoft\s/gm, "");
|
|
127
|
+
|
|
128
|
+
// Class
|
|
129
|
+
this.library.class_namirasoft = NamingConvention.auto.convert(this.library.title_namirasoft, NamingConvention.Pascal_Case);
|
|
130
|
+
this.library.class_short = NamingConvention.auto.convert(this.library.title_short, NamingConvention.Pascal_Case);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
};
|
package/src/index.ts
CHANGED
|
@@ -3,6 +3,7 @@ export * from "./NSBaseMetaDatabase";
|
|
|
3
3
|
export * from "./NSBaseMetaTable";
|
|
4
4
|
export * from "./NSCookiesHeader";
|
|
5
5
|
export * from "./NSHeader";
|
|
6
|
+
export * from "./NSNameParser";
|
|
6
7
|
export * from "./NSReqHeader";
|
|
7
8
|
export * from "./NSResHeader";
|
|
8
9
|
export * from "./ProductUUID";
|