namirasoft-field-node 1.3.21 → 1.4.0

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 (71) hide show
  1. package/dist/NSFApplication.d.ts +0 -1
  2. package/dist/controller/BaseEntityFieldController.d.ts +0 -1
  3. package/dist/controller/entity_category/Create.d.ts +1 -1
  4. package/dist/controller/entity_category/Create.js.map +1 -1
  5. package/dist/controller/entity_category/Delete.d.ts +1 -1
  6. package/dist/controller/entity_category/Delete.js.map +1 -1
  7. package/dist/controller/entity_category/Get.d.ts +1 -1
  8. package/dist/controller/entity_category/Get.js.map +1 -1
  9. package/dist/controller/entity_category/List.d.ts +1 -1
  10. package/dist/controller/entity_category/List.js +7 -7
  11. package/dist/controller/entity_category/List.js.map +1 -1
  12. package/dist/controller/entity_category/Update.d.ts +22 -0
  13. package/dist/controller/entity_category/Update.js +68 -0
  14. package/dist/controller/entity_category/Update.js.map +1 -0
  15. package/dist/controller/entity_field/Create.d.ts +1 -1
  16. package/dist/controller/entity_field/Create.js.map +1 -1
  17. package/dist/controller/entity_field/Delete.d.ts +1 -1
  18. package/dist/controller/entity_field/Delete.js.map +1 -1
  19. package/dist/controller/entity_field/Get.d.ts +1 -1
  20. package/dist/controller/entity_field/Get.js.map +1 -1
  21. package/dist/controller/entity_field/List.d.ts +1 -1
  22. package/dist/controller/entity_field/List.js +7 -7
  23. package/dist/controller/entity_field/List.js.map +1 -1
  24. package/dist/controller/entity_field/Update.d.ts +1 -1
  25. package/dist/controller/entity_field/Update.js.map +1 -1
  26. package/dist/controller/entity_tag/Create.d.ts +1 -1
  27. package/dist/controller/entity_tag/Create.js.map +1 -1
  28. package/dist/controller/entity_tag/Delete.d.ts +1 -1
  29. package/dist/controller/entity_tag/Delete.js.map +1 -1
  30. package/dist/controller/entity_tag/Get.d.ts +1 -1
  31. package/dist/controller/entity_tag/Get.js.map +1 -1
  32. package/dist/controller/entity_tag/List.d.ts +1 -1
  33. package/dist/controller/entity_tag/List.js +7 -7
  34. package/dist/controller/entity_tag/List.js.map +1 -1
  35. package/dist/controller/entity_tag/Update.d.ts +1 -1
  36. package/dist/controller/entity_tag/Update.js.map +1 -1
  37. package/logo.png +0 -0
  38. package/package.json +28 -28
  39. package/src/NSFApplication.ts +42 -42
  40. package/src/controller/BaseEntityFieldController.ts +22 -22
  41. package/src/controller/BaseEntityFieldControllerProps.ts +4 -4
  42. package/src/controller/BaseEntityFieldControllerState.ts +4 -4
  43. package/src/controller/NSFListController.ts +39 -39
  44. package/src/controller/entity_category/Create.ts +52 -52
  45. package/src/controller/entity_category/Delete.ts +49 -49
  46. package/src/controller/entity_category/Get.ts +51 -51
  47. package/src/controller/entity_category/List.ts +58 -58
  48. package/src/controller/entity_field/Create.ts +53 -53
  49. package/src/controller/entity_field/Delete.ts +49 -49
  50. package/src/controller/entity_field/Get.ts +51 -51
  51. package/src/controller/entity_field/List.ts +58 -58
  52. package/src/controller/entity_field/Update.ts +55 -55
  53. package/src/controller/entity_tag/Create.ts +53 -53
  54. package/src/controller/entity_tag/Delete.ts +49 -49
  55. package/src/controller/entity_tag/Get.ts +51 -51
  56. package/src/controller/entity_tag/List.ts +58 -58
  57. package/src/controller/entity_tag/Update.ts +55 -55
  58. package/src/database/FieldDatabaseTables.ts +45 -45
  59. package/src/database/attributes/EntityCategoryAttributes.ts +11 -11
  60. package/src/database/attributes/EntityFieldAttributes.ts +13 -13
  61. package/src/database/attributes/EntityTagAttributes.ts +13 -13
  62. package/src/database/model/EntityCategoryModel.ts +8 -8
  63. package/src/database/model/EntityFieldModel.ts +10 -10
  64. package/src/database/model/EntityTagModel.ts +10 -10
  65. package/src/database/table/EntityCategoryTable.ts +60 -60
  66. package/src/database/table/EntityFieldTable.ts +65 -65
  67. package/src/database/table/EntityTagTable.ts +65 -65
  68. package/src/enum/EntityCategoryNames.ts +3 -3
  69. package/src/enum/EntityFieldNames.ts +3 -3
  70. package/src/enum/EntityTagNames.ts +3 -3
  71. package/src/index.ts +2 -2
