@flusys/nestjs-shared 1.1.0-beta → 2.0.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 (113) hide show
  1. package/README.md +501 -720
  2. package/cjs/classes/api-controller.class.js +9 -24
  3. package/cjs/classes/api-service.class.js +59 -92
  4. package/cjs/classes/index.js +1 -0
  5. package/cjs/classes/winston-logger-adapter.class.js +23 -40
  6. package/cjs/constants/index.js +14 -0
  7. package/cjs/constants/permissions.js +184 -0
  8. package/cjs/decorators/api-response.decorator.js +1 -1
  9. package/cjs/decorators/index.js +1 -0
  10. package/cjs/decorators/sanitize-html.decorator.js +36 -0
  11. package/cjs/dtos/delete.dto.js +10 -0
  12. package/cjs/dtos/filter-and-pagination.dto.js +24 -34
  13. package/cjs/dtos/pagination.dto.js +4 -8
  14. package/cjs/dtos/response-payload.dto.js +0 -116
  15. package/cjs/entities/identity.js +4 -4
  16. package/cjs/entities/user-root.js +13 -14
  17. package/cjs/guards/permission.guard.js +51 -105
  18. package/cjs/interceptors/index.js +1 -3
  19. package/cjs/interceptors/set-user-field-on-body.interceptor.js +60 -0
  20. package/cjs/interceptors/slug.interceptor.js +30 -9
  21. package/cjs/interfaces/datasource.interface.js +4 -0
  22. package/cjs/interfaces/index.js +2 -1
  23. package/cjs/interfaces/module-config.interface.js +4 -0
  24. package/cjs/middlewares/logger.middleware.js +50 -89
  25. package/cjs/modules/cache/cache.module.js +3 -3
  26. package/cjs/modules/datasource/datasource.module.js +11 -14
  27. package/cjs/modules/datasource/multi-tenant-datasource.service.js +29 -113
  28. package/cjs/modules/utils/utils.service.js +40 -203
  29. package/cjs/utils/error-handler.util.js +35 -12
  30. package/cjs/utils/html-sanitizer.util.js +64 -0
  31. package/cjs/utils/index.js +4 -0
  32. package/cjs/utils/query-helpers.util.js +53 -0
  33. package/cjs/utils/request.util.js +70 -0
  34. package/cjs/utils/string.util.js +63 -0
  35. package/classes/api-controller.class.d.ts +5 -5
  36. package/classes/api-service.class.d.ts +7 -5
  37. package/classes/index.d.ts +1 -0
  38. package/classes/request-scoped-api.service.d.ts +3 -2
  39. package/classes/winston-logger-adapter.class.d.ts +2 -0
  40. package/constants/index.d.ts +1 -0
  41. package/constants/permissions.d.ts +179 -0
  42. package/decorators/index.d.ts +1 -0
  43. package/decorators/sanitize-html.decorator.d.ts +2 -0
  44. package/dtos/delete.dto.d.ts +1 -0
  45. package/dtos/filter-and-pagination.dto.d.ts +0 -2
  46. package/dtos/response-payload.dto.d.ts +0 -20
  47. package/fesm/classes/api-controller.class.js +9 -24
  48. package/fesm/classes/api-service.class.js +59 -92
  49. package/fesm/classes/index.js +2 -0
  50. package/fesm/classes/winston-logger-adapter.class.js +23 -40
  51. package/fesm/constants/index.js +2 -0
  52. package/fesm/constants/permissions.js +128 -0
  53. package/fesm/decorators/api-response.decorator.js +1 -1
  54. package/fesm/decorators/index.js +1 -0
  55. package/fesm/decorators/sanitize-html.decorator.js +45 -0
  56. package/fesm/dtos/delete.dto.js +12 -2
  57. package/fesm/dtos/filter-and-pagination.dto.js +26 -47
  58. package/fesm/dtos/pagination.dto.js +4 -8
  59. package/fesm/dtos/response-payload.dto.js +0 -107
  60. package/fesm/entities/identity.js +4 -4
  61. package/fesm/entities/user-root.js +13 -14
  62. package/fesm/guards/permission.guard.js +51 -105
  63. package/fesm/interceptors/index.js +1 -3
  64. package/fesm/interceptors/set-user-field-on-body.interceptor.js +39 -0
  65. package/fesm/interceptors/slug.interceptor.js +31 -10
  66. package/fesm/interfaces/datasource.interface.js +20 -0
  67. package/fesm/interfaces/index.js +2 -1
  68. package/fesm/interfaces/module-config.interface.js +5 -0
  69. package/fesm/middlewares/logger.middleware.js +50 -83
  70. package/fesm/modules/cache/cache.module.js +2 -2
  71. package/fesm/modules/datasource/datasource.module.js +11 -14
  72. package/fesm/modules/datasource/multi-tenant-datasource.service.js +29 -113
  73. package/fesm/modules/utils/utils.service.js +41 -204
  74. package/fesm/utils/error-handler.util.js +36 -13
  75. package/fesm/utils/html-sanitizer.util.js +69 -0
  76. package/fesm/utils/index.js +4 -0
  77. package/fesm/utils/query-helpers.util.js +78 -0
  78. package/fesm/utils/request.util.js +58 -0
  79. package/fesm/utils/string.util.js +71 -0
  80. package/guards/permission.guard.d.ts +2 -0
  81. package/interceptors/index.d.ts +1 -3
  82. package/interceptors/set-user-field-on-body.interceptor.d.ts +5 -0
  83. package/interceptors/slug.interceptor.d.ts +2 -1
  84. package/interfaces/api.interface.d.ts +2 -2
  85. package/interfaces/datasource.interface.d.ts +5 -0
  86. package/interfaces/identity.interface.d.ts +4 -4
  87. package/interfaces/index.d.ts +2 -1
  88. package/interfaces/logged-user-info.interface.d.ts +0 -2
  89. package/interfaces/module-config.interface.d.ts +6 -0
  90. package/interfaces/permission.interface.d.ts +0 -1
  91. package/middlewares/logger.middleware.d.ts +2 -2
  92. package/modules/datasource/datasource.module.d.ts +1 -0
  93. package/modules/datasource/multi-tenant-datasource.service.d.ts +0 -1
  94. package/modules/utils/utils.service.d.ts +4 -14
  95. package/package.json +4 -4
  96. package/utils/error-handler.util.d.ts +14 -19
  97. package/utils/html-sanitizer.util.d.ts +2 -0
  98. package/utils/index.d.ts +4 -0
  99. package/utils/query-helpers.util.d.ts +16 -0
  100. package/utils/request.util.d.ts +4 -0
  101. package/utils/string.util.d.ts +2 -0
  102. package/cjs/interceptors/set-create-by-on-body.interceptor.js +0 -40
  103. package/cjs/interceptors/set-delete-by-on-body.interceptor.js +0 -40
  104. package/cjs/interceptors/set-update-by-on-body.interceptor.js +0 -40
  105. package/cjs/interfaces/base-query.interface.js +0 -6
  106. package/fesm/interceptors/set-create-by-on-body.interceptor.js +0 -30
  107. package/fesm/interceptors/set-delete-by-on-body.interceptor.js +0 -30
  108. package/fesm/interceptors/set-update-by-on-body.interceptor.js +0 -30
  109. package/fesm/interfaces/base-query.interface.js +0 -3
  110. package/interceptors/set-create-by-on-body.interceptor.d.ts +0 -5
  111. package/interceptors/set-delete-by-on-body.interceptor.d.ts +0 -5
  112. package/interceptors/set-update-by-on-body.interceptor.d.ts +0 -5
  113. package/interfaces/base-query.interface.d.ts +0 -7
