namirasoft-field-node 1.4.39 → 1.4.40

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.
Files changed (44) hide show
  1. package/dist/controller/entity_category/List.js +2 -2
  2. package/dist/controller/entity_category/List.js.map +1 -1
  3. package/dist/controller/entity_field/List.js +2 -2
  4. package/dist/controller/entity_field/List.js.map +1 -1
  5. package/dist/controller/entity_tag/List.js +2 -2
  6. package/dist/controller/entity_tag/List.js.map +1 -1
  7. package/package.json +30 -30
  8. package/src/CTFModel.ts +9 -9
  9. package/src/CTFRow.ts +7 -7
  10. package/src/NSFApplication.ts +42 -42
  11. package/src/NamirasoftFieldUUIDShort.ts +4 -4
  12. package/src/controller/BaseEntityFieldController.ts +22 -22
  13. package/src/controller/BaseEntityFieldControllerProps.ts +4 -4
  14. package/src/controller/BaseEntityFieldControllerState.ts +4 -4
  15. package/src/controller/NSFController.ts +14 -14
  16. package/src/controller/NSFListController.ts +87 -87
  17. package/src/controller/entity_category/Create.ts +53 -53
  18. package/src/controller/entity_category/Delete.ts +50 -50
  19. package/src/controller/entity_category/Get.ts +51 -51
  20. package/src/controller/entity_category/List.ts +58 -58
  21. package/src/controller/entity_field/Create.ts +53 -53
  22. package/src/controller/entity_field/Delete.ts +50 -50
  23. package/src/controller/entity_field/Get.ts +51 -51
  24. package/src/controller/entity_field/List.ts +59 -59
  25. package/src/controller/entity_field/Update.ts +54 -54
  26. package/src/controller/entity_tag/Create.ts +53 -53
  27. package/src/controller/entity_tag/Delete.ts +50 -50
  28. package/src/controller/entity_tag/Get.ts +51 -51
  29. package/src/controller/entity_tag/List.ts +58 -58
  30. package/src/controller/entity_tag/Update.ts +54 -54
  31. package/src/database/NSFTables.ts +103 -103
  32. package/src/database/attributes/EntityCategoryAttributes.ts +11 -11
  33. package/src/database/attributes/EntityFieldAttributes.ts +12 -12
  34. package/src/database/attributes/EntityTagAttributes.ts +12 -12
  35. package/src/database/model/EntityCategoryModel.ts +8 -8
  36. package/src/database/model/EntityFieldModel.ts +9 -9
  37. package/src/database/model/EntityTagModel.ts +9 -9
  38. package/src/database/table/EntityCategoryTable.ts +86 -86
  39. package/src/database/table/EntityFieldTable.ts +122 -122
  40. package/src/database/table/EntityTagTable.ts +113 -113
  41. package/src/enum/EntityCategoryNames.ts +3 -3
  42. package/src/enum/EntityFieldNames.ts +3 -3
  43. package/src/enum/EntityTagNames.ts +3 -3
  44. package/src/index.ts +5 -5
@@ -59,10 +59,10 @@ class List extends BaseEntityFieldController_1.BaseEntityFieldController {
59
59
  return __awaiter(this, void 0, void 0, function* () {
60
60
  let tables = { entity_category: {} };
61
61
  let q = namirasoft_account_node_1.NSAControllerList.handle_GetQueries(this, this.props.access.owner_id);
62
- let conditions = this.database.getFiltersConditions(tables, q.filters);
62
+ let res = this.database.getFiltersConditions(tables, q.filters);
63
63
  return yield this.tables.entity_category.list({
64
64
  user_id: q.user_id,
65
- [sequelize_1.Op.and]: conditions["entity_category"]
65
+ [sequelize_1.Op.and]: res["entity_category"].conditions
66
66
  }, q.page, q.size, q.sorts, {}, null);
67
67
  });
68
68
  }