@@ -1,14 +1,14 @@
1
- import { DataTypes, Attributes, ModelAttributes } from "sequelize";
2
- import { EntityFieldModel } from "../model/EntityFieldModel";
3
-
4
- export let EntityFieldAttributes: ModelAttributes<
5
- EntityFieldModel,
6
- Attributes<EntityFieldModel>
7
- > = {
8
- id: { type: DataTypes.INTEGER, allowNull: false, primaryKey: true, autoIncrement: true },
9
- user_id: { type: DataTypes.CHAR(20), allowNull: false },
10
- entity_id: { type: DataTypes.CHAR(20), allowNull: false },
11
- field_id: { type: DataTypes.CHAR(20), allowNull: false },
12
- value: { type: DataTypes.TEXT, allowNull: false },
13
- description: { type: DataTypes.TEXT, allowNull: true },
1
+ import { DataTypes, Attributes, ModelAttributes } from "sequelize";
2
+ import { EntityFieldModel } from "../model/EntityFieldModel";
3
+
4
+ export let EntityFieldAttributes: ModelAttributes<
5
+ EntityFieldModel,
6
+ Attributes<EntityFieldModel>
7
+ > = {
8
+ id: { type: DataTypes.INTEGER, allowNull: false, primaryKey: true, autoIncrement: true },
9
+ user_id: { type: DataTypes.CHAR(20), allowNull: false },
10
+ entity_id: { type: DataTypes.CHAR(20), allowNull: false },
11
+ field_id: { type: DataTypes.CHAR(20), allowNull: false },
12
+ value: { type: DataTypes.TEXT, allowNull: false },
13
+ description: { type: DataTypes.TEXT, allowNull: true },
14
14
  };
@@ -1,14 +1,14 @@
1
- import { DataTypes, Attributes, ModelAttributes } from "sequelize";
2
- import { EntityTagModel } from "../model/EntityTagModel";
3
-
4
- export let EntityTagAttributes: ModelAttributes<
5
- EntityTagModel,
6
- Attributes<EntityTagModel>
7
- > = {
8
- id: { type: DataTypes.INTEGER, allowNull: false, primaryKey: true, autoIncrement: true },
9
- user_id: { type: DataTypes.CHAR(20), allowNull: false },
10
- entity_id: { type: DataTypes.CHAR(20), allowNull: false },
11
- name: { type: DataTypes.STRING, allowNull: false },
12
- value: { type: DataTypes.TEXT, allowNull: false },
13
- description: { type: DataTypes.TEXT, allowNull: true }
1
+ import { DataTypes, Attributes, ModelAttributes } from "sequelize";
2
+ import { EntityTagModel } from "../model/EntityTagModel";
3
+
4
+ export let EntityTagAttributes: ModelAttributes<
5
+ EntityTagModel,
6
+ Attributes<EntityTagModel>
7
+ > = {
8
+ id: { type: DataTypes.INTEGER, allowNull: false, primaryKey: true, autoIncrement: true },
9
+ user_id: { type: DataTypes.CHAR(20), allowNull: false },
10
+ entity_id: { type: DataTypes.CHAR(20), allowNull: false },
11
+ name: { type: DataTypes.STRING, allowNull: false },
12
+ value: { type: DataTypes.TEXT, allowNull: false },
13
+ description: { type: DataTypes.TEXT, allowNull: true }
14
14
  };
@@ -1,9 +1,9 @@
1
- import { BaseSequelizeModel } from "namirasoft-node-mysql";
2
-
3
- export class EntityCategoryModel extends BaseSequelizeModel
4
- {
5
- id!: number;
6
- user_id!: string;
7
- entity_id!: string;
8
- category_id!: string;
1
+ import { BaseSequelizeModel } from "namirasoft-node-mysql";
2
+
3
+ export class EntityCategoryModel extends BaseSequelizeModel
4
+ {
5
+ id!: number;
6
+ user_id!: string;
7
+ entity_id!: string;
8
+ category_id!: string;
9
9
  };
@@ -1,11 +1,11 @@
1
- import { BaseSequelizeModel } from "namirasoft-node-mysql";
2
-
3
- export class EntityFieldModel extends BaseSequelizeModel
4
- {
5
- id!: number;
6
- user_id!: string;
7
- entity_id!: string;
8
- field_id!: string;
9
- value!: string;
10
- description?: string;
1
+ import { BaseSequelizeModel } from "namirasoft-node-mysql";
2
+
3
+ export class EntityFieldModel extends BaseSequelizeModel
4
+ {
5
+ id!: number;
6
+ user_id!: string;
7
+ entity_id!: string;
8
+ field_id!: string;
9
+ value!: string;
10
+ description?: string;
11
11
  }
@@ -1,11 +1,11 @@
1
- import { BaseSequelizeModel } from "namirasoft-node-mysql";
2
-
3
- export class EntityTagModel extends BaseSequelizeModel
4
- {
5
- id!: number;
6
- user_id!: string;
7
- entity_id!: string;
8
- name!: string;
9
- value!: string;
10
- description?: string;
1
+ import { BaseSequelizeModel } from "namirasoft-node-mysql";
2
+
3
+ export class EntityTagModel extends BaseSequelizeModel
4
+ {
5
+ id!: number;
6
+ user_id!: string;
7
+ entity_id!: string;
8
+ name!: string;
9
+ value!: string;
10
+ description?: string;
11
11
  }
@@ -1,61 +1,61 @@
1
- import { BaseMySqlDatabase, BaseSequelizeTable } from "namirasoft-node-mysql";
2
- import { Transaction } from "sequelize";
3
- import { EntityCategoryModel } from "../model/EntityCategoryModel";
4
- import { ObjectSchema } from "namirasoft-schema";
5
- import { SessionRow } from "namirasoft-account";
6
- import { EntityCategoryNames } from "../../enum/EntityCategoryNames";
7
- import { NSABaseApplication } from "namirasoft-account-node";
8
- import { AccessRow } from "namirasoft-access";
9
-
10
- export class EntityCategoryTable<Database extends BaseMySqlDatabase> extends BaseSequelizeTable<Database, EntityCategoryModel>
11
- {
12
- public app: NSABaseApplication<Database>;
13
- constructor(app: NSABaseApplication<Database>, database: Database)
14
- {
15
- super(database);
16
- this.app = app;
17
- }
18
- override getSchemaNames(): string[]
19
- {
20
- return Object.keys(EntityCategoryNames);
21
- }
22
- protected override setSchemaByName(schema: ObjectSchema): void
23
- {
24
- schema.delReadOnly(true);
25
- }
26
- async get(user_id: string, id: string, trx: Transaction | null): Promise<EntityCategoryModel | null>
27
- {
28
- return await this._get({ where: { user_id, id }, }, trx);
29
- }
30
- async create(access: AccessRow, session: SessionRow, user_id: string, entity_id: string, category_id: string, trx: Transaction | null): Promise<EntityCategoryModel>
31
- {
32
- return this.app.on.create(this, access, session, async () =>
33
- {
34
- return await this.model.create({
35
- user_id,
36
- entity_id,
37
- category_id,
38
- }, { transaction: trx });
39
- });
40
- }
41
- async update(access: AccessRow, session: SessionRow, user_id: string, id: string, category_id: string, trx: Transaction | null): Promise<EntityCategoryModel>
42
- {
43
- return await this.app.on.update(this, access, session, async () =>
44
- {
45
- return await this._get({ where: { user_id, id } }, trx);
46
- }, async (item) =>
47
- {
48
- item.category_id = category_id;
49
- return await item.save({ transaction: trx });
50
- });
51
- }
52
- async delete(access: AccessRow, session: SessionRow, user_id: string, id: string, trx: Transaction | null): Promise<void>
53
- {
54
- await this.app.on.delete(this, access, session, async () =>
55
- {
56
- let item = await this._get({ where: { user_id, id } }, trx);
57
- await item.destroy({ transaction: trx });
58
- return item;
59
- });
60
- }
1
+ import { BaseMySqlDatabase, BaseSequelizeTable } from "namirasoft-node-mysql";
2
+ import { Transaction } from "sequelize";
3
+ import { EntityCategoryModel } from "../model/EntityCategoryModel";
4
+ import { ObjectSchema } from "namirasoft-schema";
5
+ import { SessionRow } from "namirasoft-account";
6
+ import { EntityCategoryNames } from "../../enum/EntityCategoryNames";
7
+ import { NSABaseApplication } from "namirasoft-account-node";
8
+ import { AccessRow } from "namirasoft-access";
9
+
10
+ export class EntityCategoryTable<Database extends BaseMySqlDatabase> extends BaseSequelizeTable<Database, EntityCategoryModel>
11
+ {
12
+ public app: NSABaseApplication<Database>;
13
+ constructor(app: NSABaseApplication<Database>, database: Database)
14
+ {
15
+ super(database);
16
+ this.app = app;
17
+ }
18
+ override getSchemaNames(): string[]
19
+ {
20
+ return Object.keys(EntityCategoryNames);
21
+ }
22
+ protected override setSchemaByName(schema: ObjectSchema): void
23
+ {
24
+ schema.delReadOnly(true);
25
+ }
26
+ async get(user_id: string, id: string, trx: Transaction | null): Promise<EntityCategoryModel | null>
27
+ {
28
+ return await this._get({ where: { user_id, id }, }, trx);
29
+ }
30
+ async create(access: AccessRow, session: SessionRow, user_id: string, entity_id: string, category_id: string, trx: Transaction | null): Promise<EntityCategoryModel>
31
+ {
32
+ return this.app.on.create(this, access, session, async () =>
33
+ {
34
+ return await this.model.create({
35
+ user_id,
36
+ entity_id,
37
+ category_id,
38
+ }, { transaction: trx });
39
+ });
40
+ }
41
+ async update(access: AccessRow, session: SessionRow, user_id: string, id: string, category_id: string, trx: Transaction | null): Promise<EntityCategoryModel>
42
+ {
43
+ return await this.app.on.update(this, access, session, async () =>
44
+ {
45
+ return await this._get({ where: { user_id, id } }, trx);
46
+ }, async (item) =>
47
+ {
48
+ item.category_id = category_id;
49
+ return await item.save({ transaction: trx });
50
+ });
51
+ }
52
+ async delete(access: AccessRow, session: SessionRow, user_id: string, id: string, trx: Transaction | null): Promise<void>
53
+ {
54
+ await this.app.on.delete(this, access, session, async () =>
55
+ {
56
+ let item = await this._get({ where: { user_id, id } }, trx);
57
+ await item.destroy({ transaction: trx });
58
+ return item;
59
+ });
60
+ }
61
61
  }
@@ -1,66 +1,66 @@
1
- import { BaseMySqlDatabase, BaseSequelizeTable } from "namirasoft-node-mysql";
2
- import { Transaction } from "sequelize";
3
- import { EntityFieldModel } from "../model/EntityFieldModel";
4
- import { ObjectSchema } from "namirasoft-schema";
5
- import { SessionRow } from "namirasoft-account";
6
- import { EntityFieldNames } from "../../enum/EntityFieldNames";
7
- import { NSABaseApplication } from "namirasoft-account-node";
8
- import { AccessRow } from "namirasoft-access";
9
-
10
- export class EntityFieldTable<Database extends BaseMySqlDatabase> extends BaseSequelizeTable<Database, EntityFieldModel>
11
- {
12
- public app: NSABaseApplication<Database>;
13
- constructor(app: NSABaseApplication<Database>, database: Database)
14
- {
15
- super(database);
16
- this.app = app;
17
- }
18
- override getSchemaNames(): string[]
19
- {
20
- return Object.keys(EntityFieldNames);
21
- }
22
- protected override setSchemaByName(schema: ObjectSchema): void
23
- {
24
- schema.delReadOnly(true);
25
- }
26
- async get(user_id: string, id: string, trx: Transaction | null): Promise<EntityFieldModel | null>
27
- {
28
- return await this._get({ where: { user_id, id }, }, trx);
29
- }
30
- async create(access: AccessRow, session: SessionRow, user_id: string, entity_id: string, field_id: string, value: string, description: string, trx: Transaction | null): Promise<EntityFieldModel>
31
- {
32
- return this.app.on.create(this, access, session, async () =>
33
- {
34
- return await this.model.create({
35
- user_id,
36
- entity_id,
37
- field_id,
38
- value,
39
- description,
40
- }, { transaction: trx });
41
- });
42
- }
43
- async update(access: AccessRow, session: SessionRow, user_id: string, id: string, entity_id: string, field_id: string, value: string, description: string, trx: Transaction | null): Promise<EntityFieldModel>
44
- {
45
- return await this.app.on.update(this, access, session, async () =>
46
- {
47
- return await this._get({ where: { user_id, id } }, trx);
48
- }, async (item) =>
49
- {
50
- item.entity_id = entity_id;
51
- item.field_id = field_id;
52
- item.value = value;
53
- item.description = description;
54
- return await item.save({ transaction: trx });
55
- });
56
- }
57
- async delete(access: AccessRow, session: SessionRow, user_id: string, id: string, trx: Transaction | null): Promise<void>
58
- {
59
- await this.app.on.delete(this, access, session, async () =>
60
- {
61
- let item = await this._get({ where: { user_id, id } }, trx);
62
- await item.destroy({ transaction: trx });
63
- return item;
64
- });
65
- }
1
+ import { BaseMySqlDatabase, BaseSequelizeTable } from "namirasoft-node-mysql";
2
+ import { Transaction } from "sequelize";
3
+ import { EntityFieldModel } from "../model/EntityFieldModel";
4
+ import { ObjectSchema } from "namirasoft-schema";
5
+ import { SessionRow } from "namirasoft-account";
6
+ import { EntityFieldNames } from "../../enum/EntityFieldNames";
7
+ import { NSABaseApplication } from "namirasoft-account-node";
8
+ import { AccessRow } from "namirasoft-access";
9
+
10
+ export class EntityFieldTable<Database extends BaseMySqlDatabase> extends BaseSequelizeTable<Database, EntityFieldModel>
11
+ {
12
+ public app: NSABaseApplication<Database>;
13
+ constructor(app: NSABaseApplication<Database>, database: Database)
14
+ {
15
+ super(database);
16
+ this.app = app;
17
+ }
18
+ override getSchemaNames(): string[]
19
+ {
20
+ return Object.keys(EntityFieldNames);
21
+ }
22
+ protected override setSchemaByName(schema: ObjectSchema): void
23
+ {
24
+ schema.delReadOnly(true);
25
+ }
26
+ async get(user_id: string, id: string, trx: Transaction | null): Promise<EntityFieldModel | null>
27
+ {
28
+ return await this._get({ where: { user_id, id }, }, trx);
29
+ }
30
+ async create(access: AccessRow, session: SessionRow, user_id: string, entity_id: string, field_id: string, value: string, description: string, trx: Transaction | null): Promise<EntityFieldModel>
31
+ {
32
+ return this.app.on.create(this, access, session, async () =>
33
+ {
34
+ return await this.model.create({
35
+ user_id,
36
+ entity_id,
37
+ field_id,
38
+ value,
39
+ description,
40
+ }, { transaction: trx });
41
+ });
42
+ }
43
+ async update(access: AccessRow, session: SessionRow, user_id: string, id: string, entity_id: string, field_id: string, value: string, description: string, trx: Transaction | null): Promise<EntityFieldModel>
44
+ {
45
+ return await this.app.on.update(this, access, session, async () =>
46
+ {
47
+ return await this._get({ where: { user_id, id } }, trx);
48
+ }, async (item) =>
49
+ {
50
+ item.entity_id = entity_id;
51
+ item.field_id = field_id;
52
+ item.value = value;
53
+ item.description = description;
54
+ return await item.save({ transaction: trx });
55
+ });
56
+ }
57
+ async delete(access: AccessRow, session: SessionRow, user_id: string, id: string, trx: Transaction | null): Promise<void>
58
+ {
59
+ await this.app.on.delete(this, access, session, async () =>
60
+ {
61
+ let item = await this._get({ where: { user_id, id } }, trx);
62
+ await item.destroy({ transaction: trx });
63
+ return item;
64
+ });
65
+ }
66
66
  }
@@ -1,66 +1,66 @@
1
- import { BaseMySqlDatabase, BaseSequelizeTable } from "namirasoft-node-mysql";
2
- import { Transaction } from "sequelize";
3
- import { EntityTagModel } from "../model/EntityTagModel";
4
- import { ObjectSchema } from "namirasoft-schema";
5
- import { SessionRow } from "namirasoft-account";
6
- import { EntityTagNames } from "../../enum/EntityTagNames";
7
- import { NSABaseApplication } from "namirasoft-account-node";
8
- import { AccessRow } from "namirasoft-access";
9
-
10
- export class EntityTagTable<Database extends BaseMySqlDatabase> extends BaseSequelizeTable<Database, EntityTagModel>
11
- {
12
- public app: NSABaseApplication<Database>;
13
- constructor(app: NSABaseApplication<Database>, database: Database)
14
- {
15
- super(database);
16
- this.app = app;
17
- }
18
- override getSchemaNames(): string[]
19
- {
20
- return Object.keys(EntityTagNames);
21
- }
22
- protected override setSchemaByName(schema: ObjectSchema): void
23
- {
24
- schema.delReadOnly(true);
25
- }
26
- async get(user_id: string, id: string, trx: Transaction | null): Promise<EntityTagModel | null>
27
- {
28
- return await this._get({ where: { user_id, id }, }, trx);
29
- }
30
- async create(accses: AccessRow, session: SessionRow, user_id: string, entity_id: string, name: string, value: string, description: string, trx: Transaction | null): Promise<EntityTagModel>
31
- {
32
- return this.app.on.create(this, accses, session, async () =>
33
- {
34
- return await this.model.create({
35
- user_id,
36
- entity_id,
37
- name,
38
- value,
39
- description,
40
- }, { transaction: trx });
41
- });
42
- }
43
- async update(accses: AccessRow, session: SessionRow, user_id: string, id: string, entity_id: string, name: string, value: string, description: string, trx: Transaction | null): Promise<EntityTagModel>
44
- {
45
- return await this.app.on.update(this, accses, session, async () =>
46
- {
47
- return await this._get({ where: { user_id, id } }, trx);
48
- }, async (item) =>
49
- {
50
- item.entity_id = entity_id;
51
- item.name = name;
52
- item.value = value;
53
- item.description = description;
54
- return await item.save({ transaction: trx });
55
- });
56
- }
57
- async delete(accses: AccessRow, session: SessionRow, user_id: string, id: string, trx: Transaction | null): Promise<void>
58
- {
59
- await this.app.on.delete(this, accses, session, async () =>
60
- {
61
- let item = await this._get({ where: { user_id, id } }, trx);
62
- await item.destroy({ transaction: trx });
63
- return item;
64
- });
65
- }
1
+ import { BaseMySqlDatabase, BaseSequelizeTable } from "namirasoft-node-mysql";
2
+ import { Transaction } from "sequelize";
3
+ import { EntityTagModel } from "../model/EntityTagModel";
4
+ import { ObjectSchema } from "namirasoft-schema";
5
+ import { SessionRow } from "namirasoft-account";
6
+ import { EntityTagNames } from "../../enum/EntityTagNames";
7
+ import { NSABaseApplication } from "namirasoft-account-node";
8
+ import { AccessRow } from "namirasoft-access";
9
+
10
+ export class EntityTagTable<Database extends BaseMySqlDatabase> extends BaseSequelizeTable<Database, EntityTagModel>
11
+ {
12
+ public app: NSABaseApplication<Database>;
13
+ constructor(app: NSABaseApplication<Database>, database: Database)
14
+ {
15
+ super(database);
16
+ this.app = app;
17
+ }
18
+ override getSchemaNames(): string[]
19
+ {
20
+ return Object.keys(EntityTagNames);
21
+ }
22
+ protected override setSchemaByName(schema: ObjectSchema): void
23
+ {
24
+ schema.delReadOnly(true);
25
+ }
26
+ async get(user_id: string, id: string, trx: Transaction | null): Promise<EntityTagModel | null>
27
+ {
28
+ return await this._get({ where: { user_id, id }, }, trx);
29
+ }
30
+ async create(accses: AccessRow, session: SessionRow, user_id: string, entity_id: string, name: string, value: string, description: string, trx: Transaction | null): Promise<EntityTagModel>
31
+ {
32
+ return this.app.on.create(this, accses, session, async () =>
33
+ {
34
+ return await this.model.create({
35
+ user_id,
36
+ entity_id,
37
+ name,
38
+ value,
39
+ description,
40
+ }, { transaction: trx });
41
+ });
42
+ }
43
+ async update(accses: AccessRow, session: SessionRow, user_id: string, id: string, entity_id: string, name: string, value: string, description: string, trx: Transaction | null): Promise<EntityTagModel>
44
+ {
45
+ return await this.app.on.update(this, accses, session, async () =>
46
+ {
47
+ return await this._get({ where: { user_id, id } }, trx);
48
+ }, async (item) =>
49
+ {
50
+ item.entity_id = entity_id;
51
+ item.name = name;
52
+ item.value = value;
53
+ item.description = description;
54
+ return await item.save({ transaction: trx });
55
+ });
56
+ }
57
+ async delete(accses: AccessRow, session: SessionRow, user_id: string, id: string, trx: Transaction | null): Promise<void>
58
+ {
59
+ await this.app.on.delete(this, accses, session, async () =>
60
+ {
61
+ let item = await this._get({ where: { user_id, id } }, trx);
62
+ await item.destroy({ transaction: trx });
63
+ return item;
64
+ });
65
+ }
66
66
  }
@@ -1,4 +1,4 @@
1
- export enum EntityCategoryNames
2
- {
3
- EntityCategoryInput = "EntityCategoryInput"
1
+ export enum EntityCategoryNames
2
+ {
3
+ EntityCategoryInput = "EntityCategoryInput"
4
4
  };
@@ -1,4 +1,4 @@
1
- export enum EntityFieldNames
2
- {
3
- EntityFieldInput = "EntityFieldInput"
1
+ export enum EntityFieldNames
2
+ {
3
+ EntityFieldInput = "EntityFieldInput"
4
4
  };
@@ -1,4 +1,4 @@
1
- export enum EntityTagNames
2
- {
3
- EntityTagInput = "EntityTagInput"
1
+ export enum EntityTagNames
2
+ {
3
+ EntityTagInput = "EntityTagInput"
4
4
  };
package/src/index.ts CHANGED
@@ -1,3 +1,3 @@
1
- export * from "./database/FieldDatabaseTables";
2
- export * from "./NSFApplication";
1
+ export * from "./database/FieldDatabaseTables";
2
+ export * from "./NSFApplication";
3
3
  export * from "./controller/NSFListController";