@@ -0,0 +1,128 @@
1
+ /**
2
+ * Centralized Permission Codes
3
+ *
4
+ * Single source of truth for all permission codes used across the application.
5
+ * Use these constants instead of hardcoded strings to prevent typos and enable easy refactoring.
6
+ *
7
+ * Naming Convention: <entity>.<action>
8
+ * - entity: The resource being accessed (e.g., user, role, company)
9
+ * - action: The operation being performed (create, read, update, delete, assign)
10
+ */ // ==================== AUTH MODULE ====================
11
+ export const USER_PERMISSIONS = {
12
+ CREATE: 'user.create',
13
+ READ: 'user.read',
14
+ UPDATE: 'user.update',
15
+ DELETE: 'user.delete'
16
+ };
17
+ export const COMPANY_PERMISSIONS = {
18
+ CREATE: 'company.create',
19
+ READ: 'company.read',
20
+ UPDATE: 'company.update',
21
+ DELETE: 'company.delete'
22
+ };
23
+ export const BRANCH_PERMISSIONS = {
24
+ CREATE: 'branch.create',
25
+ READ: 'branch.read',
26
+ UPDATE: 'branch.update',
27
+ DELETE: 'branch.delete'
28
+ };
29
+ // ==================== IAM MODULE ====================
30
+ export const ACTION_PERMISSIONS = {
31
+ CREATE: 'action.create',
32
+ READ: 'action.read',
33
+ UPDATE: 'action.update',
34
+ DELETE: 'action.delete'
35
+ };
36
+ export const ROLE_PERMISSIONS = {
37
+ CREATE: 'role.create',
38
+ READ: 'role.read',
39
+ UPDATE: 'role.update',
40
+ DELETE: 'role.delete'
41
+ };
42
+ export const ROLE_ACTION_PERMISSIONS = {
43
+ READ: 'role-action.read',
44
+ ASSIGN: 'role-action.assign'
45
+ };
46
+ export const USER_ROLE_PERMISSIONS = {
47
+ READ: 'user-role.read',
48
+ ASSIGN: 'user-role.assign'
49
+ };
50
+ export const USER_ACTION_PERMISSIONS = {
51
+ READ: 'user-action.read',
52
+ ASSIGN: 'user-action.assign'
53
+ };
54
+ export const COMPANY_ACTION_PERMISSIONS = {
55
+ READ: 'company-action.read',
56
+ ASSIGN: 'company-action.assign'
57
+ };
58
+ // ==================== STORAGE MODULE ====================
59
+ export const FILE_PERMISSIONS = {
60
+ CREATE: 'file.create',
61
+ READ: 'file.read',
62
+ UPDATE: 'file.update',
63
+ DELETE: 'file.delete'
64
+ };
65
+ export const FOLDER_PERMISSIONS = {
66
+ CREATE: 'folder.create',
67
+ READ: 'folder.read',
68
+ UPDATE: 'folder.update',
69
+ DELETE: 'folder.delete'
70
+ };
71
+ export const STORAGE_CONFIG_PERMISSIONS = {
72
+ CREATE: 'storage-config.create',
73
+ READ: 'storage-config.read',
74
+ UPDATE: 'storage-config.update',
75
+ DELETE: 'storage-config.delete'
76
+ };
77
+ // ==================== EMAIL MODULE ====================
78
+ export const EMAIL_CONFIG_PERMISSIONS = {
79
+ CREATE: 'email-config.create',
80
+ READ: 'email-config.read',
81
+ UPDATE: 'email-config.update',
82
+ DELETE: 'email-config.delete'
83
+ };
84
+ export const EMAIL_TEMPLATE_PERMISSIONS = {
85
+ CREATE: 'email-template.create',
86
+ READ: 'email-template.read',
87
+ UPDATE: 'email-template.update',
88
+ DELETE: 'email-template.delete'
89
+ };
90
+ // ==================== FORM BUILDER MODULE ====================
91
+ export const FORM_PERMISSIONS = {
92
+ CREATE: 'form.create',
93
+ READ: 'form.read',
94
+ UPDATE: 'form.update',
95
+ DELETE: 'form.delete'
96
+ };
97
+ export const FORM_RESULT_PERMISSIONS = {
98
+ CREATE: 'form-result.create',
99
+ READ: 'form-result.read',
100
+ UPDATE: 'form-result.update',
101
+ DELETE: 'form-result.delete'
102
+ };
103
+ // ==================== AGGREGATED EXPORTS ====================
104
+ /**
105
+ * All permission codes grouped by module
106
+ */ export const PERMISSIONS = {
107
+ // Auth
108
+ USER: USER_PERMISSIONS,
109
+ COMPANY: COMPANY_PERMISSIONS,
110
+ BRANCH: BRANCH_PERMISSIONS,
111
+ // IAM
112
+ ACTION: ACTION_PERMISSIONS,
113
+ ROLE: ROLE_PERMISSIONS,
114
+ ROLE_ACTION: ROLE_ACTION_PERMISSIONS,
115
+ USER_ROLE: USER_ROLE_PERMISSIONS,
116
+ USER_ACTION: USER_ACTION_PERMISSIONS,
117
+ COMPANY_ACTION: COMPANY_ACTION_PERMISSIONS,
118
+ // Storage
119
+ FILE: FILE_PERMISSIONS,
120
+ FOLDER: FOLDER_PERMISSIONS,
121
+ STORAGE_CONFIG: STORAGE_CONFIG_PERMISSIONS,
122
+ // Email
123
+ EMAIL_CONFIG: EMAIL_CONFIG_PERMISSIONS,
124
+ EMAIL_TEMPLATE: EMAIL_TEMPLATE_PERMISSIONS,
125
+ // Form Builder
126
+ FORM: FORM_PERMISSIONS,
127
+ FORM_RESULT: FORM_RESULT_PERMISSIONS
128
+ };
@@ -1,4 +1,4 @@
1
- import { BulkMetaDto, BulkResponseDto, ListResponseDto, PaginationMetaDto, SingleResponseDto } from '@flusys/nestjs-shared/dtos';
1
+ import { BulkMetaDto, BulkResponseDto, ListResponseDto, PaginationMetaDto, SingleResponseDto } from '../dtos';
2
2
  import { applyDecorators } from '@nestjs/common';
