@flusys/nestjs-auth 5.1.1 → 5.1.3

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, IsUUID } from 'class-validator';
25
27
  /**
26
28
  * Create Company Branch DTO
@@ -40,6 +42,7 @@ import { IsBoolean, IsEmail, IsNumber, IsObject, IsOptional, IsString, IsUUID }
40
42
  }
41
43
  }
42
44
  _ts_decorate([
45
+ Expose(),
43
46
  ApiProperty({
44
47
  example: 'Main Branch',
45
48
  description: 'Branch name'
@@ -48,6 +51,7 @@ _ts_decorate([
48
51
  _ts_metadata("design:type", String)
49
52
  ], CreateCompanyBranchDto.prototype, "name", void 0);
50
53
  _ts_decorate([
54
+ Expose(),
51
55
  ApiProperty({
52
56
  example: 'main-branch',
53
57
  description: 'URL-friendly slug'
@@ -56,6 +60,7 @@ _ts_decorate([
56
60
  _ts_metadata("design:type", String)
57
61
  ], CreateCompanyBranchDto.prototype, "slug", void 0);
58
62
  _ts_decorate([
63
+ Expose(),
59
64
  ApiProperty({
60
65
  example: '550e8400-e29b-41d4-a716-446655440001',
61
66
  description: 'Parent company ID'
@@ -64,6 +69,7 @@ _ts_decorate([
64
69
  _ts_metadata("design:type", String)
65
70
  ], CreateCompanyBranchDto.prototype, "companyId", void 0);
66
71
  _ts_decorate([
72
+ Expose(),
67
73
  ApiPropertyOptional({
68
74
  example: '550e8400-e29b-41d4-a716-446655440003',
69
75
  description: 'Parent branch ID (for hierarchical branches)'
@@ -73,6 +79,7 @@ _ts_decorate([
73
79
  _ts_metadata("design:type", String)
74
80
  ], CreateCompanyBranchDto.prototype, "parentId", void 0);
75
81
  _ts_decorate([
82
+ Expose(),
76
83
  ApiPropertyOptional({
77
84
  example: 'logo_xyz789',
78
85
  description: 'Branch logo file ID'
@@ -82,6 +89,7 @@ _ts_decorate([
82
89
  _ts_metadata("design:type", String)
83
90
  ], CreateCompanyBranchDto.prototype, "logoId", void 0);
84
91
  _ts_decorate([
92
+ Expose(),
85
93
  ApiPropertyOptional({
86
94
  example: '456 Oak Ave, Los Angeles, CA 90001',
87
95
  description: 'Branch address'
@@ -91,6 +99,7 @@ _ts_decorate([
91
99
  _ts_metadata("design:type", String)
92
100
  ], CreateCompanyBranchDto.prototype, "address", void 0);
93
101
  _ts_decorate([
102
+ Expose(),
94
103
  ApiPropertyOptional({
95
104
  example: '+1-555-987-6543',
96
105
  description: 'Branch phone number'
@@ -100,6 +109,7 @@ _ts_decorate([
100
109
  _ts_metadata("design:type", String)
101
110
  ], CreateCompanyBranchDto.prototype, "phone", void 0);
102
111
  _ts_decorate([
112
+ Expose(),
103
113
  ApiPropertyOptional({
104
114
  example: 'branch@acme.com',
105
115
  description: 'Branch email address'
@@ -109,6 +119,7 @@ _ts_decorate([
109
119
  _ts_metadata("design:type", String)
110
120
  ], CreateCompanyBranchDto.prototype, "email", void 0);
111
121
  _ts_decorate([
122
+ Expose(),
112
123
  ApiPropertyOptional({
113
124
  example: 1,
114
125
  description: 'Sort order'
@@ -118,6 +129,7 @@ _ts_decorate([
118
129
  _ts_metadata("design:type", Number)
119
130
  ], CreateCompanyBranchDto.prototype, "serial", void 0);
120
131
  _ts_decorate([
132
+ Expose(),
121
133
  ApiPropertyOptional({
122
134
  example: true,
123
135
  default: true,
@@ -128,6 +140,7 @@ _ts_decorate([
128
140
  _ts_metadata("design:type", Boolean)
129
141
  ], CreateCompanyBranchDto.prototype, "isActive", void 0);
130
142
  _ts_decorate([
143
+ Expose(),
131
144
  ApiPropertyOptional({
132
145
  example: {
133
146
  timezone: 'America/Los_Angeles',
@@ -147,6 +160,7 @@ _ts_decorate([
147
160
  }
148
161
  }
149
162
  _ts_decorate([
163
+ Expose(),
150
164
  ApiProperty({
151
165
  example: '550e8400-e29b-41d4-a716-446655440002',
152
166
  description: 'Branch ID'
@@ -156,29 +170,110 @@ _ts_decorate([
156
170
  ], UpdateCompanyBranchDto.prototype, "id", void 0);
157
171
  /**
158
172
  * Company Branch Response DTO
159
- */ export class CompanyBranchResponseDto extends UpdateCompanyBranchDto {
173
+ */ export class CompanyBranchResponseDto extends IdentityResponseDto {
160
174
  constructor(...args){
161
- super(...args), _define_property(this, "readOnly", void 0), _define_property(this, "createdAt", void 0), _define_property(this, "updatedAt", void 0);
175
+ super(...args), _define_property(this, "name", void 0), _define_property(this, "slug", void 0), _define_property(this, "companyId", void 0), _define_property(this, "parentId", 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, "serial", void 0), _define_property(this, "isActive", void 0), _define_property(this, "readOnly", void 0), _define_property(this, "additionalFields", void 0);
162
176
  }
163
177
  }
164
178
  _ts_decorate([
179
+ Expose(),
165
180
  ApiProperty({
166
- example: false,
167
- description: 'Is read-only'
181
+ example: 'Main Branch',
182
+ description: 'Branch name'
168
183
  }),
169
- _ts_metadata("design:type", Boolean)
170
- ], CompanyBranchResponseDto.prototype, "readOnly", void 0);
184
+ _ts_metadata("design:type", String)
185
+ ], CompanyBranchResponseDto.prototype, "name", void 0);
171
186
  _ts_decorate([
187
+ Expose(),
172
188
  ApiProperty({
173
- example: '2024-01-15T10:30:00.000Z',
174
- description: 'Creation timestamp'
189
+ example: 'main-branch',
190
+ description: 'URL-friendly slug'
175
191
  }),
176
- _ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
177
- ], CompanyBranchResponseDto.prototype, "createdAt", void 0);
192
+ _ts_metadata("design:type", String)
193
+ ], CompanyBranchResponseDto.prototype, "slug", void 0);
178
194
  _ts_decorate([
195
+ Expose(),
179
196
  ApiProperty({
180
- example: '2024-12-18T14:45:00.000Z',
181
- description: 'Last update timestamp'
197
+ example: '550e8400-e29b-41d4-a716-446655440001',
198
+ description: 'Parent company ID'
199
+ }),
200
+ _ts_metadata("design:type", String)
201
+ ], CompanyBranchResponseDto.prototype, "companyId", void 0);
202
+ _ts_decorate([
203
+ Expose(),
204
+ ApiPropertyOptional({
205
+ example: '550e8400-e29b-41d4-a716-446655440003',
206
+ description: 'Parent branch ID',
207
+ nullable: true
208
+ }),
209
+ _ts_metadata("design:type", Object)
210
+ ], CompanyBranchResponseDto.prototype, "parentId", void 0);
211
+ _ts_decorate([
212
+ Expose(),
213
+ ApiPropertyOptional({
214
+ example: 'logo_xyz789',
215
+ description: 'Branch logo file ID',
216
+ nullable: true
217
+ }),
218
+ _ts_metadata("design:type", Object)
219
+ ], CompanyBranchResponseDto.prototype, "logoId", void 0);
220
+ _ts_decorate([
221
+ Expose(),
222
+ ApiPropertyOptional({
223
+ example: '456 Oak Ave, Los Angeles, CA 90001',
224
+ description: 'Branch address',
225
+ nullable: true
226
+ }),
227
+ _ts_metadata("design:type", Object)
228
+ ], CompanyBranchResponseDto.prototype, "address", void 0);
229
+ _ts_decorate([
230
+ Expose(),
231
+ ApiPropertyOptional({
232
+ example: '+1-555-987-6543',
233
+ description: 'Branch phone number',
234
+ nullable: true
235
+ }),
236
+ _ts_metadata("design:type", Object)
237
+ ], CompanyBranchResponseDto.prototype, "phone", void 0);
238
+ _ts_decorate([
239
+ Expose(),
240
+ ApiPropertyOptional({
241
+ example: 'branch@acme.com',
242
+ description: 'Branch email address',
243
+ nullable: true
244
+ }),
245
+ _ts_metadata("design:type", Object)
246
+ ], CompanyBranchResponseDto.prototype, "email", void 0);
247
+ _ts_decorate([
248
+ Expose(),
249
+ ApiPropertyOptional({
250
+ example: 1,
251
+ description: 'Sort order',
252
+ nullable: true
253
+ }),
254
+ _ts_metadata("design:type", Object)
255
+ ], CompanyBranchResponseDto.prototype, "serial", void 0);
256
+ _ts_decorate([
257
+ Expose(),
258
+ ApiProperty({
259
+ example: true,
260
+ description: 'Is branch active'
261
+ }),
262
+ _ts_metadata("design:type", Boolean)
263
+ ], CompanyBranchResponseDto.prototype, "isActive", void 0);
264
+ _ts_decorate([
265
+ Expose(),
266
+ ApiProperty({
267
+ example: false,
268
+ description: 'Is read-only'
269
+ }),
270
+ _ts_metadata("design:type", Boolean)
271
+ ], CompanyBranchResponseDto.prototype, "readOnly", void 0);
272
+ _ts_decorate([
273
+ Expose(),
274
+ ApiPropertyOptional({
275
+ description: 'Additional custom fields',
276
+ nullable: true
182
277
  }),
183
- _ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
184
- ], CompanyBranchResponseDto.prototype, "updatedAt", void 0);
278
+ _ts_metadata("design:type", Object)
279
+ ], CompanyBranchResponseDto.prototype, "additionalFields", void 0);
@@ -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);