@flusys/nestjs-iam 5.3.0 → 5.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 (32) hide show
  1. package/cjs/entities/action.entity.js +112 -2
  2. package/cjs/entities/index.js +1 -2
  3. package/cjs/entities/permission-base.entity.js +9 -31
  4. package/cjs/entities/permission-with-company.entity.js +4 -2
  5. package/cjs/entities/user-iam-permission.entity.js +3 -14
  6. package/cjs/enums/iam-entity-type.enum.js +17 -0
  7. package/cjs/enums/iam-permission-type.enum.js +17 -0
  8. package/cjs/enums/index.js +2 -0
  9. package/cjs/services/permission.service.js +66 -64
  10. package/entities/action.entity.d.ts +15 -2
  11. package/entities/index.d.ts +3 -4
  12. package/entities/permission-base.entity.d.ts +0 -12
  13. package/entities/user-iam-permission.entity.d.ts +0 -1
  14. package/enums/iam-entity-type.enum.d.ts +6 -0
  15. package/enums/iam-permission-type.enum.d.ts +6 -0
  16. package/enums/index.d.ts +2 -0
  17. package/fesm/entities/action.entity.js +113 -3
  18. package/fesm/entities/index.js +3 -4
  19. package/fesm/entities/permission-base.entity.js +6 -17
  20. package/fesm/entities/permission-with-company.entity.js +4 -2
  21. package/fesm/entities/role-base.entity.js +1 -4
  22. package/fesm/entities/user-iam-permission.entity.js +0 -2
  23. package/fesm/enums/iam-entity-type.enum.js +7 -0
  24. package/fesm/enums/iam-permission-type.enum.js +7 -0
  25. package/fesm/enums/index.js +2 -0
  26. package/fesm/services/action.service.js +1 -1
  27. package/fesm/services/permission.service.js +3 -1
  28. package/package.json +3 -3
  29. package/services/action.service.d.ts +8 -8
  30. package/cjs/entities/action-base.entity.js +0 -130
  31. package/entities/action-base.entity.d.ts +0 -16
  32. package/fesm/entities/action-base.entity.js +0 -123
@@ -1,123 +0,0 @@
1
- function _define_property(obj, key, value) {
2
- if (key in obj) {
3
- Object.defineProperty(obj, key, {
4
- value: value,
5
- enumerable: true,
6
- configurable: true,
7
- writable: true
8
- });
9
- } else {
10
- obj[key] = value;
11
- }
12
- return obj;
13
- }
14
- function _ts_decorate(decorators, target, key, desc) {
15
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
16
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
17
- else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
18
- return c > 3 && r && Object.defineProperty(target, key, r), r;
19
- }
20
- function _ts_metadata(k, v) {
21
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
22
- }
23
- import { getJsonColumnType, Identity } from '@flusys/nestjs-shared';
24
- import { Column, JoinColumn, ManyToOne, OneToMany } from 'typeorm';
25
- import { ActionType } from '../enums';
26
- /**
27
- * Action Base Entity
28
- * Core action fields for all actions
29
- */ export class ActionBase extends Identity {
30
- constructor(...args){
31
- super(...args), _define_property(this, "readOnly", void 0), _define_property(this, "name", void 0), _define_property(this, "description", void 0), _define_property(this, "code", void 0), _define_property(this, "actionType", void 0), _define_property(this, "permissionLogic", void 0), _define_property(this, "serial", void 0), _define_property(this, "isActive", void 0), _define_property(this, "parent", void 0), _define_property(this, "parentId", void 0), _define_property(this, "children", void 0);
32
- }
33
- }
34
- _ts_decorate([
35
- Column({
36
- type: 'boolean',
37
- nullable: false,
38
- default: false,
39
- name: 'read_only'
40
- }),
41
- _ts_metadata("design:type", Boolean)
42
- ], ActionBase.prototype, "readOnly", void 0);
43
- _ts_decorate([
44
- Column({
45
- type: 'varchar',
46
- length: 255,
47
- nullable: false
48
- }),
49
- _ts_metadata("design:type", String)
50
- ], ActionBase.prototype, "name", void 0);
51
- _ts_decorate([
52
- Column({
53
- type: 'varchar',
54
- length: 500,
55
- nullable: true
56
- }),
57
- _ts_metadata("design:type", Object)
58
- ], ActionBase.prototype, "description", void 0);
59
- _ts_decorate([
60
- Column({
61
- type: 'varchar',
62
- length: 255,
63
- nullable: true,
64
- unique: true
65
- }),
66
- _ts_metadata("design:type", Object)
67
- ], ActionBase.prototype, "code", void 0);
68
- _ts_decorate([
69
- Column({
70
- type: 'varchar',
71
- length: 50,
72
- nullable: false,
73
- default: 'BACKEND',
74
- name: 'action_type'
75
- }),
76
- _ts_metadata("design:type", typeof ActionType === "undefined" ? Object : ActionType)
77
- ], ActionBase.prototype, "actionType", void 0);
78
- _ts_decorate([
79
- Column({
80
- type: getJsonColumnType(),
81
- nullable: true,
82
- name: 'permission_logic'
83
- }),
84
- _ts_metadata("design:type", Object)
85
- ], ActionBase.prototype, "permissionLogic", void 0);
86
- _ts_decorate([
87
- Column({
88
- type: 'int',
89
- nullable: true
90
- }),
91
- _ts_metadata("design:type", Object)
92
- ], ActionBase.prototype, "serial", void 0);
93
- _ts_decorate([
94
- Column({
95
- type: 'boolean',
96
- nullable: false,
97
- default: true,
98
- name: 'is_active'
99
- }),
100
- _ts_metadata("design:type", Boolean)
101
- ], ActionBase.prototype, "isActive", void 0);
102
- _ts_decorate([
103
- ManyToOne('Action', 'children', {
104
- nullable: true,
105
- onDelete: 'CASCADE'
106
- }),
107
- JoinColumn({
108
- name: 'parent_id'
109
- }),
110
- _ts_metadata("design:type", Object)
111
- ], ActionBase.prototype, "parent", void 0);
112
- _ts_decorate([
113
- Column({
114
- type: 'uuid',
115
- nullable: true,
116
- name: 'parent_id'
117
- }),
118
- _ts_metadata("design:type", Object)
119
- ], ActionBase.prototype, "parentId", void 0);
120
- _ts_decorate([
121
- OneToMany('Action', 'parent'),
122
- _ts_metadata("design:type", Array)
123
- ], ActionBase.prototype, "children", void 0);