@flusys/nestjs-form-builder 7.1.0 → 8.0.0-beta.1
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.
- package/config/index.d.ts +3 -3
- package/controllers/form-result.controller.d.ts +3 -3
- package/controllers/form.controller.d.ts +3 -3
- package/controllers/index.d.ts +2 -2
- package/docs/form-builder-swagger.config.d.ts +2 -2
- package/docs/index.d.ts +1 -1
- package/dtos/form.dto.d.ts +1 -1
- package/dtos/index.d.ts +2 -2
- package/entities/form-with-company.entity.d.ts +1 -1
- package/entities/form.entity.d.ts +1 -1
- package/entities/index.d.ts +7 -7
- package/enums/index.d.ts +1 -1
- package/fesm/262.js +1841 -0
- package/fesm/98.js +807 -0
- package/fesm/config/index.js +98 -3
- package/fesm/controllers/index.js +14 -2
- package/fesm/docs/index.js +171 -1
- package/fesm/dtos/index.js +571 -2
- package/fesm/entities/index.js +342 -10
- package/fesm/enums/index.js +38 -1
- package/fesm/index.js +482 -10
- package/fesm/interfaces/index.js +17 -3
- package/fesm/modules/index.js +178 -1
- package/fesm/runtime.js +85 -0
- package/fesm/services/index.js +35 -4
- package/index.d.ts +10 -10
- package/interfaces/form-builder-module.interface.d.ts +3 -3
- package/interfaces/form-result.interface.d.ts +1 -1
- package/interfaces/form.interface.d.ts +2 -2
- package/interfaces/index.d.ts +3 -3
- package/modules/form-builder.module.d.ts +2 -2
- package/modules/index.d.ts +1 -1
- package/package.json +26 -36
- package/services/form-builder-config.service.d.ts +4 -4
- package/services/form-builder-datasource.provider.d.ts +3 -3
- package/services/form-result.service.d.ts +6 -6
- package/services/form.service.d.ts +7 -7
- package/services/index.d.ts +4 -4
- package/utils/index.d.ts +2 -2
- package/utils/permission.utils.d.ts +1 -1
- package/cjs/config/event-actions.js +0 -33
- package/cjs/config/form-builder.constants.js +0 -13
- package/cjs/config/index.js +0 -20
- package/cjs/config/message-keys.js +0 -38
- package/cjs/controllers/form-result.controller.js +0 -281
- package/cjs/controllers/form-result.controller.spec.js +0 -257
- package/cjs/controllers/form.controller.js +0 -231
- package/cjs/controllers/form.controller.spec.js +0 -212
- package/cjs/controllers/index.js +0 -19
- package/cjs/docs/form-builder-swagger.config.js +0 -150
- package/cjs/docs/form-builder-swagger.config.spec.js +0 -75
- package/cjs/docs/index.js +0 -11
- package/cjs/dtos/form-result.dto.js +0 -248
- package/cjs/dtos/form.dto.js +0 -270
- package/cjs/dtos/index.js +0 -19
- package/cjs/entities/form-result.entity.js +0 -100
- package/cjs/entities/form-with-company.entity.js +0 -65
- package/cjs/entities/form.entity.js +0 -127
- package/cjs/entities/index.js +0 -52
- package/cjs/entities/index.spec.js +0 -18
- package/cjs/enums/form-access-type.enum.js +0 -19
- package/cjs/enums/index.js +0 -18
- package/cjs/index.js +0 -28
- package/cjs/interfaces/form-builder-module.interface.js +0 -4
- package/cjs/interfaces/form-result.interface.js +0 -4
- package/cjs/interfaces/form.interface.js +0 -4
- package/cjs/interfaces/index.js +0 -20
- package/cjs/modules/form-builder.module.js +0 -136
- package/cjs/modules/form-builder.module.spec.js +0 -133
- package/cjs/modules/index.js +0 -18
- package/cjs/services/form-builder-config.service.js +0 -69
- package/cjs/services/form-builder-config.service.spec.js +0 -121
- package/cjs/services/form-builder-datasource.provider.js +0 -125
- package/cjs/services/form-builder-datasource.provider.spec.js +0 -147
- package/cjs/services/form-result.service.js +0 -366
- package/cjs/services/form-result.service.spec.js +0 -823
- package/cjs/services/form.service.js +0 -341
- package/cjs/services/form.service.spec.js +0 -746
- package/cjs/services/index.js +0 -21
- package/cjs/utils/computed-field.utils.js +0 -199
- package/cjs/utils/computed-field.utils.spec.js +0 -1205
- package/cjs/utils/index.js +0 -19
- package/cjs/utils/permission.utils.js +0 -44
- package/cjs/utils/permission.utils.spec.js +0 -118
- package/fesm/config/event-actions.js +0 -12
- package/fesm/config/form-builder.constants.js +0 -3
- package/fesm/config/message-keys.js +0 -20
- package/fesm/controllers/form-result.controller.js +0 -271
- package/fesm/controllers/form-result.controller.spec.js +0 -253
- package/fesm/controllers/form.controller.js +0 -221
- package/fesm/controllers/form.controller.spec.js +0 -208
- package/fesm/docs/form-builder-swagger.config.js +0 -146
- package/fesm/docs/form-builder-swagger.config.spec.js +0 -71
- package/fesm/dtos/form-result.dto.js +0 -215
- package/fesm/dtos/form.dto.js +0 -243
- package/fesm/entities/form-result.entity.js +0 -90
- package/fesm/entities/form-with-company.entity.js +0 -55
- package/fesm/entities/form.entity.js +0 -117
- package/fesm/entities/index.spec.js +0 -14
- package/fesm/enums/form-access-type.enum.js +0 -9
- package/fesm/interfaces/form-builder-module.interface.js +0 -3
- package/fesm/interfaces/form-result.interface.js +0 -6
- package/fesm/interfaces/form.interface.js +0 -3
- package/fesm/modules/form-builder.module.js +0 -126
- package/fesm/modules/form-builder.module.spec.js +0 -129
- package/fesm/services/form-builder-config.service.js +0 -59
- package/fesm/services/form-builder-config.service.spec.js +0 -117
- package/fesm/services/form-builder-datasource.provider.js +0 -74
- package/fesm/services/form-builder-datasource.provider.spec.js +0 -143
- package/fesm/services/form-result.service.js +0 -356
- package/fesm/services/form-result.service.spec.js +0 -778
- package/fesm/services/form.service.js +0 -331
- package/fesm/services/form.service.spec.js +0 -701
- package/fesm/utils/computed-field.utils.js +0 -195
- package/fesm/utils/computed-field.utils.spec.js +0 -1201
- package/fesm/utils/index.js +0 -2
- package/fesm/utils/permission.utils.js +0 -42
- package/fesm/utils/permission.utils.spec.js +0 -114
package/fesm/98.js
ADDED
|
@@ -0,0 +1,807 @@
|
|
|
1
|
+
import { JwtAuthGuard, PermissionGuard } from "@flusys/nestjs-shared/guards";
|
|
2
|
+
export const __rspack_esm_id = 98;
|
|
3
|
+
export const __rspack_esm_ids = [98];
|
|
4
|
+
export const __webpack_modules__ = {
|
|
5
|
+
585(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
6
|
+
|
|
7
|
+
// EXPORTS
|
|
8
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
9
|
+
X: () => (/* reexport */ FormController),
|
|
10
|
+
Y: () => (/* reexport */ FormResultController)
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
// EXTERNAL MODULE: external "@flusys/nestjs-shared/classes"
|
|
14
|
+
var classes_ = __webpack_require__(937);
|
|
15
|
+
// EXTERNAL MODULE: external "@flusys/nestjs-shared/decorators"
|
|
16
|
+
var decorators_ = __webpack_require__(265);
|
|
17
|
+
;// CONCATENATED MODULE: external "@flusys/nestjs-shared/guards"
|
|
18
|
+
|
|
19
|
+
// EXTERNAL MODULE: external "@nestjs/common"
|
|
20
|
+
var common_ = __webpack_require__(157);
|
|
21
|
+
// EXTERNAL MODULE: external "@nestjs/swagger"
|
|
22
|
+
var swagger_ = __webpack_require__(176);
|
|
23
|
+
// EXTERNAL MODULE: ./projects/nestjs-form-builder/src/config/message-keys.ts
|
|
24
|
+
var message_keys = __webpack_require__(137);
|
|
25
|
+
// EXTERNAL MODULE: ./projects/nestjs-form-builder/src/dtos/index.ts + 1 modules
|
|
26
|
+
var dtos = __webpack_require__(998);
|
|
27
|
+
// EXTERNAL MODULE: ./projects/nestjs-form-builder/src/services/form.service.ts + 2 modules
|
|
28
|
+
var form_service = __webpack_require__(148);
|
|
29
|
+
;// CONCATENATED MODULE: ./projects/nestjs-form-builder/src/controllers/form.controller.ts
|
|
30
|
+
function _ts_decorate(decorators, target, key, desc) {
|
|
31
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
32
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
33
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
34
|
+
} else {
|
|
35
|
+
for(var i = decorators.length - 1; i >= 0; i--){
|
|
36
|
+
if (d = decorators[i]) {
|
|
37
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
42
|
+
}
|
|
43
|
+
function _ts_metadata(metadataKey, metadataValue) {
|
|
44
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
45
|
+
return Reflect.metadata(metadataKey, metadataValue);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
function _ts_param(paramIndex, decorator) {
|
|
49
|
+
return function(target, key) {
|
|
50
|
+
decorator(target, key, paramIndex);
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
class FormController extends (0,classes_.createApiController)(dtos/* .CreateFormDto */.YD, dtos/* .UpdateFormDto */.jQ, dtos/* .FormResponseDto */.bV, {
|
|
62
|
+
entityName: 'form',
|
|
63
|
+
security: {
|
|
64
|
+
insert: {
|
|
65
|
+
level: 'permission',
|
|
66
|
+
permissions: [
|
|
67
|
+
classes_.FORM_PERMISSIONS.CREATE
|
|
68
|
+
]
|
|
69
|
+
},
|
|
70
|
+
insertMany: {
|
|
71
|
+
level: 'permission',
|
|
72
|
+
permissions: [
|
|
73
|
+
classes_.FORM_PERMISSIONS.CREATE
|
|
74
|
+
]
|
|
75
|
+
},
|
|
76
|
+
getById: {
|
|
77
|
+
level: 'permission',
|
|
78
|
+
permissions: [
|
|
79
|
+
classes_.FORM_PERMISSIONS.READ
|
|
80
|
+
]
|
|
81
|
+
},
|
|
82
|
+
getAll: {
|
|
83
|
+
level: 'permission',
|
|
84
|
+
permissions: [
|
|
85
|
+
classes_.FORM_PERMISSIONS.READ
|
|
86
|
+
]
|
|
87
|
+
},
|
|
88
|
+
update: {
|
|
89
|
+
level: 'permission',
|
|
90
|
+
permissions: [
|
|
91
|
+
classes_.FORM_PERMISSIONS.UPDATE
|
|
92
|
+
]
|
|
93
|
+
},
|
|
94
|
+
updateMany: {
|
|
95
|
+
level: 'permission',
|
|
96
|
+
permissions: [
|
|
97
|
+
classes_.FORM_PERMISSIONS.UPDATE
|
|
98
|
+
]
|
|
99
|
+
},
|
|
100
|
+
delete: {
|
|
101
|
+
level: 'permission',
|
|
102
|
+
permissions: [
|
|
103
|
+
classes_.FORM_PERMISSIONS.DELETE
|
|
104
|
+
]
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}) {
|
|
108
|
+
formService;
|
|
109
|
+
constructor(formService){
|
|
110
|
+
super(formService), this.formService = formService;
|
|
111
|
+
}
|
|
112
|
+
// Public Endpoints
|
|
113
|
+
/**
|
|
114
|
+
* Get form access info (no authentication required)
|
|
115
|
+
*/ async getFormAccessInfo(id) {
|
|
116
|
+
const data = await this.formService.getFormAccessInfo(id);
|
|
117
|
+
return {
|
|
118
|
+
success: true,
|
|
119
|
+
message: 'Form access info retrieved',
|
|
120
|
+
messageKey: message_keys/* .FORM_MESSAGES.GET_ACCESS_INFO_SUCCESS */.Q.GET_ACCESS_INFO_SUCCESS,
|
|
121
|
+
data
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
async getPublicForm(id) {
|
|
125
|
+
const data = await this.formService.getPublicForm(id);
|
|
126
|
+
return {
|
|
127
|
+
success: true,
|
|
128
|
+
message: 'Form retrieved',
|
|
129
|
+
messageKey: message_keys/* .FORM_MESSAGES.GET_SUCCESS */.Q.GET_SUCCESS,
|
|
130
|
+
data
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
async getAuthenticatedForm(id, user) {
|
|
134
|
+
const data = await this.formService.getAuthenticatedForm(id, user);
|
|
135
|
+
return {
|
|
136
|
+
success: true,
|
|
137
|
+
message: 'Form retrieved',
|
|
138
|
+
messageKey: message_keys/* .FORM_MESSAGES.GET_SUCCESS */.Q.GET_SUCCESS,
|
|
139
|
+
data
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
async getBySlug(slug, _user) {
|
|
143
|
+
const data = await this.formService.getBySlug(slug);
|
|
144
|
+
return {
|
|
145
|
+
success: true,
|
|
146
|
+
message: 'Form retrieved',
|
|
147
|
+
messageKey: message_keys/* .FORM_MESSAGES.GET_SUCCESS */.Q.GET_SUCCESS,
|
|
148
|
+
data
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
async getPublicFormBySlug(slug) {
|
|
152
|
+
const data = await this.formService.getPublicFormBySlug(slug);
|
|
153
|
+
return {
|
|
154
|
+
success: true,
|
|
155
|
+
message: 'Form retrieved',
|
|
156
|
+
messageKey: message_keys/* .FORM_MESSAGES.GET_SUCCESS */.Q.GET_SUCCESS,
|
|
157
|
+
data
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
_ts_decorate([
|
|
162
|
+
(0,common_.Post)('access-info/:id'),
|
|
163
|
+
(0,decorators_.Public)(),
|
|
164
|
+
(0,common_.HttpCode)(common_.HttpStatus.OK),
|
|
165
|
+
(0,swagger_.ApiOperation)({
|
|
166
|
+
summary: 'Get form access info (no auth required)'
|
|
167
|
+
}),
|
|
168
|
+
_ts_param(0, (0,common_.Param)('id')),
|
|
169
|
+
_ts_metadata("design:type", Function),
|
|
170
|
+
_ts_metadata("design:paramtypes", [
|
|
171
|
+
String
|
|
172
|
+
]),
|
|
173
|
+
_ts_metadata("design:returntype", Promise)
|
|
174
|
+
], FormController.prototype, "getFormAccessInfo", null);
|
|
175
|
+
_ts_decorate([
|
|
176
|
+
(0,common_.Post)('public/:id'),
|
|
177
|
+
(0,decorators_.Public)(),
|
|
178
|
+
(0,common_.HttpCode)(common_.HttpStatus.OK),
|
|
179
|
+
(0,swagger_.ApiOperation)({
|
|
180
|
+
summary: 'Get public form for submission (no auth required)'
|
|
181
|
+
}),
|
|
182
|
+
_ts_param(0, (0,common_.Param)('id')),
|
|
183
|
+
_ts_metadata("design:type", Function),
|
|
184
|
+
_ts_metadata("design:paramtypes", [
|
|
185
|
+
String
|
|
186
|
+
]),
|
|
187
|
+
_ts_metadata("design:returntype", Promise)
|
|
188
|
+
], FormController.prototype, "getPublicForm", null);
|
|
189
|
+
_ts_decorate([
|
|
190
|
+
(0,common_.Post)('authenticated/:id'),
|
|
191
|
+
(0,common_.UseGuards)(JwtAuthGuard),
|
|
192
|
+
(0,swagger_.ApiBearerAuth)(),
|
|
193
|
+
(0,common_.HttpCode)(common_.HttpStatus.OK),
|
|
194
|
+
(0,swagger_.ApiOperation)({
|
|
195
|
+
summary: 'Get form for authenticated submission'
|
|
196
|
+
}),
|
|
197
|
+
_ts_param(0, (0,common_.Param)('id')),
|
|
198
|
+
_ts_param(1, (0,decorators_.CurrentUser)()),
|
|
199
|
+
_ts_metadata("design:type", Function),
|
|
200
|
+
_ts_metadata("design:paramtypes", [
|
|
201
|
+
String,
|
|
202
|
+
typeof ILoggedUserInfo === "undefined" ? Object : ILoggedUserInfo
|
|
203
|
+
]),
|
|
204
|
+
_ts_metadata("design:returntype", Promise)
|
|
205
|
+
], FormController.prototype, "getAuthenticatedForm", null);
|
|
206
|
+
_ts_decorate([
|
|
207
|
+
(0,common_.Post)('by-slug/:slug'),
|
|
208
|
+
(0,common_.UseGuards)(JwtAuthGuard, PermissionGuard),
|
|
209
|
+
(0,swagger_.ApiBearerAuth)(),
|
|
210
|
+
(0,decorators_.RequirePermission)(classes_.FORM_PERMISSIONS.READ),
|
|
211
|
+
(0,common_.HttpCode)(common_.HttpStatus.OK),
|
|
212
|
+
(0,swagger_.ApiOperation)({
|
|
213
|
+
summary: 'Get form by slug'
|
|
214
|
+
}),
|
|
215
|
+
_ts_param(0, (0,common_.Param)('slug')),
|
|
216
|
+
_ts_param(1, (0,decorators_.CurrentUser)()),
|
|
217
|
+
_ts_metadata("design:type", Function),
|
|
218
|
+
_ts_metadata("design:paramtypes", [
|
|
219
|
+
String,
|
|
220
|
+
typeof ILoggedUserInfo === "undefined" ? Object : ILoggedUserInfo
|
|
221
|
+
]),
|
|
222
|
+
_ts_metadata("design:returntype", Promise)
|
|
223
|
+
], FormController.prototype, "getBySlug", null);
|
|
224
|
+
_ts_decorate([
|
|
225
|
+
(0,common_.Post)('public/by-slug/:slug'),
|
|
226
|
+
(0,decorators_.Public)(),
|
|
227
|
+
(0,common_.HttpCode)(common_.HttpStatus.OK),
|
|
228
|
+
(0,swagger_.ApiOperation)({
|
|
229
|
+
summary: 'Get public form by slug (no auth required)'
|
|
230
|
+
}),
|
|
231
|
+
_ts_param(0, (0,common_.Param)('slug')),
|
|
232
|
+
_ts_metadata("design:type", Function),
|
|
233
|
+
_ts_metadata("design:paramtypes", [
|
|
234
|
+
String
|
|
235
|
+
]),
|
|
236
|
+
_ts_metadata("design:returntype", Promise)
|
|
237
|
+
], FormController.prototype, "getPublicFormBySlug", null);
|
|
238
|
+
FormController = _ts_decorate([
|
|
239
|
+
(0,swagger_.ApiTags)('Form Builder - Forms'),
|
|
240
|
+
(0,common_.Controller)('form-builder/form'),
|
|
241
|
+
_ts_param(0, (0,common_.Inject)(form_service/* .FormService */.u)),
|
|
242
|
+
_ts_metadata("design:type", Function),
|
|
243
|
+
_ts_metadata("design:paramtypes", [
|
|
244
|
+
typeof form_service/* .FormService */.u === "undefined" ? Object : form_service/* .FormService */.u
|
|
245
|
+
])
|
|
246
|
+
], FormController);
|
|
247
|
+
|
|
248
|
+
// EXTERNAL MODULE: ./projects/nestjs-form-builder/src/services/form-result.service.ts
|
|
249
|
+
var form_result_service = __webpack_require__(160);
|
|
250
|
+
;// CONCATENATED MODULE: ./projects/nestjs-form-builder/src/controllers/form-result.controller.ts
|
|
251
|
+
function form_result_controller_ts_decorate(decorators, target, key, desc) {
|
|
252
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
253
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
254
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
255
|
+
} else {
|
|
256
|
+
for(var i = decorators.length - 1; i >= 0; i--){
|
|
257
|
+
if (d = decorators[i]) {
|
|
258
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
263
|
+
}
|
|
264
|
+
function form_result_controller_ts_metadata(metadataKey, metadataValue) {
|
|
265
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
266
|
+
return Reflect.metadata(metadataKey, metadataValue);
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
function form_result_controller_ts_param(paramIndex, decorator) {
|
|
270
|
+
return function(target, key) {
|
|
271
|
+
decorator(target, key, paramIndex);
|
|
272
|
+
};
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
|
|
279
|
+
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
class FormResultController extends (0,classes_.createApiController)(dtos/* .CreateFormResultDto */.pZ, dtos/* .UpdateFormResultDto */.Uj, dtos/* .FormResultResponseDto */._$, {
|
|
283
|
+
entityName: 'form.result',
|
|
284
|
+
security: {
|
|
285
|
+
insert: {
|
|
286
|
+
level: 'permission',
|
|
287
|
+
permissions: [
|
|
288
|
+
classes_.FORM_RESULT_PERMISSIONS.CREATE
|
|
289
|
+
]
|
|
290
|
+
},
|
|
291
|
+
insertMany: {
|
|
292
|
+
level: 'permission',
|
|
293
|
+
permissions: [
|
|
294
|
+
classes_.FORM_RESULT_PERMISSIONS.CREATE
|
|
295
|
+
]
|
|
296
|
+
},
|
|
297
|
+
getById: {
|
|
298
|
+
level: 'permission',
|
|
299
|
+
permissions: [
|
|
300
|
+
classes_.FORM_RESULT_PERMISSIONS.READ
|
|
301
|
+
]
|
|
302
|
+
},
|
|
303
|
+
getAll: {
|
|
304
|
+
level: 'permission',
|
|
305
|
+
permissions: [
|
|
306
|
+
classes_.FORM_RESULT_PERMISSIONS.READ
|
|
307
|
+
]
|
|
308
|
+
},
|
|
309
|
+
update: {
|
|
310
|
+
level: 'permission',
|
|
311
|
+
permissions: [
|
|
312
|
+
classes_.FORM_RESULT_PERMISSIONS.UPDATE
|
|
313
|
+
]
|
|
314
|
+
},
|
|
315
|
+
updateMany: {
|
|
316
|
+
level: 'permission',
|
|
317
|
+
permissions: [
|
|
318
|
+
classes_.FORM_RESULT_PERMISSIONS.UPDATE
|
|
319
|
+
]
|
|
320
|
+
},
|
|
321
|
+
delete: {
|
|
322
|
+
level: 'permission',
|
|
323
|
+
permissions: [
|
|
324
|
+
classes_.FORM_RESULT_PERMISSIONS.DELETE
|
|
325
|
+
]
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
}) {
|
|
329
|
+
formResultService;
|
|
330
|
+
constructor(formResultService){
|
|
331
|
+
super(formResultService), this.formResultService = formResultService;
|
|
332
|
+
}
|
|
333
|
+
// Submit Endpoints
|
|
334
|
+
/**
|
|
335
|
+
* Submit form with authentication
|
|
336
|
+
*/ async submitForm(dto, user) {
|
|
337
|
+
const data = await this.formResultService.submitForm(dto, user, false);
|
|
338
|
+
return {
|
|
339
|
+
success: true,
|
|
340
|
+
message: 'Form submitted successfully',
|
|
341
|
+
messageKey: message_keys/* .FORM_RESULT_MESSAGES.SUBMIT_SUCCESS */.y.SUBMIT_SUCCESS,
|
|
342
|
+
data
|
|
343
|
+
};
|
|
344
|
+
}
|
|
345
|
+
async submitPublicForm(dto) {
|
|
346
|
+
const data = await this.formResultService.submitForm(dto, null, true);
|
|
347
|
+
return {
|
|
348
|
+
success: true,
|
|
349
|
+
message: 'Form submitted successfully',
|
|
350
|
+
messageKey: message_keys/* .FORM_RESULT_MESSAGES.SUBMIT_SUCCESS */.y.SUBMIT_SUCCESS,
|
|
351
|
+
data
|
|
352
|
+
};
|
|
353
|
+
}
|
|
354
|
+
// Draft Endpoints
|
|
355
|
+
async getMyDraft(dto, user) {
|
|
356
|
+
const data = await this.formResultService.getMyDraft(dto.formId, user);
|
|
357
|
+
return {
|
|
358
|
+
success: true,
|
|
359
|
+
message: 'Draft retrieved',
|
|
360
|
+
messageKey: message_keys/* .FORM_RESULT_MESSAGES.DRAFT_GET_SUCCESS */.y.DRAFT_GET_SUCCESS,
|
|
361
|
+
data
|
|
362
|
+
};
|
|
363
|
+
}
|
|
364
|
+
async updateDraft(dto, user) {
|
|
365
|
+
const data = await this.formResultService.updateDraft(dto.draftId, dto, user);
|
|
366
|
+
return {
|
|
367
|
+
success: true,
|
|
368
|
+
message: 'Draft updated successfully',
|
|
369
|
+
messageKey: message_keys/* .FORM_RESULT_MESSAGES.DRAFT_UPDATE_SUCCESS */.y.DRAFT_UPDATE_SUCCESS,
|
|
370
|
+
data
|
|
371
|
+
};
|
|
372
|
+
}
|
|
373
|
+
// Query Endpoints
|
|
374
|
+
/**
|
|
375
|
+
* Get results by form ID with pagination
|
|
376
|
+
*/ async getByFormId(dto, user) {
|
|
377
|
+
const page = dto.page ?? 0;
|
|
378
|
+
const pageSize = dto.pageSize ?? 10;
|
|
379
|
+
const result = await this.formResultService.getByFormId(dto.formId, user, {
|
|
380
|
+
page,
|
|
381
|
+
pageSize
|
|
382
|
+
});
|
|
383
|
+
return {
|
|
384
|
+
success: true,
|
|
385
|
+
message: 'Form results retrieved successfully',
|
|
386
|
+
messageKey: message_keys/* .FORM_RESULT_MESSAGES.GET_ALL_SUCCESS */.y.GET_ALL_SUCCESS,
|
|
387
|
+
data: result.data,
|
|
388
|
+
meta: {
|
|
389
|
+
total: result.total,
|
|
390
|
+
page,
|
|
391
|
+
pageSize,
|
|
392
|
+
count: result.data.length
|
|
393
|
+
}
|
|
394
|
+
};
|
|
395
|
+
}
|
|
396
|
+
/**
|
|
397
|
+
* Check if current user has already submitted this form (non-draft)
|
|
398
|
+
* Used for single response mode
|
|
399
|
+
*/ async hasUserSubmitted(dto, user) {
|
|
400
|
+
const hasSubmitted = await this.formResultService.hasUserSubmitted(dto.formId, user);
|
|
401
|
+
return {
|
|
402
|
+
success: true,
|
|
403
|
+
message: hasSubmitted ? 'User has submitted this form' : 'User has not submitted this form',
|
|
404
|
+
messageKey: hasSubmitted ? message_keys/* .FORM_RESULT_MESSAGES.HAS_SUBMITTED_SUCCESS */.y.HAS_SUBMITTED_SUCCESS : message_keys/* .FORM_RESULT_MESSAGES.HAS_NOT_SUBMITTED_SUCCESS */.y.HAS_NOT_SUBMITTED_SUCCESS,
|
|
405
|
+
data: hasSubmitted
|
|
406
|
+
};
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
form_result_controller_ts_decorate([
|
|
410
|
+
(0,common_.Post)('submit'),
|
|
411
|
+
(0,common_.UseGuards)(JwtAuthGuard),
|
|
412
|
+
(0,swagger_.ApiBearerAuth)(),
|
|
413
|
+
(0,common_.HttpCode)(common_.HttpStatus.CREATED),
|
|
414
|
+
(0,swagger_.ApiOperation)({
|
|
415
|
+
summary: 'Submit form result (authenticated)'
|
|
416
|
+
}),
|
|
417
|
+
form_result_controller_ts_param(0, (0,common_.Body)()),
|
|
418
|
+
form_result_controller_ts_param(1, (0,decorators_.CurrentUser)()),
|
|
419
|
+
form_result_controller_ts_metadata("design:type", Function),
|
|
420
|
+
form_result_controller_ts_metadata("design:paramtypes", [
|
|
421
|
+
typeof dtos/* .SubmitFormDto */.sH === "undefined" ? Object : dtos/* .SubmitFormDto */.sH,
|
|
422
|
+
typeof ILoggedUserInfo === "undefined" ? Object : ILoggedUserInfo
|
|
423
|
+
]),
|
|
424
|
+
form_result_controller_ts_metadata("design:returntype", Promise)
|
|
425
|
+
], FormResultController.prototype, "submitForm", null);
|
|
426
|
+
form_result_controller_ts_decorate([
|
|
427
|
+
(0,common_.Post)('submit-public'),
|
|
428
|
+
(0,decorators_.Public)(),
|
|
429
|
+
(0,common_.HttpCode)(common_.HttpStatus.CREATED),
|
|
430
|
+
(0,swagger_.ApiOperation)({
|
|
431
|
+
summary: 'Submit public form (no auth required)'
|
|
432
|
+
}),
|
|
433
|
+
form_result_controller_ts_param(0, (0,common_.Body)()),
|
|
434
|
+
form_result_controller_ts_metadata("design:type", Function),
|
|
435
|
+
form_result_controller_ts_metadata("design:paramtypes", [
|
|
436
|
+
typeof dtos/* .SubmitFormDto */.sH === "undefined" ? Object : dtos/* .SubmitFormDto */.sH
|
|
437
|
+
]),
|
|
438
|
+
form_result_controller_ts_metadata("design:returntype", Promise)
|
|
439
|
+
], FormResultController.prototype, "submitPublicForm", null);
|
|
440
|
+
form_result_controller_ts_decorate([
|
|
441
|
+
(0,common_.Post)('my-draft'),
|
|
442
|
+
(0,common_.UseGuards)(JwtAuthGuard),
|
|
443
|
+
(0,swagger_.ApiBearerAuth)(),
|
|
444
|
+
(0,common_.HttpCode)(common_.HttpStatus.OK),
|
|
445
|
+
(0,swagger_.ApiOperation)({
|
|
446
|
+
summary: 'Get my draft for a form'
|
|
447
|
+
}),
|
|
448
|
+
form_result_controller_ts_param(0, (0,common_.Body)()),
|
|
449
|
+
form_result_controller_ts_param(1, (0,decorators_.CurrentUser)()),
|
|
450
|
+
form_result_controller_ts_metadata("design:type", Function),
|
|
451
|
+
form_result_controller_ts_metadata("design:paramtypes", [
|
|
452
|
+
typeof dtos/* .GetMyDraftDto */.D5 === "undefined" ? Object : dtos/* .GetMyDraftDto */.D5,
|
|
453
|
+
typeof ILoggedUserInfo === "undefined" ? Object : ILoggedUserInfo
|
|
454
|
+
]),
|
|
455
|
+
form_result_controller_ts_metadata("design:returntype", Promise)
|
|
456
|
+
], FormResultController.prototype, "getMyDraft", null);
|
|
457
|
+
form_result_controller_ts_decorate([
|
|
458
|
+
(0,common_.Post)('update-draft'),
|
|
459
|
+
(0,common_.UseGuards)(JwtAuthGuard),
|
|
460
|
+
(0,swagger_.ApiBearerAuth)(),
|
|
461
|
+
(0,common_.HttpCode)(common_.HttpStatus.OK),
|
|
462
|
+
(0,swagger_.ApiOperation)({
|
|
463
|
+
summary: 'Update existing draft'
|
|
464
|
+
}),
|
|
465
|
+
form_result_controller_ts_param(0, (0,common_.Body)()),
|
|
466
|
+
form_result_controller_ts_param(1, (0,decorators_.CurrentUser)()),
|
|
467
|
+
form_result_controller_ts_metadata("design:type", Function),
|
|
468
|
+
form_result_controller_ts_metadata("design:paramtypes", [
|
|
469
|
+
typeof dtos/* .UpdateDraftDto */.CQ === "undefined" ? Object : dtos/* .UpdateDraftDto */.CQ,
|
|
470
|
+
typeof ILoggedUserInfo === "undefined" ? Object : ILoggedUserInfo
|
|
471
|
+
]),
|
|
472
|
+
form_result_controller_ts_metadata("design:returntype", Promise)
|
|
473
|
+
], FormResultController.prototype, "updateDraft", null);
|
|
474
|
+
form_result_controller_ts_decorate([
|
|
475
|
+
(0,common_.Post)('by-form'),
|
|
476
|
+
(0,common_.UseGuards)(JwtAuthGuard, PermissionGuard),
|
|
477
|
+
(0,swagger_.ApiBearerAuth)(),
|
|
478
|
+
(0,decorators_.RequirePermission)(classes_.FORM_RESULT_PERMISSIONS.READ),
|
|
479
|
+
(0,common_.HttpCode)(common_.HttpStatus.OK),
|
|
480
|
+
(0,swagger_.ApiOperation)({
|
|
481
|
+
summary: 'Get results by form ID'
|
|
482
|
+
}),
|
|
483
|
+
form_result_controller_ts_param(0, (0,common_.Body)()),
|
|
484
|
+
form_result_controller_ts_param(1, (0,decorators_.CurrentUser)()),
|
|
485
|
+
form_result_controller_ts_metadata("design:type", Function),
|
|
486
|
+
form_result_controller_ts_metadata("design:paramtypes", [
|
|
487
|
+
typeof dtos/* .GetResultsByFormDto */.rp === "undefined" ? Object : dtos/* .GetResultsByFormDto */.rp,
|
|
488
|
+
typeof ILoggedUserInfo === "undefined" ? Object : ILoggedUserInfo
|
|
489
|
+
]),
|
|
490
|
+
form_result_controller_ts_metadata("design:returntype", Promise)
|
|
491
|
+
], FormResultController.prototype, "getByFormId", null);
|
|
492
|
+
form_result_controller_ts_decorate([
|
|
493
|
+
(0,common_.Post)('has-submitted'),
|
|
494
|
+
(0,common_.UseGuards)(JwtAuthGuard),
|
|
495
|
+
(0,swagger_.ApiBearerAuth)(),
|
|
496
|
+
(0,common_.HttpCode)(common_.HttpStatus.OK),
|
|
497
|
+
(0,swagger_.ApiOperation)({
|
|
498
|
+
summary: 'Check if user has submitted form'
|
|
499
|
+
}),
|
|
500
|
+
form_result_controller_ts_param(0, (0,common_.Body)()),
|
|
501
|
+
form_result_controller_ts_param(1, (0,decorators_.CurrentUser)()),
|
|
502
|
+
form_result_controller_ts_metadata("design:type", Function),
|
|
503
|
+
form_result_controller_ts_metadata("design:paramtypes", [
|
|
504
|
+
typeof dtos/* .GetMyDraftDto */.D5 === "undefined" ? Object : dtos/* .GetMyDraftDto */.D5,
|
|
505
|
+
typeof ILoggedUserInfo === "undefined" ? Object : ILoggedUserInfo
|
|
506
|
+
]),
|
|
507
|
+
form_result_controller_ts_metadata("design:returntype", Promise)
|
|
508
|
+
], FormResultController.prototype, "hasUserSubmitted", null);
|
|
509
|
+
FormResultController = form_result_controller_ts_decorate([
|
|
510
|
+
(0,swagger_.ApiTags)('Form Builder - Results'),
|
|
511
|
+
(0,common_.Controller)('form-builder/result'),
|
|
512
|
+
form_result_controller_ts_param(0, (0,common_.Inject)(form_result_service/* .FormResultService */.v)),
|
|
513
|
+
form_result_controller_ts_metadata("design:type", Function),
|
|
514
|
+
form_result_controller_ts_metadata("design:paramtypes", [
|
|
515
|
+
typeof form_result_service/* .FormResultService */.v === "undefined" ? Object : form_result_service/* .FormResultService */.v
|
|
516
|
+
])
|
|
517
|
+
], FormResultController);
|
|
518
|
+
|
|
519
|
+
;// CONCATENATED MODULE: ./projects/nestjs-form-builder/src/controllers/index.ts
|
|
520
|
+
|
|
521
|
+
|
|
522
|
+
|
|
523
|
+
|
|
524
|
+
},
|
|
525
|
+
998(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
526
|
+
|
|
527
|
+
// EXPORTS
|
|
528
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
529
|
+
YD: () => (/* reexport */ CreateFormDto),
|
|
530
|
+
pZ: () => (/* reexport */ form_result_dto/* .CreateFormResultDto */.pZ),
|
|
531
|
+
Xe: () => (/* reexport */ FormAccessInfoResponseDto),
|
|
532
|
+
bV: () => (/* reexport */ FormResponseDto),
|
|
533
|
+
_$: () => (/* reexport */ form_result_dto/* .FormResultResponseDto */._$),
|
|
534
|
+
D5: () => (/* reexport */ form_result_dto/* .GetMyDraftDto */.D5),
|
|
535
|
+
rp: () => (/* reexport */ form_result_dto/* .GetResultsByFormDto */.rp),
|
|
536
|
+
M4: () => (/* reexport */ PublicFormResponseDto),
|
|
537
|
+
sH: () => (/* reexport */ form_result_dto/* .SubmitFormDto */.sH),
|
|
538
|
+
CQ: () => (/* reexport */ form_result_dto/* .UpdateDraftDto */.CQ),
|
|
539
|
+
jQ: () => (/* reexport */ UpdateFormDto),
|
|
540
|
+
Uj: () => (/* reexport */ form_result_dto/* .UpdateFormResultDto */.Uj)
|
|
541
|
+
});
|
|
542
|
+
|
|
543
|
+
// EXTERNAL MODULE: external "@flusys/nestjs-shared/dtos"
|
|
544
|
+
var dtos_ = __webpack_require__(873);
|
|
545
|
+
// EXTERNAL MODULE: external "@nestjs/swagger"
|
|
546
|
+
var swagger_ = __webpack_require__(176);
|
|
547
|
+
// EXTERNAL MODULE: external "class-transformer"
|
|
548
|
+
var external_class_transformer_ = __webpack_require__(812);
|
|
549
|
+
// EXTERNAL MODULE: external "class-validator"
|
|
550
|
+
var external_class_validator_ = __webpack_require__(421);
|
|
551
|
+
// EXTERNAL MODULE: ./projects/nestjs-form-builder/src/enums/form-access-type.enum.ts
|
|
552
|
+
var form_access_type_enum = __webpack_require__(376);
|
|
553
|
+
;// CONCATENATED MODULE: ./projects/nestjs-form-builder/src/dtos/form.dto.ts
|
|
554
|
+
function _ts_decorate(decorators, target, key, desc) {
|
|
555
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
556
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
557
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
558
|
+
} else {
|
|
559
|
+
for(var i = decorators.length - 1; i >= 0; i--){
|
|
560
|
+
if (d = decorators[i]) {
|
|
561
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
566
|
+
}
|
|
567
|
+
function _ts_metadata(metadataKey, metadataValue) {
|
|
568
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
569
|
+
return Reflect.metadata(metadataKey, metadataValue);
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
|
|
574
|
+
|
|
575
|
+
|
|
576
|
+
|
|
577
|
+
class CreateFormDto {
|
|
578
|
+
name;
|
|
579
|
+
description;
|
|
580
|
+
slug;
|
|
581
|
+
schema;
|
|
582
|
+
accessType;
|
|
583
|
+
actionGroups;
|
|
584
|
+
tags;
|
|
585
|
+
companyId;
|
|
586
|
+
isActive;
|
|
587
|
+
}
|
|
588
|
+
_ts_decorate([
|
|
589
|
+
(0,swagger_.ApiProperty)({
|
|
590
|
+
description: 'Form name',
|
|
591
|
+
example: 'Customer Feedback Survey'
|
|
592
|
+
}),
|
|
593
|
+
(0,external_class_validator_.IsString)(),
|
|
594
|
+
(0,external_class_validator_.IsNotEmpty)(),
|
|
595
|
+
(0,external_class_validator_.MaxLength)(255),
|
|
596
|
+
_ts_metadata("design:type", String)
|
|
597
|
+
], CreateFormDto.prototype, "name", void 0);
|
|
598
|
+
_ts_decorate([
|
|
599
|
+
(0,swagger_.ApiProperty)({
|
|
600
|
+
description: 'Form description',
|
|
601
|
+
example: 'A survey to collect customer feedback',
|
|
602
|
+
required: false
|
|
603
|
+
}),
|
|
604
|
+
(0,external_class_validator_.IsString)(),
|
|
605
|
+
(0,external_class_validator_.IsOptional)(),
|
|
606
|
+
(0,external_class_validator_.MaxLength)(500),
|
|
607
|
+
_ts_metadata("design:type", String)
|
|
608
|
+
], CreateFormDto.prototype, "description", void 0);
|
|
609
|
+
_ts_decorate([
|
|
610
|
+
(0,swagger_.ApiProperty)({
|
|
611
|
+
description: 'URL-friendly slug for public links',
|
|
612
|
+
example: 'customer-feedback',
|
|
613
|
+
required: false
|
|
614
|
+
}),
|
|
615
|
+
(0,external_class_validator_.IsString)(),
|
|
616
|
+
(0,external_class_validator_.IsOptional)(),
|
|
617
|
+
(0,external_class_validator_.MaxLength)(255),
|
|
618
|
+
_ts_metadata("design:type", String)
|
|
619
|
+
], CreateFormDto.prototype, "slug", void 0);
|
|
620
|
+
_ts_decorate([
|
|
621
|
+
(0,swagger_.ApiProperty)({
|
|
622
|
+
description: 'Form schema (JSON structure)',
|
|
623
|
+
example: {
|
|
624
|
+
sections: [],
|
|
625
|
+
settings: {}
|
|
626
|
+
}
|
|
627
|
+
}),
|
|
628
|
+
(0,external_class_validator_.IsObject)(),
|
|
629
|
+
(0,external_class_validator_.IsNotEmpty)(),
|
|
630
|
+
_ts_metadata("design:type", typeof Record === "undefined" ? Object : Record)
|
|
631
|
+
], CreateFormDto.prototype, "schema", void 0);
|
|
632
|
+
_ts_decorate([
|
|
633
|
+
(0,swagger_.ApiProperty)({
|
|
634
|
+
description: 'Access type for the form',
|
|
635
|
+
enum: form_access_type_enum/* .FormAccessType */.h,
|
|
636
|
+
default: form_access_type_enum/* .FormAccessType.AUTHENTICATED */.h.AUTHENTICATED,
|
|
637
|
+
required: false
|
|
638
|
+
}),
|
|
639
|
+
(0,external_class_validator_.IsEnum)(form_access_type_enum/* .FormAccessType */.h),
|
|
640
|
+
(0,external_class_validator_.IsOptional)(),
|
|
641
|
+
_ts_metadata("design:type", typeof form_access_type_enum/* .FormAccessType */.h === "undefined" ? Object : form_access_type_enum/* .FormAccessType */.h)
|
|
642
|
+
], CreateFormDto.prototype, "accessType", void 0);
|
|
643
|
+
_ts_decorate([
|
|
644
|
+
(0,swagger_.ApiProperty)({
|
|
645
|
+
description: 'Action groups for permission-based access (only used when accessType is action_group)',
|
|
646
|
+
example: [
|
|
647
|
+
'hr.survey.submit',
|
|
648
|
+
'employee.feedback.submit'
|
|
649
|
+
],
|
|
650
|
+
required: false
|
|
651
|
+
}),
|
|
652
|
+
(0,external_class_validator_.IsArray)(),
|
|
653
|
+
(0,external_class_validator_.IsString)({
|
|
654
|
+
each: true
|
|
655
|
+
}),
|
|
656
|
+
(0,external_class_validator_.IsOptional)(),
|
|
657
|
+
_ts_metadata("design:type", Array)
|
|
658
|
+
], CreateFormDto.prototype, "actionGroups", void 0);
|
|
659
|
+
_ts_decorate([
|
|
660
|
+
(0,swagger_.ApiProperty)({
|
|
661
|
+
description: 'Tags used by consuming modules to fetch this form (e.g. survey, review)',
|
|
662
|
+
example: [
|
|
663
|
+
'survey',
|
|
664
|
+
'review'
|
|
665
|
+
],
|
|
666
|
+
required: false
|
|
667
|
+
}),
|
|
668
|
+
(0,external_class_validator_.IsArray)(),
|
|
669
|
+
(0,external_class_validator_.IsString)({
|
|
670
|
+
each: true
|
|
671
|
+
}),
|
|
672
|
+
(0,external_class_validator_.IsOptional)(),
|
|
673
|
+
_ts_metadata("design:type", Array)
|
|
674
|
+
], CreateFormDto.prototype, "tags", void 0);
|
|
675
|
+
_ts_decorate([
|
|
676
|
+
(0,swagger_.ApiProperty)({
|
|
677
|
+
description: 'Company ID - Only available when company feature is enabled',
|
|
678
|
+
example: '123e4567-e89b-12d3-a456-426614174000',
|
|
679
|
+
required: false
|
|
680
|
+
}),
|
|
681
|
+
(0,external_class_validator_.IsUUID)(),
|
|
682
|
+
(0,external_class_validator_.IsOptional)(),
|
|
683
|
+
_ts_metadata("design:type", String)
|
|
684
|
+
], CreateFormDto.prototype, "companyId", void 0);
|
|
685
|
+
_ts_decorate([
|
|
686
|
+
(0,swagger_.ApiProperty)({
|
|
687
|
+
description: 'Active status',
|
|
688
|
+
default: true,
|
|
689
|
+
required: false
|
|
690
|
+
}),
|
|
691
|
+
(0,external_class_validator_.IsBoolean)(),
|
|
692
|
+
(0,external_class_validator_.IsOptional)(),
|
|
693
|
+
_ts_metadata("design:type", Boolean)
|
|
694
|
+
], CreateFormDto.prototype, "isActive", void 0);
|
|
695
|
+
class UpdateFormDto extends (0,swagger_.PartialType)(CreateFormDto) {
|
|
696
|
+
id;
|
|
697
|
+
schemaVersion;
|
|
698
|
+
}
|
|
699
|
+
_ts_decorate([
|
|
700
|
+
(0,swagger_.ApiProperty)({
|
|
701
|
+
description: 'Form ID',
|
|
702
|
+
example: '123e4567-e89b-12d3-a456-426614174000'
|
|
703
|
+
}),
|
|
704
|
+
(0,external_class_validator_.IsUUID)(),
|
|
705
|
+
(0,external_class_validator_.IsNotEmpty)(),
|
|
706
|
+
_ts_metadata("design:type", String)
|
|
707
|
+
], UpdateFormDto.prototype, "id", void 0);
|
|
708
|
+
_ts_decorate([
|
|
709
|
+
(0,swagger_.ApiProperty)({
|
|
710
|
+
description: 'Schema version (auto-incremented when schema changes)',
|
|
711
|
+
required: false
|
|
712
|
+
}),
|
|
713
|
+
(0,external_class_validator_.IsOptional)(),
|
|
714
|
+
_ts_metadata("design:type", Number)
|
|
715
|
+
], UpdateFormDto.prototype, "schemaVersion", void 0);
|
|
716
|
+
class FormResponseDto extends dtos_.IdentityResponseDto {
|
|
717
|
+
name;
|
|
718
|
+
description;
|
|
719
|
+
slug;
|
|
720
|
+
schema;
|
|
721
|
+
schemaVersion;
|
|
722
|
+
accessType;
|
|
723
|
+
actionGroups;
|
|
724
|
+
tags;
|
|
725
|
+
companyId;
|
|
726
|
+
isActive;
|
|
727
|
+
}
|
|
728
|
+
_ts_decorate([
|
|
729
|
+
(0,external_class_transformer_.Expose)(),
|
|
730
|
+
(0,swagger_.ApiProperty)(),
|
|
731
|
+
_ts_metadata("design:type", String)
|
|
732
|
+
], FormResponseDto.prototype, "name", void 0);
|
|
733
|
+
_ts_decorate([
|
|
734
|
+
(0,external_class_transformer_.Expose)(),
|
|
735
|
+
(0,swagger_.ApiProperty)(),
|
|
736
|
+
_ts_metadata("design:type", Object)
|
|
737
|
+
], FormResponseDto.prototype, "description", void 0);
|
|
738
|
+
_ts_decorate([
|
|
739
|
+
(0,external_class_transformer_.Expose)(),
|
|
740
|
+
(0,swagger_.ApiProperty)(),
|
|
741
|
+
_ts_metadata("design:type", Object)
|
|
742
|
+
], FormResponseDto.prototype, "slug", void 0);
|
|
743
|
+
_ts_decorate([
|
|
744
|
+
(0,external_class_transformer_.Expose)(),
|
|
745
|
+
(0,swagger_.ApiProperty)(),
|
|
746
|
+
_ts_metadata("design:type", typeof Record === "undefined" ? Object : Record)
|
|
747
|
+
], FormResponseDto.prototype, "schema", void 0);
|
|
748
|
+
_ts_decorate([
|
|
749
|
+
(0,external_class_transformer_.Expose)(),
|
|
750
|
+
(0,swagger_.ApiProperty)(),
|
|
751
|
+
_ts_metadata("design:type", Number)
|
|
752
|
+
], FormResponseDto.prototype, "schemaVersion", void 0);
|
|
753
|
+
_ts_decorate([
|
|
754
|
+
(0,external_class_transformer_.Expose)(),
|
|
755
|
+
(0,swagger_.ApiProperty)({
|
|
756
|
+
enum: form_access_type_enum/* .FormAccessType */.h
|
|
757
|
+
}),
|
|
758
|
+
_ts_metadata("design:type", typeof form_access_type_enum/* .FormAccessType */.h === "undefined" ? Object : form_access_type_enum/* .FormAccessType */.h)
|
|
759
|
+
], FormResponseDto.prototype, "accessType", void 0);
|
|
760
|
+
_ts_decorate([
|
|
761
|
+
(0,external_class_transformer_.Expose)(),
|
|
762
|
+
(0,swagger_.ApiProperty)(),
|
|
763
|
+
_ts_metadata("design:type", Object)
|
|
764
|
+
], FormResponseDto.prototype, "actionGroups", void 0);
|
|
765
|
+
_ts_decorate([
|
|
766
|
+
(0,external_class_transformer_.Expose)(),
|
|
767
|
+
(0,swagger_.ApiProperty)(),
|
|
768
|
+
_ts_metadata("design:type", Object)
|
|
769
|
+
], FormResponseDto.prototype, "tags", void 0);
|
|
770
|
+
_ts_decorate([
|
|
771
|
+
(0,external_class_transformer_.Expose)(),
|
|
772
|
+
(0,swagger_.ApiProperty)(),
|
|
773
|
+
_ts_metadata("design:type", Object)
|
|
774
|
+
], FormResponseDto.prototype, "companyId", void 0);
|
|
775
|
+
_ts_decorate([
|
|
776
|
+
(0,external_class_transformer_.Expose)(),
|
|
777
|
+
(0,swagger_.ApiProperty)(),
|
|
778
|
+
_ts_metadata("design:type", Boolean)
|
|
779
|
+
], FormResponseDto.prototype, "isActive", void 0);
|
|
780
|
+
class PublicFormResponseDto extends (0,swagger_.PickType)(FormResponseDto, [
|
|
781
|
+
'id',
|
|
782
|
+
'name',
|
|
783
|
+
'description',
|
|
784
|
+
'schema',
|
|
785
|
+
'schemaVersion'
|
|
786
|
+
]) {
|
|
787
|
+
}
|
|
788
|
+
class FormAccessInfoResponseDto extends (0,swagger_.PickType)(FormResponseDto, [
|
|
789
|
+
'id',
|
|
790
|
+
'name',
|
|
791
|
+
'description',
|
|
792
|
+
'accessType',
|
|
793
|
+
'actionGroups',
|
|
794
|
+
'isActive'
|
|
795
|
+
]) {
|
|
796
|
+
}
|
|
797
|
+
|
|
798
|
+
// EXTERNAL MODULE: ./projects/nestjs-form-builder/src/dtos/form-result.dto.ts
|
|
799
|
+
var form_result_dto = __webpack_require__(788);
|
|
800
|
+
;// CONCATENATED MODULE: ./projects/nestjs-form-builder/src/dtos/index.ts
|
|
801
|
+
|
|
802
|
+
|
|
803
|
+
|
|
804
|
+
|
|
805
|
+
},
|
|
806
|
+
|
|
807
|
+
};
|