@@ -1 +1 @@
1
- {"version":3,"file":"List.js","sourceRoot":"","sources":["../../../src/controller/entity_category/List.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yCAA+B;AAC/B,qDAA6C;AAC7C,4EAAyE;AAEzE,qEAAwF;AAExF,MAAa,IAAK,SAAQ,qDAAyE;IAEzF,OAAO;QAEf,OAAO;YACN,IAAI,EAAE,MAAM;YACZ,GAAG,EAAE,IAAI,CAAC,SAAS,GAAG,UAAU;YAChC,MAAM,EAAE,4BAAU,CAAC,GAAG;YACtB,IAAI,EAAE,IAAI,CAAC,UAAU,GAAG,gBAAgB;YACxC,OAAO,EAAE,eAAe,IAAI,CAAC,UAAU,gBAAgB;SACvD,CAAC;IACH,CAAC;IACc,mBAAmB;;YAEjC,OAAO,EAAE,CAAC;QACX,CAAC;KAAA;IACc,gBAAgB;;YAE9B,OAAO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AE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC;QACvC,CAAC;KAAA;CACD;AApDD,oBAoDC"}
@@ -60,10 +60,10 @@ class List extends BaseEntityFieldController_1.BaseEntityFieldController {
60
60
  this.database;
61
61
  let tables = { entity_field: {} };
62
62
  let q = namirasoft_account_node_1.NSAControllerList.handle_GetQueries(this, this.props.access.owner_id);
63
- let conditions = this.database.getFiltersConditions(tables, q.filters);
63
+ let res = this.database.getFiltersConditions(tables, q.filters);
64
64
  return yield this.tables.entity_field.list({
65
65
  user_id: q.user_id,
66
- [sequelize_1.Op.and]: conditions["entity_field"]
66
+ [sequelize_1.Op.and]: res["entity_field"].conditions
67
67
  }, q.page, q.size, q.sorts, {}, null);
68
68
  });
69
69
  }
