@flusys/nestjs-auth 5.1.1 → 5.1.2

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.
@@ -20,7 +20,9 @@ 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 { IdentityResponseDto } from '@flusys/nestjs-shared/dtos';
23
24
  import { ApiProperty, ApiPropertyOptional, PartialType } from '@nestjs/swagger';
25
+ import { Expose } from 'class-transformer';
24
26
  import { IsBoolean, IsEmail, IsNumber, IsObject, IsOptional, IsString } from 'class-validator';
25
27
  /**
26
28
  * Create Company DTO
@@ -40,6 +42,7 @@ import { IsBoolean, IsEmail, IsNumber, IsObject, IsOptional, IsString } from 'cl
40
42
  }
41
43
  }
42
44
  _ts_decorate([
45
+ Expose(),
43
46
  ApiProperty({
44
47
  example: 'Acme Corporation',
45
48
  description: 'Company name'
@@ -48,6 +51,7 @@ _ts_decorate([
48
51
  _ts_metadata("design:type", String)
49
52
  ], CreateCompanyDto.prototype, "name", void 0);
50
53
  _ts_decorate([
54
+ Expose(),
51
55
  ApiProperty({
52
56
  example: 'acme-corp',
53
57
  description: 'URL-friendly slug'
@@ -56,6 +60,7 @@ _ts_decorate([
56
60
  _ts_metadata("design:type", String)
57
61
  ], CreateCompanyDto.prototype, "slug", void 0);
58
62
  _ts_decorate([
63
+ Expose(),
59
64
  ApiPropertyOptional({
60
65
  example: 'logo_abc123',
61
66
  description: 'Logo file ID'
@@ -65,6 +70,7 @@ _ts_decorate([
65
70
  _ts_metadata("design:type", String)
66
71
  ], CreateCompanyDto.prototype, "logoId", void 0);
67
72
  _ts_decorate([
73
+ Expose(),
68
74
  ApiPropertyOptional({
69
75
  example: '123 Main St, New York, NY 10001',
70
76
  description: 'Company address'
@@ -74,6 +80,7 @@ _ts_decorate([
74
80
  _ts_metadata("design:type", String)
75
81
  ], CreateCompanyDto.prototype, "address", void 0);
76
82
  _ts_decorate([
83
+ Expose(),
77
84
  ApiPropertyOptional({
78
85
  example: '+1-555-123-4567',
79
86
  description: 'Contact phone number'
@@ -83,6 +90,7 @@ _ts_decorate([
83
90
  _ts_metadata("design:type", String)
84
91
  ], CreateCompanyDto.prototype, "phone", void 0);
85
92
  _ts_decorate([
93
+ Expose(),
86
94
  ApiPropertyOptional({
87
95
  example: 'contact@acme.com',
88
96
  description: 'Contact email address'
@@ -92,6 +100,7 @@ _ts_decorate([
92
100
  _ts_metadata("design:type", String)
93
101
  ], CreateCompanyDto.prototype, "email", void 0);
94
102
  _ts_decorate([
103
+ Expose(),
95
104
  ApiPropertyOptional({
96
105
  example: 'https://www.acme.com',
97
106
  description: 'Company website URL'
@@ -101,6 +110,7 @@ _ts_decorate([
101
110
  _ts_metadata("design:type", String)
102
111
  ], CreateCompanyDto.prototype, "website", void 0);
103
112
  _ts_decorate([
113
+ Expose(),
104
114
  ApiPropertyOptional({
105
115
  example: 1,
106
116
  description: 'Sort order'
@@ -110,6 +120,7 @@ _ts_decorate([
110
120
  _ts_metadata("design:type", Number)
111
121
  ], CreateCompanyDto.prototype, "serial", void 0);
112
122
  _ts_decorate([
123
+ Expose(),
113
124
  ApiPropertyOptional({
114
125
  example: true,
115
126
  default: true,
@@ -120,6 +131,7 @@ _ts_decorate([
120
131
  _ts_metadata("design:type", Boolean)
121
132
  ], CreateCompanyDto.prototype, "isActive", void 0);
122
133
  _ts_decorate([
134
+ Expose(),
123
135
  ApiPropertyOptional({
124
136
  example: {
125
137
  theme: 'dark',
@@ -132,6 +144,7 @@ _ts_decorate([
132
144
  _ts_metadata("design:type", typeof Record === "undefined" ? Object : Record)
133
145
  ], CreateCompanyDto.prototype, "settings", void 0);
134
146
  _ts_decorate([
147
+ Expose(),
135
148
  ApiPropertyOptional({
136
149
  example: {
137
150
  industry: 'Technology',
@@ -151,6 +164,7 @@ _ts_decorate([
151
164
  }
152
165
  }
153
166
  _ts_decorate([
167
+ Expose(),
154
168
  ApiProperty({
155
169
  example: '550e8400-e29b-41d4-a716-446655440001',
156
170
  description: 'Company ID'
@@ -160,12 +174,91 @@ _ts_decorate([
160
174
  ], UpdateCompanyDto.prototype, "id", void 0);
161
175
  /**
162
176
  * Company Response DTO
163
- */ export class CompanyResponseDto extends UpdateCompanyDto {
177
+ */ export class CompanyResponseDto extends IdentityResponseDto {
164
178
  constructor(...args){
165
- super(...args), _define_property(this, "readOnly", void 0), _define_property(this, "createdAt", void 0), _define_property(this, "updatedAt", void 0);
179
+ super(...args), _define_property(this, "name", void 0), _define_property(this, "slug", void 0), _define_property(this, "logoId", void 0), _define_property(this, "address", void 0), _define_property(this, "phone", void 0), _define_property(this, "email", void 0), _define_property(this, "website", void 0), _define_property(this, "serial", void 0), _define_property(this, "isActive", void 0), _define_property(this, "readOnly", void 0), _define_property(this, "settings", void 0), _define_property(this, "additionalFields", void 0);
166
180
  }
167
181
  }
168
182
  _ts_decorate([
183
+ Expose(),
184
+ ApiProperty({
185
+ example: 'Acme Corporation',
186
+ description: 'Company name'
187
+ }),
188
+ _ts_metadata("design:type", String)
189
+ ], CompanyResponseDto.prototype, "name", void 0);
190
+ _ts_decorate([
191
+ Expose(),
192
+ ApiProperty({
193
+ example: 'acme-corp',
194
+ description: 'URL-friendly slug'
195
+ }),
196
+ _ts_metadata("design:type", String)
197
+ ], CompanyResponseDto.prototype, "slug", void 0);
198
+ _ts_decorate([
199
+ Expose(),
200
+ ApiPropertyOptional({
201
+ example: 'logo_abc123',
202
+ description: 'Logo file ID',
203
+ nullable: true
204
+ }),
205
+ _ts_metadata("design:type", Object)
206
+ ], CompanyResponseDto.prototype, "logoId", void 0);
207
+ _ts_decorate([
208
+ Expose(),
209
+ ApiPropertyOptional({
210
+ example: '123 Main St, New York, NY 10001',
211
+ description: 'Company address',
212
+ nullable: true
213
+ }),
214
+ _ts_metadata("design:type", Object)
215
+ ], CompanyResponseDto.prototype, "address", void 0);
216
+ _ts_decorate([
217
+ Expose(),
218
+ ApiPropertyOptional({
219
+ example: '+1-555-123-4567',
220
+ description: 'Contact phone number',
221
+ nullable: true
222
+ }),
223
+ _ts_metadata("design:type", Object)
224
+ ], CompanyResponseDto.prototype, "phone", void 0);
225
+ _ts_decorate([
226
+ Expose(),
227
+ ApiPropertyOptional({
228
+ example: 'contact@acme.com',
229
+ description: 'Contact email address',
230
+ nullable: true
231
+ }),
232
+ _ts_metadata("design:type", Object)
233
+ ], CompanyResponseDto.prototype, "email", void 0);
234
+ _ts_decorate([
235
+ Expose(),
236
+ ApiPropertyOptional({
237
+ example: 'https://www.acme.com',
238
+ description: 'Company website URL',
239
+ nullable: true
240
+ }),
241
+ _ts_metadata("design:type", Object)
242
+ ], CompanyResponseDto.prototype, "website", void 0);
243
+ _ts_decorate([
244
+ Expose(),
245
+ ApiPropertyOptional({
246
+ example: 1,
247
+ description: 'Sort order',
248
+ nullable: true
249
+ }),
250
+ _ts_metadata("design:type", Object)
251
+ ], CompanyResponseDto.prototype, "serial", void 0);
252
+ _ts_decorate([
253
+ Expose(),
254
+ ApiProperty({
255
+ example: true,
256
+ description: 'Is company active'
257
+ }),
258
+ _ts_metadata("design:type", Boolean)
259
+ ], CompanyResponseDto.prototype, "isActive", void 0);
260
+ _ts_decorate([
261
+ Expose(),
169
262
  ApiProperty({
170
263
  example: false,
171
264
  description: 'Is read-only'
@@ -173,16 +266,18 @@ _ts_decorate([
173
266
  _ts_metadata("design:type", Boolean)
174
267
  ], CompanyResponseDto.prototype, "readOnly", void 0);
175
268
  _ts_decorate([
176
- ApiProperty({
177
- example: '2024-01-15T10:30:00.000Z',
178
- description: 'Creation timestamp'
269
+ Expose(),
270
+ ApiPropertyOptional({
271
+ description: 'Company settings',
272
+ nullable: true
179
273
  }),
180
- _ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
181
- ], CompanyResponseDto.prototype, "createdAt", void 0);
274
+ _ts_metadata("design:type", Object)
275
+ ], CompanyResponseDto.prototype, "settings", void 0);
182
276
  _ts_decorate([
183
- ApiProperty({
184
- example: '2024-12-18T14:45:00.000Z',
185
- description: 'Last update timestamp'
277
+ Expose(),
278
+ ApiPropertyOptional({
279
+ description: 'Additional custom fields',
280
+ nullable: true
186
281
  }),
187
- _ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
188
- ], CompanyResponseDto.prototype, "updatedAt", void 0);
282
+ _ts_metadata("design:type", Object)
283
+ ], CompanyResponseDto.prototype, "additionalFields", void 0);
@@ -21,6 +21,7 @@ function _ts_metadata(k, v) {
21
21
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
22
22
  }
23
23
  import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
24
+ import { Expose } from 'class-transformer';
24
25
  import { IsBoolean, IsEmail, IsNotEmpty, IsObject, IsOptional, IsString, IsUUID, MaxLength } from 'class-validator';
25
26
  import { IsStrongPassword } from '../validators/password.validator';
26
27
  export class CreateUserDto {
@@ -37,6 +38,7 @@ export class CreateUserDto {
37
38
  }
38
39
  }
39
40
  _ts_decorate([
41
+ Expose(),
40
42
  ApiProperty({
41
43
  example: 'John Doe',
42
44
  description: 'Full name'
@@ -45,6 +47,7 @@ _ts_decorate([
45
47
  _ts_metadata("design:type", String)
46
48
  ], CreateUserDto.prototype, "name", void 0);
47
49
  _ts_decorate([
50
+ Expose(),
48
51
  ApiPropertyOptional({
49
52
  example: '+1234567890',
50
53
  description: 'Phone number'
@@ -54,6 +57,7 @@ _ts_decorate([
54
57
  _ts_metadata("design:type", String)
55
58
  ], CreateUserDto.prototype, "phone", void 0);
56
59
  _ts_decorate([
60
+ Expose(),
57
61
  ApiProperty({
58
62
  example: 'john@example.com',
59
63
  description: 'Email address'
@@ -62,6 +66,7 @@ _ts_decorate([
62
66
  _ts_metadata("design:type", String)
63
67
  ], CreateUserDto.prototype, "email", void 0);
64
68
  _ts_decorate([
69
+ Expose(),
65
70
  ApiProperty({
66
71
  example: 'SecureP@ss123',
67
72
  description: 'Password (must meet complexity requirements)'
@@ -73,6 +78,7 @@ _ts_decorate([
73
78
  _ts_metadata("design:type", String)
74
79
  ], CreateUserDto.prototype, "password", void 0);
75
80
  _ts_decorate([
81
+ Expose(),
76
82
  ApiPropertyOptional({
77
83
  description: 'Profile picture file ID'
78
84
  }),
@@ -81,6 +87,7 @@ _ts_decorate([
81
87
  _ts_metadata("design:type", String)
82
88
  ], CreateUserDto.prototype, "profilePictureId", void 0);
83
89
  _ts_decorate([
90
+ Expose(),
84
91
  ApiPropertyOptional({
85
92
  default: true,
86
93
  description: 'Is user active'
@@ -90,6 +97,7 @@ _ts_decorate([
90
97
  _ts_metadata("design:type", Boolean)
91
98
  ], CreateUserDto.prototype, "isActive", void 0);
92
99
  _ts_decorate([
100
+ Expose(),
93
101
  ApiPropertyOptional({
94
102
  default: false,
95
103
  description: 'Is email verified'
@@ -99,6 +107,7 @@ _ts_decorate([
99
107
  _ts_metadata("design:type", Boolean)
100
108
  ], CreateUserDto.prototype, "emailVerified", void 0);
101
109
  _ts_decorate([
110
+ Expose(),
102
111
  ApiPropertyOptional({
103
112
  default: false,
104
113
  description: 'Is phone verified'
@@ -108,6 +117,7 @@ _ts_decorate([
108
117
  _ts_metadata("design:type", Boolean)
109
118
  ], CreateUserDto.prototype, "phoneVerified", void 0);
110
119
  _ts_decorate([
120
+ Expose(),
111
121
  ApiPropertyOptional({
112
122
  description: 'Additional custom fields'
113
123
  }),
@@ -131,6 +141,7 @@ export class UpdateUserDto {
131
141
  }
132
142
  }
133
143
  _ts_decorate([
144
+ Expose(),
134
145
  ApiProperty({
135
146
  description: 'User ID'
136
147
  }),
@@ -138,6 +149,7 @@ _ts_decorate([
138
149
  _ts_metadata("design:type", String)
139
150
  ], UpdateUserDto.prototype, "id", void 0);
140
151
  _ts_decorate([
152
+ Expose(),
141
153
  ApiPropertyOptional({
142
154
  example: 'John Doe',
143
155
  description: 'Full name'
@@ -147,6 +159,7 @@ _ts_decorate([
147
159
  _ts_metadata("design:type", String)
148
160
  ], UpdateUserDto.prototype, "name", void 0);
149
161
  _ts_decorate([
162
+ Expose(),
150
163
  ApiPropertyOptional({
151
164
  example: '+1234567890',
152
165
  description: 'Phone number'
@@ -156,6 +169,7 @@ _ts_decorate([
156
169
  _ts_metadata("design:type", String)
157
170
  ], UpdateUserDto.prototype, "phone", void 0);
158
171
  _ts_decorate([
172
+ Expose(),
159
173
  ApiPropertyOptional({
160
174
  example: 'john@example.com',
161
175
  description: 'Email address'
@@ -165,6 +179,7 @@ _ts_decorate([
165
179
  _ts_metadata("design:type", String)
166
180
  ], UpdateUserDto.prototype, "email", void 0);
167
181
  _ts_decorate([
182
+ Expose(),
168
183
  ApiPropertyOptional({
169
184
  description: 'New password (must meet complexity requirements)'
170
185
  }),
@@ -175,6 +190,7 @@ _ts_decorate([
175
190
  _ts_metadata("design:type", String)
176
191
  ], UpdateUserDto.prototype, "password", void 0);
177
192
  _ts_decorate([
193
+ Expose(),
178
194
  ApiPropertyOptional({
179
195
  description: 'Current password (required when changing password on own profile)'
180
196
  }),
@@ -183,6 +199,7 @@ _ts_decorate([
183
199
  _ts_metadata("design:type", String)
184
200
  ], UpdateUserDto.prototype, "oldPassword", void 0);
185
201
  _ts_decorate([
202
+ Expose(),
186
203
  ApiPropertyOptional({
187
204
  description: 'Profile picture file ID'
188
205
  }),
@@ -191,6 +208,7 @@ _ts_decorate([
191
208
  _ts_metadata("design:type", String)
192
209
  ], UpdateUserDto.prototype, "profilePictureId", void 0);
193
210
  _ts_decorate([
211
+ Expose(),
194
212
  ApiPropertyOptional({
195
213
  description: 'Is user active'
196
214
  }),
@@ -199,6 +217,7 @@ _ts_decorate([
199
217
  _ts_metadata("design:type", Boolean)
200
218
  ], UpdateUserDto.prototype, "isActive", void 0);
201
219
  _ts_decorate([
220
+ Expose(),
202
221
  ApiPropertyOptional({
203
222
  description: 'Is email verified'
204
223
  }),
@@ -207,6 +226,7 @@ _ts_decorate([
207
226
  _ts_metadata("design:type", Boolean)
208
227
  ], UpdateUserDto.prototype, "emailVerified", void 0);
209
228
  _ts_decorate([
229
+ Expose(),
210
230
  ApiPropertyOptional({
211
231
  description: 'Is phone verified'
212
232
  }),
@@ -215,6 +235,7 @@ _ts_decorate([
215
235
  _ts_metadata("design:type", Boolean)
216
236
  ], UpdateUserDto.prototype, "phoneVerified", void 0);
217
237
  _ts_decorate([
238
+ Expose(),
218
239
  ApiPropertyOptional({
219
240
  description: 'Additional custom fields'
220
241
  }),
@@ -242,18 +263,21 @@ _ts_decorate([
242
263
  }
243
264
  }
244
265
  _ts_decorate([
266
+ Expose(),
245
267
  ApiProperty({
246
268
  example: '550e8400-e29b-41d4-a716-446655440000'
247
269
  }),
248
270
  _ts_metadata("design:type", String)
249
271
  ], UserResponseDto.prototype, "id", void 0);
250
272
  _ts_decorate([
273
+ Expose(),
251
274
  ApiProperty({
252
275
  example: 'John Doe'
253
276
  }),
254
277
  _ts_metadata("design:type", String)
255
278
  ], UserResponseDto.prototype, "name", void 0);
256
279
  _ts_decorate([
280
+ Expose(),
257
281
  ApiPropertyOptional({
258
282
  example: '+1-555-123-4567',
259
283
  nullable: true
@@ -261,12 +285,14 @@ _ts_decorate([
261
285
  _ts_metadata("design:type", Object)
262
286
  ], UserResponseDto.prototype, "phone", void 0);
263
287
  _ts_decorate([
288
+ Expose(),
264
289
  ApiProperty({
265
290
  example: 'john@example.com'
266
291
  }),
267
292
  _ts_metadata("design:type", String)
268
293
  ], UserResponseDto.prototype, "email", void 0);
269
294
  _ts_decorate([
295
+ Expose(),
270
296
  ApiPropertyOptional({
271
297
  example: 'pic_abc123',
272
298
  nullable: true
@@ -274,24 +300,28 @@ _ts_decorate([
274
300
  _ts_metadata("design:type", Object)
275
301
  ], UserResponseDto.prototype, "profilePictureId", void 0);
276
302
  _ts_decorate([
303
+ Expose(),
277
304
  ApiProperty({
278
305
  example: true
279
306
  }),
280
307
  _ts_metadata("design:type", Boolean)
281
308
  ], UserResponseDto.prototype, "isActive", void 0);
282
309
  _ts_decorate([
310
+ Expose(),
283
311
  ApiProperty({
284
312
  example: true
285
313
  }),
286
314
  _ts_metadata("design:type", Boolean)
287
315
  ], UserResponseDto.prototype, "emailVerified", void 0);
288
316
  _ts_decorate([
317
+ Expose(),
289
318
  ApiProperty({
290
319
  example: false
291
320
  }),
292
321
  _ts_metadata("design:type", Boolean)
293
322
  ], UserResponseDto.prototype, "phoneVerified", void 0);
294
323
  _ts_decorate([
324
+ Expose(),
295
325
  ApiPropertyOptional({
296
326
  example: '2024-12-18T10:30:00.000Z',
297
327
  nullable: true
@@ -299,6 +329,7 @@ _ts_decorate([
299
329
  _ts_metadata("design:type", Object)
300
330
  ], UserResponseDto.prototype, "lastLoginAt", void 0);
301
331
  _ts_decorate([
332
+ Expose(),
302
333
  ApiPropertyOptional({
303
334
  example: {
304
335
  department: 'Engineering',
@@ -309,18 +340,21 @@ _ts_decorate([
309
340
  _ts_metadata("design:type", Object)
310
341
  ], UserResponseDto.prototype, "additionalFields", void 0);
311
342
  _ts_decorate([
343
+ Expose(),
312
344
  ApiProperty({
313
345
  example: '2024-01-15T10:30:00.000Z'
314
346
  }),
315
347
  _ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
316
348
  ], UserResponseDto.prototype, "createdAt", void 0);
317
349
  _ts_decorate([
350
+ Expose(),
318
351
  ApiProperty({
319
352
  example: '2024-12-18T14:45:00.000Z'
320
353
  }),
321
354
  _ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
322
355
  ], UserResponseDto.prototype, "updatedAt", void 0);
323
356
  _ts_decorate([
357
+ Expose(),
324
358
  ApiPropertyOptional({
325
359
  example: null,
326
360
  nullable: true
@@ -46,6 +46,8 @@ export class BranchService extends RequestScopedApiService {
46
46
  'id',
47
47
  'name',
48
48
  'slug',
49
+ 'email',
50
+ 'phone',
49
51
  'isActive',
50
52
  'createdAt'
51
53
  ];
@@ -44,6 +44,8 @@ export class CompanyService extends RequestScopedApiService {
44
44
  'id',
45
45
  'name',
46
46
  'slug',
47
+ 'email',
48
+ 'phone',
47
49
  'isActive',
48
50
  'createdAt'
49
51
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flusys/nestjs-auth",
3
- "version": "5.1.1",
3
+ "version": "5.1.2",
4
4
  "description": "Authentication and authorization infrastructure for NestJS applications",
5
5
  "main": "cjs/index.js",
6
6
  "module": "fesm/index.js",
@@ -93,7 +93,7 @@
93
93
  "rxjs": "^7.8.0"
94
94
  },
95
95
  "dependencies": {
96
- "@flusys/nestjs-core": "5.1.1",
97
- "@flusys/nestjs-shared": "5.1.1"
96
+ "@flusys/nestjs-core": "5.1.2",
97
+ "@flusys/nestjs-shared": "5.1.2"
98
98
  }
99
99
  }