@flusys/nestjs-form-builder 5.0.3 → 5.0.4
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/cjs/controllers/form-result.controller.js +1 -1
- package/cjs/controllers/form.controller.js +2 -2
- package/cjs/services/form-result.service.js +4 -4
- package/cjs/services/form.service.js +3 -3
- package/fesm/controllers/form-result.controller.js +2 -2
- package/fesm/controllers/form.controller.js +3 -3
- package/fesm/services/form-result.service.js +5 -5
- package/fesm/services/form.service.js +4 -4
- package/package.json +3 -3
- package/services/form-result.service.d.ts +4 -4
- package/services/form.service.d.ts +4 -4
|
@@ -237,7 +237,7 @@ _ts_decorate([
|
|
|
237
237
|
], FormResultController.prototype, "updateDraft", null);
|
|
238
238
|
_ts_decorate([
|
|
239
239
|
(0, _common.Post)('by-form'),
|
|
240
|
-
(0, _common.UseGuards)(_guards.JwtAuthGuard),
|
|
240
|
+
(0, _common.UseGuards)(_guards.JwtAuthGuard, _guards.PermissionGuard),
|
|
241
241
|
(0, _swagger.ApiBearerAuth)(),
|
|
242
242
|
(0, _decorators.RequirePermission)(_classes.FORM_RESULT_PERMISSIONS.READ),
|
|
243
243
|
(0, _common.HttpCode)(_common.HttpStatus.OK),
|
|
@@ -14,8 +14,8 @@ const _guards = require("@flusys/nestjs-shared/guards");
|
|
|
14
14
|
const _interfaces = require("@flusys/nestjs-shared/interfaces");
|
|
15
15
|
const _common = require("@nestjs/common");
|
|
16
16
|
const _swagger = require("@nestjs/swagger");
|
|
17
|
-
const _dtos = require("../dtos");
|
|
18
17
|
const _config = require("../config");
|
|
18
|
+
const _dtos = require("../dtos");
|
|
19
19
|
const _formservice = require("../services/form.service");
|
|
20
20
|
function _define_property(obj, key, value) {
|
|
21
21
|
if (key in obj) {
|
|
@@ -190,7 +190,7 @@ _ts_decorate([
|
|
|
190
190
|
], FormController.prototype, "getAuthenticatedForm", null);
|
|
191
191
|
_ts_decorate([
|
|
192
192
|
(0, _common.Post)('by-slug/:slug'),
|
|
193
|
-
(0, _common.UseGuards)(_guards.JwtAuthGuard),
|
|
193
|
+
(0, _common.UseGuards)(_guards.JwtAuthGuard, _guards.PermissionGuard),
|
|
194
194
|
(0, _swagger.ApiBearerAuth)(),
|
|
195
195
|
(0, _decorators.RequirePermission)(_classes.FORM_PERMISSIONS.READ),
|
|
196
196
|
(0, _common.HttpCode)(_common.HttpStatus.OK),
|
|
@@ -9,19 +9,19 @@ Object.defineProperty(exports, "FormResultService", {
|
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
11
|
const _classes = require("@flusys/nestjs-shared/classes");
|
|
12
|
-
const _config = require("../config");
|
|
13
12
|
const _decorators = require("@flusys/nestjs-shared/decorators");
|
|
14
13
|
const _interfaces = require("@flusys/nestjs-shared/interfaces");
|
|
15
14
|
const _modules = require("@flusys/nestjs-shared/modules");
|
|
16
15
|
const _common = require("@nestjs/common");
|
|
17
16
|
const _typeorm = require("typeorm");
|
|
18
|
-
const
|
|
17
|
+
const _config = require("../config");
|
|
19
18
|
const _formresultdto = require("../dtos/form-result.dto");
|
|
20
19
|
const _entities = require("../entities");
|
|
21
20
|
const _formaccesstypeenum = require("../enums/form-access-type.enum");
|
|
22
|
-
const _formbuilderdatasourceprovider = require("./form-builder-datasource.provider");
|
|
23
|
-
const _permissionutils = require("../utils/permission.utils");
|
|
24
21
|
const _computedfieldutils = require("../utils/computed-field.utils");
|
|
22
|
+
const _permissionutils = require("../utils/permission.utils");
|
|
23
|
+
const _formbuilderconfigservice = require("./form-builder-config.service");
|
|
24
|
+
const _formbuilderdatasourceprovider = require("./form-builder-datasource.provider");
|
|
25
25
|
function _define_property(obj, key, value) {
|
|
26
26
|
if (key in obj) {
|
|
27
27
|
Object.defineProperty(obj, key, {
|
|
@@ -9,16 +9,16 @@ Object.defineProperty(exports, "FormService", {
|
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
11
|
const _classes = require("@flusys/nestjs-shared/classes");
|
|
12
|
-
const _config = require("../config");
|
|
13
12
|
const _modules = require("@flusys/nestjs-shared/modules");
|
|
14
13
|
const _utils = require("@flusys/nestjs-shared/utils");
|
|
15
14
|
const _common = require("@nestjs/common");
|
|
16
15
|
const _typeorm = require("typeorm");
|
|
17
|
-
const
|
|
16
|
+
const _config = require("../config");
|
|
18
17
|
const _entities = require("../entities");
|
|
19
18
|
const _formaccesstypeenum = require("../enums/form-access-type.enum");
|
|
20
|
-
const _formbuilderdatasourceprovider = require("./form-builder-datasource.provider");
|
|
21
19
|
const _permissionutils = require("../utils/permission.utils");
|
|
20
|
+
const _formbuilderconfigservice = require("./form-builder-config.service");
|
|
21
|
+
const _formbuilderdatasourceprovider = require("./form-builder-datasource.provider");
|
|
22
22
|
function _define_property(obj, key, value) {
|
|
23
23
|
if (key in obj) {
|
|
24
24
|
Object.defineProperty(obj, key, {
|
|
@@ -27,7 +27,7 @@ function _ts_param(paramIndex, decorator) {
|
|
|
27
27
|
}
|
|
28
28
|
import { createApiController, FORM_RESULT_PERMISSIONS } from '@flusys/nestjs-shared/classes';
|
|
29
29
|
import { CurrentUser, Public, RequirePermission } from '@flusys/nestjs-shared/decorators';
|
|
30
|
-
import { JwtAuthGuard } from '@flusys/nestjs-shared/guards';
|
|
30
|
+
import { JwtAuthGuard, PermissionGuard } from '@flusys/nestjs-shared/guards';
|
|
31
31
|
import { ILoggedUserInfo } from '@flusys/nestjs-shared/interfaces';
|
|
32
32
|
import { Body, Controller, HttpCode, HttpStatus, Inject, Post, UseGuards } from '@nestjs/common';
|
|
33
33
|
import { ApiBearerAuth, ApiOperation, ApiTags } from '@nestjs/swagger';
|
|
@@ -227,7 +227,7 @@ _ts_decorate([
|
|
|
227
227
|
], FormResultController.prototype, "updateDraft", null);
|
|
228
228
|
_ts_decorate([
|
|
229
229
|
Post('by-form'),
|
|
230
|
-
UseGuards(JwtAuthGuard),
|
|
230
|
+
UseGuards(JwtAuthGuard, PermissionGuard),
|
|
231
231
|
ApiBearerAuth(),
|
|
232
232
|
RequirePermission(FORM_RESULT_PERMISSIONS.READ),
|
|
233
233
|
HttpCode(HttpStatus.OK),
|
|
@@ -27,12 +27,12 @@ function _ts_param(paramIndex, decorator) {
|
|
|
27
27
|
}
|
|
28
28
|
import { createApiController, FORM_PERMISSIONS } from '@flusys/nestjs-shared/classes';
|
|
29
29
|
import { CurrentUser, Public, RequirePermission } from '@flusys/nestjs-shared/decorators';
|
|
30
|
-
import { JwtAuthGuard } from '@flusys/nestjs-shared/guards';
|
|
30
|
+
import { JwtAuthGuard, PermissionGuard } from '@flusys/nestjs-shared/guards';
|
|
31
31
|
import { ILoggedUserInfo } from '@flusys/nestjs-shared/interfaces';
|
|
32
32
|
import { Controller, HttpCode, HttpStatus, Inject, Param, Post, UseGuards } from '@nestjs/common';
|
|
33
33
|
import { ApiBearerAuth, ApiOperation, ApiTags } from '@nestjs/swagger';
|
|
34
|
-
import { CreateFormDto, FormResponseDto, UpdateFormDto } from '../dtos';
|
|
35
34
|
import { FORM_MESSAGES } from '../config';
|
|
35
|
+
import { CreateFormDto, FormResponseDto, UpdateFormDto } from '../dtos';
|
|
36
36
|
import { FormService } from '../services/form.service';
|
|
37
37
|
export class FormController extends createApiController(CreateFormDto, UpdateFormDto, FormResponseDto, {
|
|
38
38
|
entityName: 'form',
|
|
@@ -180,7 +180,7 @@ _ts_decorate([
|
|
|
180
180
|
], FormController.prototype, "getAuthenticatedForm", null);
|
|
181
181
|
_ts_decorate([
|
|
182
182
|
Post('by-slug/:slug'),
|
|
183
|
-
UseGuards(JwtAuthGuard),
|
|
183
|
+
UseGuards(JwtAuthGuard, PermissionGuard),
|
|
184
184
|
ApiBearerAuth(),
|
|
185
185
|
RequirePermission(FORM_PERMISSIONS.READ),
|
|
186
186
|
HttpCode(HttpStatus.OK),
|
|
@@ -25,20 +25,20 @@ function _ts_param(paramIndex, decorator) {
|
|
|
25
25
|
decorator(target, key, paramIndex);
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
|
-
import {
|
|
29
|
-
import { FORM_MESSAGES, FORM_RESULT_MESSAGES } from '../config';
|
|
28
|
+
import { HybridCache, RequestScopedApiService } from '@flusys/nestjs-shared/classes';
|
|
30
29
|
import { LogAction } from '@flusys/nestjs-shared/decorators';
|
|
31
30
|
import { ILoggedUserInfo } from '@flusys/nestjs-shared/interfaces';
|
|
32
31
|
import { UtilsService } from '@flusys/nestjs-shared/modules';
|
|
33
32
|
import { BadRequestException, ForbiddenException, Inject, Injectable, NotFoundException, Scope, UnauthorizedException } from '@nestjs/common';
|
|
34
33
|
import { IsNull } from 'typeorm';
|
|
35
|
-
import {
|
|
34
|
+
import { FORM_MESSAGES, FORM_RESULT_MESSAGES } from '../config';
|
|
36
35
|
import { SubmitFormDto } from '../dtos/form-result.dto';
|
|
37
36
|
import { Form, FormResult, FormWithCompany } from '../entities';
|
|
38
37
|
import { FormAccessType } from '../enums/form-access-type.enum';
|
|
39
|
-
import { FormBuilderDataSourceProvider } from './form-builder-datasource.provider';
|
|
40
|
-
import { validateUserPermissions } from '../utils/permission.utils';
|
|
41
38
|
import { calculateComputedFields } from '../utils/computed-field.utils';
|
|
39
|
+
import { validateUserPermissions } from '../utils/permission.utils';
|
|
40
|
+
import { FormBuilderConfigService } from './form-builder-config.service';
|
|
41
|
+
import { FormBuilderDataSourceProvider } from './form-builder-datasource.provider';
|
|
42
42
|
export class FormResultService extends RequestScopedApiService {
|
|
43
43
|
resolveEntity() {
|
|
44
44
|
return FormResult;
|
|
@@ -25,17 +25,17 @@ function _ts_param(paramIndex, decorator) {
|
|
|
25
25
|
decorator(target, key, paramIndex);
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
|
-
import {
|
|
29
|
-
import { FORM_MESSAGES } from '../config';
|
|
28
|
+
import { HybridCache, RequestScopedApiService } from '@flusys/nestjs-shared/classes';
|
|
30
29
|
import { UtilsService } from '@flusys/nestjs-shared/modules';
|
|
31
30
|
import { applyCompanyFilter } from '@flusys/nestjs-shared/utils';
|
|
32
31
|
import { BadRequestException, ForbiddenException, Inject, Injectable, NotFoundException, Scope, UnauthorizedException } from '@nestjs/common';
|
|
33
32
|
import { IsNull } from 'typeorm';
|
|
34
|
-
import {
|
|
33
|
+
import { FORM_MESSAGES } from '../config';
|
|
35
34
|
import { Form, FormWithCompany } from '../entities';
|
|
36
35
|
import { FormAccessType } from '../enums/form-access-type.enum';
|
|
37
|
-
import { FormBuilderDataSourceProvider } from './form-builder-datasource.provider';
|
|
38
36
|
import { validateUserPermissions } from '../utils/permission.utils';
|
|
37
|
+
import { FormBuilderConfigService } from './form-builder-config.service';
|
|
38
|
+
import { FormBuilderDataSourceProvider } from './form-builder-datasource.provider';
|
|
39
39
|
export class FormService extends RequestScopedApiService {
|
|
40
40
|
resolveEntity() {
|
|
41
41
|
const enableCompanyFeature = this.formBuilderConfig.isCompanyFeatureEnabled();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flusys/nestjs-form-builder",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.4",
|
|
4
4
|
"description": "Dynamic form builder module with schema versioning and access control",
|
|
5
5
|
"main": "cjs/index.js",
|
|
6
6
|
"module": "fesm/index.js",
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
"express": "^4.18.0"
|
|
85
85
|
},
|
|
86
86
|
"dependencies": {
|
|
87
|
-
"@flusys/nestjs-core": "5.0.
|
|
88
|
-
"@flusys/nestjs-shared": "5.0.
|
|
87
|
+
"@flusys/nestjs-core": "5.0.4",
|
|
88
|
+
"@flusys/nestjs-shared": "5.0.4"
|
|
89
89
|
}
|
|
90
90
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { HybridCache, RequestScopedApiService } from '@flusys/nestjs-shared/classes';
|
|
2
2
|
import { FilterAndPaginationDto } from '@flusys/nestjs-shared/dtos';
|
|
3
3
|
import { ILoggedUserInfo } from '@flusys/nestjs-shared/interfaces';
|
|
4
4
|
import { UtilsService } from '@flusys/nestjs-shared/modules';
|
|
5
|
-
import { EntityTarget,
|
|
6
|
-
import { FormBuilderConfigService } from './form-builder-config.service';
|
|
5
|
+
import { EntityTarget, SelectQueryBuilder } from 'typeorm';
|
|
7
6
|
import { CreateFormResultDto, SubmitFormDto, UpdateFormResultDto } from '../dtos/form-result.dto';
|
|
8
7
|
import { FormResult } from '../entities';
|
|
9
8
|
import { IFormResult } from '../interfaces/form-result.interface';
|
|
9
|
+
import { FormBuilderConfigService } from './form-builder-config.service';
|
|
10
10
|
import { FormBuilderDataSourceProvider } from './form-builder-datasource.provider';
|
|
11
|
-
export declare class FormResultService extends RequestScopedApiService<CreateFormResultDto, UpdateFormResultDto, IFormResult, FormResult
|
|
11
|
+
export declare class FormResultService extends RequestScopedApiService<CreateFormResultDto, UpdateFormResultDto, IFormResult, FormResult> {
|
|
12
12
|
protected cacheManager: HybridCache;
|
|
13
13
|
protected utilsService: UtilsService;
|
|
14
14
|
private readonly formBuilderConfig;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { HybridCache, RequestScopedApiService } from '@flusys/nestjs-shared/classes';
|
|
2
2
|
import { FilterAndPaginationDto } from '@flusys/nestjs-shared/dtos';
|
|
3
3
|
import { ILoggedUserInfo } from '@flusys/nestjs-shared/interfaces';
|
|
4
4
|
import { UtilsService } from '@flusys/nestjs-shared/modules';
|
|
5
|
-
import { EntityTarget,
|
|
6
|
-
import { FormBuilderConfigService } from './form-builder-config.service';
|
|
5
|
+
import { EntityTarget, SelectQueryBuilder } from 'typeorm';
|
|
7
6
|
import { CreateFormDto, UpdateFormDto } from '../dtos/form.dto';
|
|
8
7
|
import { Form } from '../entities';
|
|
9
8
|
import { FormAccessType } from '../enums/form-access-type.enum';
|
|
10
9
|
import { IForm, IPublicForm } from '../interfaces/form.interface';
|
|
10
|
+
import { FormBuilderConfigService } from './form-builder-config.service';
|
|
11
11
|
import { FormBuilderDataSourceProvider } from './form-builder-datasource.provider';
|
|
12
|
-
export declare class FormService extends RequestScopedApiService<CreateFormDto, UpdateFormDto, IForm, Form
|
|
12
|
+
export declare class FormService extends RequestScopedApiService<CreateFormDto, UpdateFormDto, IForm, Form> {
|
|
13
13
|
protected cacheManager: HybridCache;
|
|
14
14
|
protected utilsService: UtilsService;
|
|
15
15
|
private readonly formBuilderConfig;
|