@@ -1 +1 @@
1
- {"version":3,"file":"List.js","sourceRoot":"","sources":["../../../src/controller/entity_field/List.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yCAA+B;AAC/B,qDAA6C;AAC7C,4EAAyE;AAEzE,qEAAwF;AAExF,MAAa,IAAK,SAAQ,qDAAsE;IAEtF,OAAO;QAEf,OAAO;YACN,IAAI,EAAE,MAAM;YACZ,GAAG,EAAE,IAAI,CAAC,SAAS,GAAG,OAAO;YAC7B,MAAM,EAAE,4BAAU,CAAC,GAAG;YACtB,IAAI,EAAE,IAAI,CAAC,UAAU,GAAG,aAAa;YACrC,OAAO,EAAE,eAAe,IAAI,CAAC,UAAU,aAAa;SACpD,CAAC;IACH,CAAC;IACc,mBAAmB;;YAEjC,OAAO,EAAE,CAAC;QACX,CAAC;KAAA;IACc,gBAAgB;;YAE9B,OAAO,2CAAiB,CAAC,gBAAgB,EAAE,CAAC;QAC7C,CAAC;KAAA;IACc,aAAa;;YAE3B,OAAO,IAAI,CAAC;QACb,CAAC;KAAA;IACc,eAAe;;YAE7B,OAAO,2CAAiB,CAAC,eAAe,CAAC,IAAI,CA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;KAAA;CACD;AArDD,oBAqDC"}
@@ -59,10 +59,10 @@ class List extends BaseEntityFieldController_1.BaseEntityFieldController {
59
59
  return __awaiter(this, void 0, void 0, function* () {
60
60
  let tables = { entity_tag: {} };
61
61
  let q = namirasoft_account_node_1.NSAControllerList.handle_GetQueries(this, this.props.access.owner_id);
62
- let conditions = this.database.getFiltersConditions(tables, q.filters);
62
+ let res = this.database.getFiltersConditions(tables, q.filters);
63
63
  return yield this.tables.entity_tag.list({
64
64
  user_id: q.user_id,
65
- [sequelize_1.Op.and]: conditions["entity_tag"]
65
+ [sequelize_1.Op.and]: res["entity_tag"].conditions
66
66
  }, q.page, q.size, q.sorts, {}, null);
67
67
  });
68
68
  }
@@ -1 +1 @@
1
- {"version":3,"file":"List.js","sourceRoot":"","sources":["../../../src/controller/entity_tag/List.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yCAA+B;AAC/B,qDAA6C;AAC7C,4EAAyE;AAEzE,qEAAwF;AAExF,MAAa,IAAK,SAAQ,qDAAoE;IAEpF,OAAO;QAEf,OAAO;YACN,IAAI,EAAE,MAAM;YACZ,GAAG,EAAE,IAAI,CAAC,SAAS,GAAG,KAAK;YAC3B,MAAM,EAAE,4BAAU,CAAC,GAAG;YACtB,IAAI,EAAE,IAAI,CAAC,UAAU,GAAG,WAAW;YACnC,OAAO,EAAE,eAAe,IAAI,CAAC,UAAU,WAAW;SAClD,CAAC;IACH,CAAC;IACc,mBAAmB;;YAEjC,OAAO,EAAE,CAAC;QACX,CAAC;KAAA;IACc,gBAAgB;;YAE9B,OAAO,2CAAiB,CAAC,gBAAgB,EAAE,CAAC;QAC7C,CAAC;KAAA;IACc,aAAa;;YAE3B,OAAO,IAAI,CAAC;QACb,CAAC;KAAA;IACc,eAAe;;YAE7B,OAAO,2CAAiB,CAAC,eAAe,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC,CAAC;QAC7F,CAAC;KAAA;IACc,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C,OAAO,EAAE,CAAC;QACX,CAAC;KAAA;IACc,gBAAgB;;YAE9B,OAAO,2CAAiB,CAAC,gBAAgB,EAAE,CAAC;QAC7C,CAAC;KAAA;IACc,aAAa;;YAE3B,OAAO,IAAI,CAAC;QACb,CAAC;KAAA;IACc,eAAe;;YAE7B,OAAO,2CAAiB,CAAC,eAAe,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC,CAAC;QAC7F,CAAC;KAAA;IACc,QAAQ;;YAEtB,OAAO;gBACN,UAAU,EAAE,IAAI;gBAChB,aAAa,EAAE,KAAK;aACpB,CAAC;QACH,CAAC;KAAA;IACQ,KAAK;QAEb,OAAO,IAAI,CAAC;IACb,CAAC;IACc,MAAM;;YAEpB,IAAI,MAAM,GAAG,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC;YAEhC,IAAI,CAAC,GAA+B,2CAAiB,CAAC,iBAAiB,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;YAE1G,IAAI,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,oBAAoB,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC;YAEhE,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC;gBACxC,OAAO,EAAE,CAAC,CAAC,OAAO;gBAClB,CAAC,cAAE,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,YAAY,CAAC,CAAC,UAAU;aACtC,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC;QACvC,CAAC;KAAA;CACD;AApDD,oBAoDC"}
package/package.json CHANGED
@@ -1,31 +1,31 @@
1
- {
2
- "name": "namirasoft-field-node",
3
- "title": "Namirasoft Field Node NPM Package",
4
- "description": "Namira Software Corporation Field Node NPM Package",
5
- "icon": "logo.png",
6
- "logo": "https://static.namirasoft.com/image/namirasoft/field/logo/base.png",
7
- "language": "ts",
8
- "framework": "npm",
9
- "application": "package",
10
- "private": false,
11
- "version": "1.4.39",
12
- "author": "Amir Abolhasani",
13
- "license": "MIT",
14
- "main": "./dist/index.js",
15
- "types": "./dist/index.d.ts",
16
- "scripts": {
17
- "build": ""
18
- },
19
- "dependencies": {
20
- "namirasoft-access": "^1.4.37",
21
- "namirasoft-account-node": "^1.4.78",
22
- "namirasoft-core": "^1.4.42",
23
- "namirasoft-field": "^1.4.11",
24
- "namirasoft-node": "^1.4.42",
25
- "namirasoft-node-mysql": "^1.4.22",
26
- "namirasoft-schema": "^1.4.22"
27
- },
28
- "bin": {
29
- "ns-field": "./dist/command/cli.js"
30
- }
1
+ {
2
+ "name": "namirasoft-field-node",
3
+ "title": "Namirasoft Field Node NPM Package",
4
+ "description": "Namira Software Corporation Field Node NPM Package",
5
+ "icon": "logo.png",
6
+ "logo": "https://static.namirasoft.com/image/namirasoft/field/logo/base.png",
7
+ "language": "ts",
8
+ "framework": "npm",
9
+ "application": "package",
10
+ "private": false,
11
+ "version": "1.4.40",
12
+ "author": "Amir Abolhasani",
13
+ "license": "MIT",
14
+ "main": "./dist/index.js",
15
+ "types": "./dist/index.d.ts",
16
+ "scripts": {
17
+ "build": ""
18
+ },
19
+ "dependencies": {
20
+ "namirasoft-access": "^1.4.37",
21
+ "namirasoft-account-node": "^1.4.79",
22
+ "namirasoft-core": "^1.4.42",
23
+ "namirasoft-field": "^1.4.11",
24
+ "namirasoft-node": "^1.4.46",
25
+ "namirasoft-node-mysql": "^1.4.25",
26
+ "namirasoft-schema": "^1.4.22"
27
+ },
28
+ "bin": {
29
+ "ns-field": "./dist/command/cli.js"
30
+ }
31
31
  }
package/src/CTFModel.ts CHANGED
@@ -1,10 +1,10 @@
1
- import { EntityCategoryModel } from "./database/model/EntityCategoryModel";
2
- import { EntityFieldModel } from "./database/model/EntityFieldModel";
3
- import { EntityTagModel } from "./database/model/EntityTagModel";
4
-
5
- export interface CTFModel
6
- {
7
- categories: EntityCategoryModel[];
8
- fields: EntityFieldModel[];
9
- tags: EntityTagModel[];
1
+ import { EntityCategoryModel } from "./database/model/EntityCategoryModel";
2
+ import { EntityFieldModel } from "./database/model/EntityFieldModel";
3
+ import { EntityTagModel } from "./database/model/EntityTagModel";
4
+
5
+ export interface CTFModel
6
+ {
7
+ categories: EntityCategoryModel[];
8
+ fields: EntityFieldModel[];
9
+ tags: EntityTagModel[];
10
10
  }
package/src/CTFRow.ts CHANGED
@@ -1,8 +1,8 @@
1
- import { EntityCategoryInputRow, EntityFieldInputRow, EntityTagInputRow } from "namirasoft-access";
2
-
3
- export interface CTFRow
4
- {
5
- categories: EntityCategoryInputRow[];
6
- fields: EntityFieldInputRow[];
7
- tags: EntityTagInputRow[];
1
+ import { EntityCategoryInputRow, EntityFieldInputRow, EntityTagInputRow } from "namirasoft-access";
2
+
3
+ export interface CTFRow
4
+ {
5
+ categories: EntityCategoryInputRow[];
6
+ fields: EntityFieldInputRow[];
7
+ tags: EntityTagInputRow[];
8
8
  }
@@ -1,43 +1,43 @@
1
- import express from 'express';
2
- import { NSABaseApplication } from 'namirasoft-account-node';
3
- import { BaseMySqlDatabase } from 'namirasoft-node-mysql';
4
- import { NSFTables } from './database/NSFTables';
5
- import { Create as EntityCategoryCreate } from './controller/entity_category/Create';
6
- import { Delete as EntityCategoryDelete } from './controller/entity_category/Delete';
7
- import { Get as EntityCategoryGet } from './controller/entity_category/Get';
8
- import { List as EntityCategoryList } from './controller/entity_category/List';
9
- import { Create as EntityFieldCreate } from './controller/entity_field/Create';
10
- import { Delete as EntityFieldDelete } from './controller/entity_field/Delete';
11
- import { Get as EntityFieldGet } from './controller/entity_field/Get';
12
- import { List as EntityFieldList } from './controller/entity_field/List';
13
- import { Update as EntityFieldUpdate } from './controller/entity_field/Update';
14
- import { Create as EntityTagCreate } from './controller/entity_tag/Create';
15
- import { Delete as EntityTagDelete } from './controller/entity_tag/Delete';
16
- import { Get as EntityTagGet } from './controller/entity_tag/Get';
17
- import { List as EntityTagList } from './controller/entity_tag/List';
18
- import { Update as EntityTagUpdate } from './controller/entity_tag/Update';
19
-
20
- export class NSFApplication
21
- {
22
- static getControllers(tables: NSFTables<BaseMySqlDatabase>): ((app: NSABaseApplication<BaseMySqlDatabase>, req: express.Request, res: express.Response) => any)[]
23
- {
24
- return [
25
- (app, req, res) => new EntityCategoryList(app, req, res, tables),
26
- (app, req, res) => new EntityCategoryGet(app, req, res, tables),
27
- (app, req, res) => new EntityCategoryCreate(app, req, res, tables),
28
- (app, req, res) => new EntityCategoryDelete(app, req, res, tables),
29
-
30
- (app, req, res) => new EntityFieldList(app, req, res, tables),
31
- (app, req, res) => new EntityFieldGet(app, req, res, tables),
32
- (app, req, res) => new EntityFieldCreate(app, req, res, tables),
33
- (app, req, res) => new EntityFieldUpdate(app, req, res, tables),
34
- (app, req, res) => new EntityFieldDelete(app, req, res, tables),
35
-
36
- (app, req, res) => new EntityTagList(app, req, res, tables),
37
- (app, req, res) => new EntityTagGet(app, req, res, tables),
38
- (app, req, res) => new EntityTagCreate(app, req, res, tables),
39
- (app, req, res) => new EntityTagUpdate(app, req, res, tables),
40
- (app, req, res) => new EntityTagDelete(app, req, res, tables),
41
- ];
42
- }
1
+ import express from 'express';
2
+ import { NSABaseApplication } from 'namirasoft-account-node';
3
+ import { BaseMySqlDatabase } from 'namirasoft-node-mysql';
4
+ import { NSFTables } from './database/NSFTables';
5
+ import { Create as EntityCategoryCreate } from './controller/entity_category/Create';
6
+ import { Delete as EntityCategoryDelete } from './controller/entity_category/Delete';
7
+ import { Get as EntityCategoryGet } from './controller/entity_category/Get';
8
+ import { List as EntityCategoryList } from './controller/entity_category/List';
9
+ import { Create as EntityFieldCreate } from './controller/entity_field/Create';
10
+ import { Delete as EntityFieldDelete } from './controller/entity_field/Delete';
11
+ import { Get as EntityFieldGet } from './controller/entity_field/Get';
12
+ import { List as EntityFieldList } from './controller/entity_field/List';
13
+ import { Update as EntityFieldUpdate } from './controller/entity_field/Update';
14
+ import { Create as EntityTagCreate } from './controller/entity_tag/Create';
15
+ import { Delete as EntityTagDelete } from './controller/entity_tag/Delete';
16
+ import { Get as EntityTagGet } from './controller/entity_tag/Get';
17
+ import { List as EntityTagList } from './controller/entity_tag/List';
18
+ import { Update as EntityTagUpdate } from './controller/entity_tag/Update';
19
+
20
+ export class NSFApplication
21
+ {
22
+ static getControllers(tables: NSFTables<BaseMySqlDatabase>): ((app: NSABaseApplication<BaseMySqlDatabase>, req: express.Request, res: express.Response) => any)[]
23
+ {
24
+ return [
25
+ (app, req, res) => new EntityCategoryList(app, req, res, tables),
26
+ (app, req, res) => new EntityCategoryGet(app, req, res, tables),
27
+ (app, req, res) => new EntityCategoryCreate(app, req, res, tables),
28
+ (app, req, res) => new EntityCategoryDelete(app, req, res, tables),
29
+
30
+ (app, req, res) => new EntityFieldList(app, req, res, tables),
31
+ (app, req, res) => new EntityFieldGet(app, req, res, tables),
32
+ (app, req, res) => new EntityFieldCreate(app, req, res, tables),
33
+ (app, req, res) => new EntityFieldUpdate(app, req, res, tables),
34
+ (app, req, res) => new EntityFieldDelete(app, req, res, tables),
35
+
36
+ (app, req, res) => new EntityTagList(app, req, res, tables),
37
+ (app, req, res) => new EntityTagGet(app, req, res, tables),
38
+ (app, req, res) => new EntityTagCreate(app, req, res, tables),
39
+ (app, req, res) => new EntityTagUpdate(app, req, res, tables),
40
+ (app, req, res) => new EntityTagDelete(app, req, res, tables),
41
+ ];
42
+ }
43
43
  }
@@ -1,5 +1,5 @@
1
- export class NamirasoftFieldUUIDShort
2
- {
3
- static category: string = "fld-ctg";
4
- static field: string = "fld";
1
+ export class NamirasoftFieldUUIDShort
2
+ {
3
+ static category: string = "fld-ctg";
4
+ static field: string = "fld";
5
5
  }
@@ -1,23 +1,23 @@
1
- import { NSABaseApplication, NSABaseController } from "namirasoft-account-node";
2
- import { BaseEntityFieldControllerState } from "./BaseEntityFieldControllerState";
3
- import { BaseEntityFieldControllerProps } from "./BaseEntityFieldControllerProps";
4
- import { BaseMySqlDatabase } from "namirasoft-node-mysql";
5
- import express from "express";
6
- import { NSFTables } from "../database/NSFTables";
7
- import { NamingConvention } from "namirasoft-core";
8
-
9
- export abstract class BaseEntityFieldController<Output> extends NSABaseController<BaseMySqlDatabase, BaseEntityFieldControllerState, BaseEntityFieldControllerProps, Output>
10
- {
11
- protected tables: NSFTables<BaseMySqlDatabase>;
12
- protected tagPrefix: string;
13
- protected pathPrefix: string;
14
- protected namePrefix: string;
15
- constructor(app: NSABaseApplication<BaseMySqlDatabase>, req: express.Request, res: express.Response, tables: NSFTables<BaseMySqlDatabase>)
16
- {
17
- super(app, req, res)
18
- this.tables = tables;
19
- this.tagPrefix = NamingConvention.lower_case_underscore.convert(this.tables.name, NamingConvention.Pascal_Case);
20
- this.pathPrefix = this.tables.name.replace(/_/gm, "/");
21
- this.namePrefix = this.tables.name.replace(/_/gm, " ");
22
- }
1
+ import { NSABaseApplication, NSABaseController } from "namirasoft-account-node";
2
+ import { BaseEntityFieldControllerState } from "./BaseEntityFieldControllerState";
3
+ import { BaseEntityFieldControllerProps } from "./BaseEntityFieldControllerProps";
4
+ import { BaseMySqlDatabase } from "namirasoft-node-mysql";
5
+ import express from "express";
6
+ import { NSFTables } from "../database/NSFTables";
7
+ import { NamingConvention } from "namirasoft-core";
8
+
9
+ export abstract class BaseEntityFieldController<Output> extends NSABaseController<BaseMySqlDatabase, BaseEntityFieldControllerState, BaseEntityFieldControllerProps, Output>
10
+ {
11
+ protected tables: NSFTables<BaseMySqlDatabase>;
12
+ protected tagPrefix: string;
13
+ protected pathPrefix: string;
14
+ protected namePrefix: string;
15
+ constructor(app: NSABaseApplication<BaseMySqlDatabase>, req: express.Request, res: express.Response, tables: NSFTables<BaseMySqlDatabase>)
16
+ {
17
+ super(app, req, res)
18
+ this.tables = tables;
19
+ this.tagPrefix = NamingConvention.lower_case_underscore.convert(this.tables.name, NamingConvention.Pascal_Case);
20
+ this.pathPrefix = this.tables.name.replace(/_/gm, "/");
21
+ this.namePrefix = this.tables.name.replace(/_/gm, " ");
22
+ }
23
23
  }
@@ -1,5 +1,5 @@
1
- import { NSABaseControllerProps } from "namirasoft-account-node";
2
-
3
- export interface BaseEntityFieldControllerProps extends NSABaseControllerProps
4
- {
1
+ import { NSABaseControllerProps } from "namirasoft-account-node";
2
+
3
+ export interface BaseEntityFieldControllerProps extends NSABaseControllerProps
4
+ {
5
5
  }
@@ -1,5 +1,5 @@
1
- import { NSABaseControllerState } from "namirasoft-account-node";
2
-
3
- export interface BaseEntityFieldControllerState extends NSABaseControllerState
4
- {
1
+ import { NSABaseControllerState } from "namirasoft-account-node";
2
+
3
+ export interface BaseEntityFieldControllerState extends NSABaseControllerState
4
+ {
5
5
  }
@@ -1,15 +1,15 @@
1
- import { EntityCategoryInputRow, EntityFieldInputRow, EntityTagInputRow } from "namirasoft-access";
2
- import { CTFRow } from "../CTFRow";
3
- import { NamingConvention } from "namirasoft-core";
4
-
5
- export class NSFController
6
- {
7
- static handle_getCategoryFieldTag(name: string, body: any): CTFRow
8
- {
9
- name = NamingConvention.auto.convert(name, NamingConvention.lower_case_underscore);
10
- let categories: EntityCategoryInputRow[] = body[`${name}_category`] ?? [];
11
- let fields: EntityFieldInputRow[] = body[`${name}_field`] ?? [];
12
- let tags: EntityTagInputRow[] = body[`${name}_tag`] ?? [];
13
- return { categories, fields, tags };
14
- }
1
+ import { EntityCategoryInputRow, EntityFieldInputRow, EntityTagInputRow } from "namirasoft-access";
2
+ import { CTFRow } from "../CTFRow";
3
+ import { NamingConvention } from "namirasoft-core";
4
+
5
+ export class NSFController
6
+ {
7
+ static handle_getCategoryFieldTag(name: string, body: any): CTFRow
8
+ {
9
+ name = NamingConvention.auto.convert(name, NamingConvention.lower_case_underscore);
10
+ let categories: EntityCategoryInputRow[] = body[`${name}_category`] ?? [];
11
+ let fields: EntityFieldInputRow[] = body[`${name}_field`] ?? [];
12
+ let tags: EntityTagInputRow[] = body[`${name}_tag`] ?? [];
13
+ return { categories, fields, tags };
14
+ }
15
15
  }
@@ -1,88 +1,88 @@
1
- import { Op } from "sequelize";
2
- import { Includeable, WhereOptions } from "sequelize";
3
- import { NSFTables } from "../database/NSFTables";
4
- import { BaseMySqlDatabase } from "namirasoft-node-mysql";
5
- import { BaseDatabase_FilterTable } from "namirasoft-node";
6
- import { NamirasoftFieldUUIDShort } from "../NamirasoftFieldUUIDShort";
7
- import { BaseUUID } from "namirasoft-core";
8
-
9
- export class NSFListController
10
- {
11
- static handle_getTables(name: string, tables: { [table: string]: BaseDatabase_FilterTable; }): { [table: string]: BaseDatabase_FilterTable; }
12
- {
13
- let ans = { ...tables };
14
- ans[name] = {};
15
- ans[`${name}_category`] = {
16
- join_conditions: {
17
- main: {
18
- table: name,
19
- column: "id",
20
- },
21
- secondary: {
22
- table: `${name}_category`,
23
- column: "entity_id",
24
- }
25
- }
26
- };
27
- ans[`${name}_field`] = {
28
- join_conditions: {
29
- main: {
30
- table: name,
31
- column: "id",
32
- },
33
- secondary: {
34
- table: `${name}_field`,
35
- column: "entity_id",
36
- },
37
- getExtraConditions: (column: string) =>
38
- {
39
- if (BaseUUID.isValidShort(column, NamirasoftFieldUUIDShort.field))
40
- return [`field_id = '${column}'`];
41
- return [];
42
- }
43
- },
44
- overrideColumnName: (column) =>
45
- {
46
- if (BaseUUID.isValidShort(column, NamirasoftFieldUUIDShort.field))
47
- return "value";
48
- return column;
49
- }
50
- };
51
- ans[`${name}_tag`] = {
52
- join_conditions: {
53
- main: {
54
- table: name,
55
- column: "id",
56
- },
57
- secondary: {
58
- table: `${name}_tag`,
59
- column: "entity_id",
60
- }
61
- }
62
- };
63
- return ans;
64
- }
65
- static handle_getIncludes<D extends BaseMySqlDatabase>(name: string, includes: Includeable[], conditions: { [table: string]: WhereOptions[]; }, tables: NSFTables<D>): Includeable[]
66
- {
67
- let ans = [...includes];
68
- if (conditions[`${name}_category`].length > 0)
69
- ans.push({
70
- model: tables.entity_category.model,
71
- attributes: [],
72
- where: { [Op.and]: conditions[`${name}_category`] }
73
- });
74
- if (conditions[`${name}_field`].length > 0)
75
- ans.push({
76
- model: tables.entity_field.model,
77
- attributes: [],
78
- where: { [Op.and]: conditions[`${name}_field`] }
79
- });
80
- if (conditions[`${name}_tag`].length > 0)
81
- ans.push({
82
- model: tables.entity_tag.model,
83
- attributes: [],
84
- where: { [Op.and]: conditions[`${name}_tag`] }
85
- });
86
- return ans;
87
- }
1
+ import { Op } from "sequelize";
2
+ import { Includeable, WhereOptions } from "sequelize";
3
+ import { NSFTables } from "../database/NSFTables";
4
+ import { BaseMySqlDatabase } from "namirasoft-node-mysql";
5
+ import { BaseDatabase_FilterTable } from "namirasoft-node";
6
+ import { NamirasoftFieldUUIDShort } from "../NamirasoftFieldUUIDShort";
7
+ import { BaseUUID } from "namirasoft-core";
8
+
9
+ export class NSFListController
10
+ {
11
+ static handle_getTables(name: string, tables: { [table: string]: BaseDatabase_FilterTable; }): { [table: string]: BaseDatabase_FilterTable; }
12
+ {
13
+ let ans = { ...tables };
14
+ ans[name] = {};
15
+ ans[`${name}_category`] = {
16
+ join_conditions: {
17
+ main: {
18
+ table: name,
19
+ column: "id",
20
+ },
21
+ secondary: {
22
+ table: `${name}_category`,
23
+ column: "entity_id",
24
+ }
25
+ }
26
+ };
27
+ ans[`${name}_field`] = {
28
+ join_conditions: {
29
+ main: {
30
+ table: name,
31
+ column: "id",
32
+ },
33
+ secondary: {
34
+ table: `${name}_field`,
35
+ column: "entity_id",
36
+ },
37
+ getExtraConditions: (column: string) =>
38
+ {
39
+ if (BaseUUID.isValidShort(column, NamirasoftFieldUUIDShort.field))
40
+ return [`field_id = '${column}'`];
41
+ return [];
42
+ }
43
+ },
44
+ overrideColumnName: (column) =>
45
+ {
46
+ if (BaseUUID.isValidShort(column, NamirasoftFieldUUIDShort.field))
47
+ return "value";
48
+ return column;
49
+ }
50
+ };
51
+ ans[`${name}_tag`] = {
52
+ join_conditions: {
53
+ main: {
54
+ table: name,
55
+ column: "id",
56
+ },
57
+ secondary: {
58
+ table: `${name}_tag`,
59
+ column: "entity_id",
60
+ }
61
+ }
62
+ };
63
+ return ans;
64
+ }
65
+ static handle_getIncludes<D extends BaseMySqlDatabase>(name: string, includes: Includeable[], conditions: { [table: string]: WhereOptions[]; }, tables: NSFTables<D>): Includeable[]
66
+ {
67
+ let ans = [...includes];
68
+ if (conditions[`${name}_category`].length > 0)
69
+ ans.push({
70
+ model: tables.entity_category.model,
71
+ attributes: [],
72
+ where: { [Op.and]: conditions[`${name}_category`] }
73
+ });
74
+ if (conditions[`${name}_field`].length > 0)
75
+ ans.push({
76
+ model: tables.entity_field.model,
77
+ attributes: [],
78
+ where: { [Op.and]: conditions[`${name}_field`] }
79
+ });
80
+ if (conditions[`${name}_tag`].length > 0)
81
+ ans.push({
82
+ model: tables.entity_tag.model,
83
+ attributes: [],
84
+ where: { [Op.and]: conditions[`${name}_tag`] }
85
+ });
86
+ return ans;
87
+ }
88
88
  }