3
3
  import { ApiExtraModels, ApiOkResponse, getSchemaPath } from '@nestjs/swagger';
4
4
  /**
@@ -2,3 +2,4 @@ export * from './api-response.decorator';
2
2
  export * from './current-user.decorator';
3
3
  export * from './public.decorator';
4
4
  export * from './require-permission.decorator';
5
+ export * from './sanitize-html.decorator';
@@ -0,0 +1,45 @@
1
+ import { Transform } from 'class-transformer';
2
+ import { escapeHtml } from '../utils/html-sanitizer.util';
3
+ /**
4
+ * Decorator that sanitizes HTML content in string fields to prevent XSS attacks.
5
+ * Applies HTML escaping during transformation (when class-transformer processes the DTO).
6
+ *
7
+ * @example
8
+ * ```typescript
9
+ * class CreateCommentDto {
10
+ * @SanitizeHtml()
11
+ * @IsString()
12
+ * content: string;
13
+ * }
14
+ * ```
15
+ *
16
+ * Input: '<script>alert("xss")</script>'
17
+ * Output: '&lt;script&gt;alert(&quot;xss&quot;)&lt;/script&gt;'
18
+ */ export function SanitizeHtml() {
19
+ return Transform(({ value })=>{
20
+ if (typeof value === 'string') {
21
+ return escapeHtml(value);
22
+ }
23
+ return value;
24
+ });
25
+ }
26
+ /**
27
+ * Decorator that sanitizes HTML and trims whitespace from string fields.
28
+ * Combines sanitization with trimming for cleaner input handling.
29
+ *
30
+ * @example
31
+ * ```typescript
32
+ * class CreatePostDto {
33
+ * @SanitizeAndTrim()
34
+ * @IsString()
35
+ * title: string;
36
+ * }
37
+ * ```
38
+ */ export function SanitizeAndTrim() {
39
+ return Transform(({ value })=>{
40
+ if (typeof value === 'string') {
41
+ return escapeHtml(value.trim());
42
+ }
43
+ return value;
44
+ });
45
+ }
@@ -20,12 +20,13 @@ function _ts_decorate(decorators, target, key, desc) {
20
20
  function _ts_metadata(k, v) {
21
21
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
22
22
  }
23
- import { ApiProperty } from '@nestjs/swagger';
24
- import { IsIn, IsNotEmpty } from 'class-validator';
23
+ import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
24
+ import { IsIn, IsNotEmpty, IsOptional, IsUUID } from 'class-validator';
25
25
  export class DeleteDto {
26
26
  constructor(){
27
27
  _define_property(this, "id", void 0);
28
28
  _define_property(this, "type", void 0);
29
+ _define_property(this, "deletedById", void 0);
29
30
  }
30
31
  }
31
32
  _ts_decorate([
@@ -70,3 +71,12 @@ _ts_decorate([
70
71
  ]),
71
72
  _ts_metadata("design:type", String)
72
73
  ], DeleteDto.prototype, "type", void 0);
74
+ _ts_decorate([
75
+ ApiPropertyOptional({
76
+ description: 'User ID who initiated the deletion (auto-set by interceptor)',
77
+ example: 'f2e9c8d0-7a2a-11eb-9439-0242ac130002'
78
+ }),
79
+ IsOptional(),
80
+ IsUUID(),
81
+ _ts_metadata("design:type", String)
82
+ ], DeleteDto.prototype, "deletedById", void 0);
@@ -22,27 +22,15 @@ function _ts_metadata(k, v) {
22
22
  }
23
23
  import { ApiPropertyOptional } from '@nestjs/swagger';
24
24
  import { Type } from 'class-transformer';
25
- import { IsArray, IsBoolean, IsObject, IsOptional, ValidateNested } from 'class-validator';
25
+ import { IsArray, IsBoolean, IsObject, IsOptional, IsString, Matches, MaxLength, ValidateNested } from 'class-validator';
26
26
  import { PaginationDto } from './pagination.dto';
27
- /**
28
- * DTO for filtering and pagination in get-all requests
29
- *
30
- * @example
31
- * {
32
- * "filter": { "isActive": true, "category": "electronics" },
33
- * "pagination": { "currentPage": 0, "pageSize": 10 },
34
- * "sort": { "createdAt": "DESC" },
35
- * "select": ["id", "name", "price"],
36
- * "withDeleted": false
37
- * }
38
- */ export class FilterAndPaginationDto {
27
+ export class FilterAndPaginationDto {
39
28
  constructor(){
40
29
  _define_property(this, "filter", void 0);
41
30
  _define_property(this, "pagination", void 0);
42
31
  _define_property(this, "sort", void 0);
43
32
  _define_property(this, "select", void 0);
44
33
  _define_property(this, "withDeleted", void 0);
45
- _define_property(this, "extraKey", void 0);
46
34
  }
47
35
  }
48
36
  _ts_decorate([
@@ -90,7 +78,7 @@ _ts_decorate([
90
78
  type: [
91
79
  String
92
80
  ],
93
- description: 'Fields to return. If empty, returns all fields.',
81
+ description: 'Fields to return. Must be valid field names (alphanumeric, underscores only). If empty, returns all fields.',
94
82
  example: [
95
83
  'id',
96
84
  'name',
@@ -100,6 +88,17 @@ _ts_decorate([
100
88
  }),
101
89
  IsOptional(),
102
90
  IsArray(),
91
+ IsString({
92
+ each: true
93
+ }),
94
+ Matches(/^[a-zA-Z_][a-zA-Z0-9_]*$/, {
95
+ each: true,
96
+ message: 'Select fields must be valid identifiers (alphanumeric and underscores only)'
97
+ }),
98
+ MaxLength(64, {
99
+ each: true,
100
+ message: 'Field names must be 64 characters or less'
101
+ }),
103
102
  _ts_metadata("design:type", Array)
104
103
  ], FilterAndPaginationDto.prototype, "select", void 0);
105
104
  _ts_decorate([
@@ -112,27 +111,11 @@ _ts_decorate([
112
111
  IsBoolean(),
113
112
  _ts_metadata("design:type", Boolean)
114
113
  ], FilterAndPaginationDto.prototype, "withDeleted", void 0);
115
- _ts_decorate([
116
- ApiPropertyOptional({
117
- type: [
118
- String
119
- ],
120
- description: 'Additional relation keys to include',
121
- example: [
122
- 'category',
123
- 'createdBy'
124
- ]
125
- }),
126
- IsOptional(),
127
- IsArray(),
128
- _ts_metadata("design:type", Array)
129
- ], FilterAndPaginationDto.prototype, "extraKey", void 0);
130
114
  /**
131
115
  * DTO for get-by-id request body
132
116
  */ export class GetByIdBodyDto {
133
117
  constructor(){
134
118
  _define_property(this, "select", void 0);
135
- _define_property(this, "extraKey", void 0);
136
119
  }
137
120
  }
138
121
  _ts_decorate([
@@ -140,7 +123,7 @@ _ts_decorate([
140
123
  type: [
141
124
  String
142
125
  ],
143
- description: 'Fields to return. If empty, returns all fields.',
126
+ description: 'Fields to return. Must be valid field names (alphanumeric, underscores only). If empty, returns all fields.',
144
127
  example: [
145
128
  'id',
146
129
  'name',
@@ -150,20 +133,16 @@ _ts_decorate([
150
133
  }),
151
134
  IsOptional(),
152
135
  IsArray(),
153
- _ts_metadata("design:type", Array)
154
- ], GetByIdBodyDto.prototype, "select", void 0);
155
- _ts_decorate([
156
- ApiPropertyOptional({
157
- type: [
158
- String
159
- ],
160
- description: 'Additional relation keys to include',
161
- example: [
162
- 'category',
163
- 'createdBy'
164
- ]
136
+ IsString({
137
+ each: true
138
+ }),
139
+ Matches(/^[a-zA-Z_][a-zA-Z0-9_]*$/, {
140
+ each: true,
141
+ message: 'Select fields must be valid identifiers (alphanumeric and underscores only)'
142
+ }),
143
+ MaxLength(64, {
144
+ each: true,
145
+ message: 'Field names must be 64 characters or less'
165
146
  }),
166
- IsOptional(),
167
- IsArray(),
168
147
  _ts_metadata("design:type", Array)
169
- ], GetByIdBodyDto.prototype, "extraKey", void 0);
148
+ ], GetByIdBodyDto.prototype, "select", void 0);
@@ -25,17 +25,13 @@ import { Transform } from 'class-transformer';
25
25
  import { IsNumber, IsOptional } from 'class-validator';
26
26
  export class PaginationDto {
27
27
  constructor(){
28
- /**
29
- * Number of items per page. Defaults to 10 when not provided or invalid.
30
- */ _define_property(this, "pageSize", 10);
31
- /**
32
- * Zero-based page index. Defaults to 0 when not provided or invalid.
33
- */ _define_property(this, "currentPage", 0);
28
+ _define_property(this, "pageSize", 10);
29
+ _define_property(this, "currentPage", 0);
34
30
  }
35
31
  }
36
32
  _ts_decorate([
37
33
  ApiPropertyOptional({
38
- description: 'Number of items per page. Defaults to 10 when not provided or invalid.',
34
+ description: 'Number of items per page (default: 10)',
39
35
  example: 10
40
36
  }),
41
37
  IsOptional(),
@@ -48,7 +44,7 @@ _ts_decorate([
48
44
  ], PaginationDto.prototype, "pageSize", void 0);
49
45
  _ts_decorate([
50
46
  ApiPropertyOptional({
51
- description: 'Zero-based page index. Defaults to 0 when not provided or invalid.',
47
+ description: 'Zero-based page index (default: 0)',
52
48
  example: 0
53
49
  }),
54
50
  IsOptional(),
@@ -262,110 +262,3 @@ _ts_decorate([
262
262
  MessageResponseDto = _ts_decorate([
263
263
  ApiExtraModels()
264
264
  ], MessageResponseDto);
265
- export class ValidationErrorDto {
266
- constructor(){
267
- _define_property(this, "field", void 0);
268
- _define_property(this, "message", void 0);
269
- _define_property(this, "constraint", void 0);
270
- }
271
- }
272
- _ts_decorate([
273
- ApiProperty({
274
- example: 'email'
275
- }),
276
- _ts_metadata("design:type", String)
277
- ], ValidationErrorDto.prototype, "field", void 0);
278
- _ts_decorate([
279
- ApiProperty({
280
- example: 'Invalid email format'
281
- }),
282
- _ts_metadata("design:type", String)
283
- ], ValidationErrorDto.prototype, "message", void 0);
284
- _ts_decorate([
285
- ApiPropertyOptional({
286
- example: 'isEmail'
287
- }),
288
- _ts_metadata("design:type", String)
289
- ], ValidationErrorDto.prototype, "constraint", void 0);
290
- export class ErrorResponseDto {
291
- constructor(){
292
- _define_property(this, "success", void 0);
293
- _define_property(this, "message", void 0);
294
- _define_property(this, "code", void 0);
295
- _define_property(this, "errors", void 0);
296
- _define_property(this, "_meta", void 0);
297
- }
298
- }
299
- _ts_decorate([
300
- ApiProperty({
301
- example: false
302
- }),
303
- _ts_metadata("design:type", Boolean)
304
- ], ErrorResponseDto.prototype, "success", void 0);
305
- _ts_decorate([
306
- ApiProperty({
307
- example: 'Validation failed'
308
- }),
309
- _ts_metadata("design:type", String)
310
- ], ErrorResponseDto.prototype, "message", void 0);
311
- _ts_decorate([
312
- ApiPropertyOptional({
313
- example: 'VALIDATION_ERROR'
314
- }),
315
- _ts_metadata("design:type", String)
316
- ], ErrorResponseDto.prototype, "code", void 0);
317
- _ts_decorate([
318
- ApiPropertyOptional({
319
- type: [
320
- ValidationErrorDto
321
- ]
322
- }),
323
- _ts_metadata("design:type", Array)
324
- ], ErrorResponseDto.prototype, "errors", void 0);
325
- _ts_decorate([
326
- ApiPropertyOptional({
327
- type: RequestMetaDto
328
- }),
329
- _ts_metadata("design:type", typeof RequestMetaDto === "undefined" ? Object : RequestMetaDto)
330
- ], ErrorResponseDto.prototype, "_meta", void 0);
331
- ErrorResponseDto = _ts_decorate([
332
- ApiExtraModels()
333
- ], ErrorResponseDto);
334
- export class ResponsePayloadDto {
335
- constructor(){
336
- _define_property(this, "success", void 0);
337
- _define_property(this, "message", void 0);
338
- _define_property(this, "data", void 0);
339
- _define_property(this, "meta", void 0);
340
- _define_property(this, "_meta", void 0);
341
- }
342
- }
343
- _ts_decorate([
344
- ApiProperty({
345
- example: true
346
- }),
347
- _ts_metadata("design:type", Boolean)
348
- ], ResponsePayloadDto.prototype, "success", void 0);
349
- _ts_decorate([
350
- ApiProperty({
351
- example: 'Operation successful'
352
- }),
353
- _ts_metadata("design:type", String)
354
- ], ResponsePayloadDto.prototype, "message", void 0);
355
- _ts_decorate([
356
- ApiPropertyOptional(),
357
- _ts_metadata("design:type", typeof T === "undefined" ? Object : T)
358
- ], ResponsePayloadDto.prototype, "data", void 0);
359
- _ts_decorate([
360
- ApiPropertyOptional(),
361
- _ts_metadata("design:type", Object)
362
- ], ResponsePayloadDto.prototype, "meta", void 0);
363
- _ts_decorate([
364
- ApiPropertyOptional({
365
- type: RequestMetaDto
366
- }),
367
- _ts_metadata("design:type", typeof RequestMetaDto === "undefined" ? Object : RequestMetaDto)
368
- ], ResponsePayloadDto.prototype, "_meta", void 0);
369
- ResponsePayloadDto = _ts_decorate([
370
- ApiExtraModels()
371
- ], ResponsePayloadDto);
@@ -26,10 +26,10 @@ export class Identity {
26
26
  _define_property(this, "id", void 0);
27
27
  _define_property(this, "createdAt", void 0);
28
28
  _define_property(this, "updatedAt", void 0);
29
- _define_property(this, "deletedAt", void 0);
30
- _define_property(this, "createdById", void 0);
31
- _define_property(this, "updatedById", void 0);
32
- _define_property(this, "deletedById", void 0);
29
+ _define_property(this, "deletedAt", null);
30
+ _define_property(this, "createdById", null);
31
+ _define_property(this, "updatedById", null);
32
+ _define_property(this, "deletedById", null);
33
33
  }
34
34
  }
35
35
  _ts_decorate([
@@ -24,23 +24,22 @@ import { Column, CreateDateColumn, DeleteDateColumn, PrimaryGeneratedColumn, Upd
24
24
  export class UserRoot {
25
25
  constructor(){
26
26
  _define_property(this, "id", void 0);
27
- _define_property(this, "name", void 0);
28
- _define_property(this, "password", void 0);
27
+ _define_property(this, "name", null);
28
+ _define_property(this, "password", null);
29
29
  _define_property(this, "email", void 0);
30
- _define_property(this, "phone", void 0);
31
- _define_property(this, "isActive", void 0);
32
- _define_property(this, "emailVerified", void 0);
33
- _define_property(this, "phoneVerified", void 0);
34
- _define_property(this, "profilePictureId", void 0);
35
- _define_property(this, "lastLoginAt", void 0);
36
- _define_property(this, "additionalFields", void 0);
30
+ _define_property(this, "phone", null);
31
+ _define_property(this, "isActive", true);
32
+ _define_property(this, "emailVerified", false);
33
+ _define_property(this, "phoneVerified", false);
34
+ _define_property(this, "profilePictureId", null);
35
+ _define_property(this, "lastLoginAt", null);
36
+ _define_property(this, "additionalFields", null);
37
37
  _define_property(this, "createdAt", void 0);
38
38
  _define_property(this, "updatedAt", void 0);
39
- _define_property(this, "deletedAt", void 0);
40
- // Audit columns (for ApiService compatibility)
41
- _define_property(this, "createdById", void 0);
42
- _define_property(this, "updatedById", void 0);
43
- _define_property(this, "deletedById", void 0);
39
+ _define_property(this, "deletedAt", null);
40
+ _define_property(this, "createdById", null);
41
+ _define_property(this, "updatedById", null);
42
+ _define_property(this, "deletedById", null);
44
43
  }
45
44
  }
46
45
  _ts_decorate([