rez_core 1.0.26 → 1.0.28
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/.idea/250218_nodejs_core.iml +12 -0
- package/.idea/codeStyles/Project.xml +59 -0
- package/.idea/codeStyles/codeStyleConfig.xml +5 -0
- package/.idea/dataSources.xml +12 -0
- package/.idea/modules.xml +8 -0
- package/.idea/prettier.xml +6 -0
- package/.idea/vcs.xml +6 -0
- package/dist/app.module.d.ts +0 -0
- package/dist/app.module.js +1 -0
- package/dist/app.module.js.map +1 -0
- package/dist/config/database.config.d.ts +3 -0
- package/dist/config/database.config.js +14 -6
- package/dist/config/database.config.js.map +1 -1
- package/dist/constant/global.constant.d.ts +6 -2
- package/dist/constant/global.constant.js +7 -3
- package/dist/constant/global.constant.js.map +1 -1
- package/dist/core.module.js +5 -2
- package/dist/core.module.js.map +1 -1
- package/dist/main.js +2 -1
- package/dist/main.js.map +1 -1
- package/dist/module/auth/auth.module.js +1 -1
- package/dist/module/auth/auth.module.js.map +1 -1
- package/dist/module/auth/guards/role.guard.js +3 -3
- package/dist/module/auth/strategies/google.strategy.d.ts +3 -1
- package/dist/module/auth/strategies/google.strategy.js +7 -5
- package/dist/module/auth/strategies/google.strategy.js.map +1 -1
- package/dist/module/auth/strategies/jwt.strategy.d.ts +4 -4
- package/dist/module/auth/strategies/jwt.strategy.js +8 -9
- package/dist/module/auth/strategies/jwt.strategy.js.map +1 -1
- package/dist/module/layout/controller/layout.controller.d.ts +11 -0
- package/dist/module/layout/controller/layout.controller.js +61 -0
- package/dist/module/layout/controller/layout.controller.js.map +1 -0
- package/dist/module/layout/dto/header.dto.d.ts +0 -0
- package/dist/module/layout/dto/header.dto.js +1 -0
- package/dist/module/layout/dto/header.dto.js.map +1 -0
- package/dist/module/layout/entity/header-items.entity.d.ts +10 -0
- package/dist/module/layout/entity/header-items.entity.js +52 -0
- package/dist/module/layout/entity/header-items.entity.js.map +1 -0
- package/dist/module/layout/entity/header-section.entity.d.ts +7 -0
- package/dist/module/layout/entity/header-section.entity.js +40 -0
- package/dist/module/layout/entity/header-section.entity.js.map +1 -0
- package/dist/module/layout/layout.module.d.ts +2 -0
- package/dist/module/layout/layout.module.js +30 -0
- package/dist/module/layout/layout.module.js.map +1 -0
- package/dist/module/layout/repository/header-items.repository.d.ts +7 -0
- package/dist/module/layout/repository/header-items.repository.js +36 -0
- package/dist/module/layout/repository/header-items.repository.js.map +1 -0
- package/dist/module/layout/repository/header-section.repository.d.ts +7 -0
- package/dist/module/layout/repository/header-section.repository.js +36 -0
- package/dist/module/layout/repository/header-section.repository.js.map +1 -0
- package/dist/module/layout/service/header-section.service.d.ts +8 -0
- package/dist/module/layout/service/header-section.service.js +37 -0
- package/dist/module/layout/service/header-section.service.js.map +1 -0
- package/dist/module/meta/entity/base-entity.entity.d.ts +1 -2
- package/dist/module/meta/entity/base-entity.entity.js +1 -2
- package/dist/module/meta/entity/base-entity.entity.js.map +1 -1
- package/dist/module/meta/entity/entity-master.entity.d.ts +1 -0
- package/dist/module/meta/entity/entity-master.entity.js +4 -0
- package/dist/module/meta/entity/entity-master.entity.js.map +1 -1
- package/dist/module/meta/entity/media-data.entity.d.ts +11 -0
- package/dist/module/meta/entity/media-data.entity.js +55 -0
- package/dist/module/meta/entity/media-data.entity.js.map +1 -0
- package/dist/module/meta/entity.module.js +8 -1
- package/dist/module/meta/entity.module.js.map +1 -1
- package/dist/module/meta/repository/media-data.repository.d.ts +9 -0
- package/dist/module/meta/repository/media-data.repository.js +55 -0
- package/dist/module/meta/repository/media-data.repository.js.map +1 -0
- package/dist/module/meta/service/entity-list.service.d.ts +1 -0
- package/dist/module/meta/service/entity-list.service.js +14 -2
- package/dist/module/meta/service/entity-list.service.js.map +1 -1
- package/dist/module/meta/service/entity-service-impl.service.d.ts +1 -1
- package/dist/module/meta/service/entity-service-impl.service.js +21 -4
- package/dist/module/meta/service/entity-service-impl.service.js.map +1 -1
- package/dist/module/meta/service/media-data.service.d.ts +9 -0
- package/dist/module/meta/service/media-data.service.js +36 -0
- package/dist/module/meta/service/media-data.service.js.map +1 -0
- package/dist/module/module/entity/menu.entity.d.ts +1 -2
- package/dist/module/module/entity/menu.entity.js +1 -2
- package/dist/module/module/entity/menu.entity.js.map +1 -1
- package/dist/module/module/entity/module.entity.d.ts +1 -2
- package/dist/module/module/entity/module.entity.js +1 -2
- package/dist/module/module/entity/module.entity.js.map +1 -1
- package/dist/module/notification/controller/otp.controller.d.ts +5 -3
- package/dist/module/notification/controller/otp.controller.js +7 -4
- package/dist/module/notification/controller/otp.controller.js.map +1 -1
- package/dist/module/notification/service/otp.service.d.ts +5 -3
- package/dist/module/notification/service/otp.service.js +7 -4
- package/dist/module/notification/service/otp.service.js.map +1 -1
- package/dist/module/user/service/login.service.d.ts +3 -1
- package/dist/module/user/service/login.service.js +7 -5
- package/dist/module/user/service/login.service.js.map +1 -1
- package/dist/module/user/service/user.service.d.ts +5 -3
- package/dist/module/user/service/user.service.js +10 -6
- package/dist/module/user/service/user.service.js.map +1 -1
- package/dist/resources/dev.properties.yaml +15 -0
- package/dist/resources/properties.module.d.ts +2 -0
- package/dist/resources/properties.module.js +25 -0
- package/dist/resources/properties.module.js.map +1 -0
- package/dist/resources/properties.yaml.d.ts +2 -0
- package/dist/resources/properties.yaml.js +10 -0
- package/dist/resources/properties.yaml.js.map +1 -0
- package/dist/resources/uat.properties.yaml +15 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/nest-cli.json +6 -0
- package/package.json +1 -1
- package/src/app.module.ts +0 -0
- package/src/config/database.config.ts +10 -5
- package/src/constant/global.constant.ts +13 -4
- package/src/core.module.ts +5 -2
- package/src/module/auth/auth.module.ts +3 -2
- package/src/module/auth/guards/jwt.guard.ts +22 -22
- package/src/module/auth/guards/role.guard.ts +68 -68
- package/src/module/auth/services/auth.service.ts +29 -29
- package/src/module/auth/services/jwt.service.ts +11 -11
- package/src/module/auth/strategies/google.strategy.ts +7 -4
- package/src/module/auth/strategies/jwt.strategy.ts +5 -6
- package/src/module/auth/strategies/local.strategy.ts +13 -13
- package/src/module/dev/dev.module.ts +12 -12
- package/src/module/dev/service/dev.service.ts +7 -7
- package/src/module/enterprise/entity/enterprise.entity.ts +37 -37
- package/src/module/enterprise/entity/organization.entity.ts +80 -80
- package/src/module/layout/controller/layout.controller.ts +32 -0
- package/src/module/layout/dto/header.dto.ts +0 -0
- package/src/module/layout/entity/header-items.entity.ts +28 -0
- package/src/module/layout/entity/header-section.entity.ts +19 -0
- package/src/module/layout/layout.module.ts +17 -0
- package/src/module/layout/repository/header-items.repository.ts +18 -0
- package/src/module/layout/repository/header-section.repository.ts +18 -0
- package/src/module/layout/service/header-section.service.ts +26 -0
- package/src/module/master/controller/master.controller.ts +22 -22
- package/src/module/meta/dto/entity-list-data.dto.ts +6 -6
- package/src/module/meta/entity/attribute-master.entity.ts +67 -67
- package/src/module/meta/entity/base-entity.entity.ts +1 -2
- package/src/module/meta/entity/entity-master.entity.ts +3 -0
- package/src/module/meta/entity/media-data.entity.ts +32 -0
- package/src/module/meta/entity/preference.entity.ts +65 -65
- package/src/module/meta/entity.module.ts +8 -1
- package/src/module/meta/repository/attribute-master.repository.ts +28 -28
- package/src/module/meta/repository/media-data.repository.ts +50 -0
- package/src/module/meta/repository/preference.repository.ts +20 -20
- package/src/module/meta/service/entity-list.service.ts +21 -2
- package/src/module/meta/service/entity-service-impl.service.ts +36 -11
- package/src/module/meta/service/media-data.service.ts +44 -0
- package/src/module/module/controller/menu.controller.ts +15 -15
- package/src/module/module/entity/menu.entity.ts +1 -2
- package/src/module/module/entity/module-access.entity.ts +22 -22
- package/src/module/module/entity/module-action.entity.ts +19 -19
- package/src/module/module/entity/module.entity.ts +1 -2
- package/src/module/notification/controller/otp.controller.ts +8 -3
- package/src/module/notification/service/otp.service.ts +6 -3
- package/src/module/user/controller/user.controller.ts +28 -28
- package/src/module/user/dto/update-user.dto.ts +4 -4
- package/src/module/user/entity/user-role-mapping.entity.ts +21 -21
- package/src/module/user/entity/user-session.entity.ts +61 -61
- package/src/module/user/entity/user.entity.ts +35 -35
- package/src/module/user/repository/role.repository.ts +16 -16
- package/src/module/user/repository/userSession.repository.ts +33 -33
- package/src/module/user/service/login.service.ts +7 -5
- package/src/module/user/service/user.service.ts +10 -7
- package/src/resources/dev.properties.yaml +15 -0
- package/src/resources/properties.module.ts +12 -0
- package/src/resources/properties.yaml.ts +11 -0
- package/src/resources/uat.properties.yaml +15 -0
- package/src/utils/service/encryptUtil.service.ts +97 -97
- package/src/utils/service/excelUtil.service.ts +15 -15
- package/src/utils/service/reflection-helper.service.ts +53 -53
- package/.env +0 -10
- package/dist/constant/status.constant.d.ts +0 -4
- package/dist/constant/status.constant.js +0 -9
- package/dist/constant/status.constant.js.map +0 -1
- package/src/constant/status.constant.ts +0 -3
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<module type="WEB_MODULE" version="4">
|
|
3
|
+
<component name="NewModuleRootManager">
|
|
4
|
+
<content url="file://$MODULE_DIR$">
|
|
5
|
+
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
|
|
6
|
+
<excludeFolder url="file://$MODULE_DIR$/temp" />
|
|
7
|
+
<excludeFolder url="file://$MODULE_DIR$/tmp" />
|
|
8
|
+
</content>
|
|
9
|
+
<orderEntry type="inheritedJdk" />
|
|
10
|
+
<orderEntry type="sourceFolder" forTests="false" />
|
|
11
|
+
</component>
|
|
12
|
+
</module>
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
<component name="ProjectCodeStyleConfiguration">
|
|
2
|
+
<code_scheme name="Project" version="173">
|
|
3
|
+
<HTMLCodeStyleSettings>
|
|
4
|
+
<option name="HTML_SPACE_INSIDE_EMPTY_TAG" value="true" />
|
|
5
|
+
</HTMLCodeStyleSettings>
|
|
6
|
+
<JSCodeStyleSettings version="0">
|
|
7
|
+
<option name="FORCE_SEMICOLON_STYLE" value="true" />
|
|
8
|
+
<option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" />
|
|
9
|
+
<option name="USE_DOUBLE_QUOTES" value="false" />
|
|
10
|
+
<option name="FORCE_QUOTE_STYlE" value="true" />
|
|
11
|
+
<option name="ENFORCE_TRAILING_COMMA" value="WhenMultiline" />
|
|
12
|
+
<option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
|
|
13
|
+
<option name="SPACES_WITHIN_IMPORTS" value="true" />
|
|
14
|
+
</JSCodeStyleSettings>
|
|
15
|
+
<TypeScriptCodeStyleSettings version="0">
|
|
16
|
+
<option name="FORCE_SEMICOLON_STYLE" value="true" />
|
|
17
|
+
<option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" />
|
|
18
|
+
<option name="USE_DOUBLE_QUOTES" value="false" />
|
|
19
|
+
<option name="FORCE_QUOTE_STYlE" value="true" />
|
|
20
|
+
<option name="ENFORCE_TRAILING_COMMA" value="WhenMultiline" />
|
|
21
|
+
<option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
|
|
22
|
+
<option name="SPACES_WITHIN_IMPORTS" value="true" />
|
|
23
|
+
</TypeScriptCodeStyleSettings>
|
|
24
|
+
<VueCodeStyleSettings>
|
|
25
|
+
<option name="INTERPOLATION_NEW_LINE_AFTER_START_DELIMITER" value="false" />
|
|
26
|
+
<option name="INTERPOLATION_NEW_LINE_BEFORE_END_DELIMITER" value="false" />
|
|
27
|
+
</VueCodeStyleSettings>
|
|
28
|
+
<codeStyleSettings language="HTML">
|
|
29
|
+
<option name="SOFT_MARGINS" value="80" />
|
|
30
|
+
<indentOptions>
|
|
31
|
+
<option name="INDENT_SIZE" value="2" />
|
|
32
|
+
<option name="CONTINUATION_INDENT_SIZE" value="2" />
|
|
33
|
+
<option name="TAB_SIZE" value="2" />
|
|
34
|
+
</indentOptions>
|
|
35
|
+
</codeStyleSettings>
|
|
36
|
+
<codeStyleSettings language="JavaScript">
|
|
37
|
+
<option name="SOFT_MARGINS" value="80" />
|
|
38
|
+
<indentOptions>
|
|
39
|
+
<option name="INDENT_SIZE" value="2" />
|
|
40
|
+
<option name="CONTINUATION_INDENT_SIZE" value="2" />
|
|
41
|
+
<option name="TAB_SIZE" value="2" />
|
|
42
|
+
</indentOptions>
|
|
43
|
+
</codeStyleSettings>
|
|
44
|
+
<codeStyleSettings language="TypeScript">
|
|
45
|
+
<option name="SOFT_MARGINS" value="80" />
|
|
46
|
+
<indentOptions>
|
|
47
|
+
<option name="INDENT_SIZE" value="2" />
|
|
48
|
+
<option name="CONTINUATION_INDENT_SIZE" value="2" />
|
|
49
|
+
<option name="TAB_SIZE" value="2" />
|
|
50
|
+
</indentOptions>
|
|
51
|
+
</codeStyleSettings>
|
|
52
|
+
<codeStyleSettings language="Vue">
|
|
53
|
+
<option name="SOFT_MARGINS" value="80" />
|
|
54
|
+
<indentOptions>
|
|
55
|
+
<option name="CONTINUATION_INDENT_SIZE" value="2" />
|
|
56
|
+
</indentOptions>
|
|
57
|
+
</codeStyleSettings>
|
|
58
|
+
</code_scheme>
|
|
59
|
+
</component>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project version="4">
|
|
3
|
+
<component name="DataSourceManagerImpl" format="xml" multifile-model="true">
|
|
4
|
+
<data-source source="LOCAL" name="@localhost" uuid="9a102608-c415-4802-970e-769555981800">
|
|
5
|
+
<driver-ref>mysql.8</driver-ref>
|
|
6
|
+
<synchronize>true</synchronize>
|
|
7
|
+
<jdbc-driver>com.mysql.cj.jdbc.Driver</jdbc-driver>
|
|
8
|
+
<jdbc-url>jdbc:mysql://localhost:3306</jdbc-url>
|
|
9
|
+
<working-dir>$ProjectFileDir$</working-dir>
|
|
10
|
+
</data-source>
|
|
11
|
+
</component>
|
|
12
|
+
</project>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project version="4">
|
|
3
|
+
<component name="ProjectModuleManager">
|
|
4
|
+
<modules>
|
|
5
|
+
<module fileurl="file://$PROJECT_DIR$/.idea/250218_nodejs_core.iml" filepath="$PROJECT_DIR$/.idea/250218_nodejs_core.iml" />
|
|
6
|
+
</modules>
|
|
7
|
+
</component>
|
|
8
|
+
</project>
|
package/.idea/vcs.xml
ADDED
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=app.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app.module.js","sourceRoot":"","sources":["../src/app.module.ts"],"names":[],"mappings":""}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
import { ConfigService } from '@nestjs/config';
|
|
1
2
|
import { TypeOrmModuleOptions, TypeOrmOptionsFactory } from '@nestjs/typeorm';
|
|
2
3
|
export declare class MySqlConfiguration implements TypeOrmOptionsFactory {
|
|
4
|
+
private configService;
|
|
5
|
+
constructor(configService: ConfigService);
|
|
3
6
|
createTypeOrmOptions(): TypeOrmModuleOptions;
|
|
4
7
|
}
|
|
@@ -5,18 +5,25 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
5
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
6
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
7
|
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
8
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
12
|
exports.MySqlConfiguration = void 0;
|
|
10
13
|
const common_1 = require("@nestjs/common");
|
|
14
|
+
const config_1 = require("@nestjs/config");
|
|
11
15
|
let MySqlConfiguration = class MySqlConfiguration {
|
|
16
|
+
constructor(configService) {
|
|
17
|
+
this.configService = configService;
|
|
18
|
+
}
|
|
12
19
|
createTypeOrmOptions() {
|
|
13
20
|
return {
|
|
14
21
|
type: 'mysql',
|
|
15
|
-
host:
|
|
16
|
-
port: parseInt(
|
|
17
|
-
username:
|
|
18
|
-
password:
|
|
19
|
-
database:
|
|
22
|
+
host: this.configService.get('DB_HOST') || '13.234.25.234',
|
|
23
|
+
port: parseInt(this.configService.get('DB_PORT') || '3306', 10),
|
|
24
|
+
username: this.configService.get('DB_USER') || 'root',
|
|
25
|
+
password: this.configService.get('DB_PASS') || 'Rezolut@123',
|
|
26
|
+
database: this.configService.get('DB_NAME') || 'core',
|
|
20
27
|
entities: [__dirname + '/../module/**/*.entity.{ts,js}'],
|
|
21
28
|
synchronize: true,
|
|
22
29
|
autoLoadEntities: true,
|
|
@@ -25,6 +32,7 @@ let MySqlConfiguration = class MySqlConfiguration {
|
|
|
25
32
|
};
|
|
26
33
|
exports.MySqlConfiguration = MySqlConfiguration;
|
|
27
34
|
exports.MySqlConfiguration = MySqlConfiguration = __decorate([
|
|
28
|
-
(0, common_1.Injectable)()
|
|
35
|
+
(0, common_1.Injectable)(),
|
|
36
|
+
__metadata("design:paramtypes", [config_1.ConfigService])
|
|
29
37
|
], MySqlConfiguration);
|
|
30
38
|
//# sourceMappingURL=database.config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"database.config.js","sourceRoot":"","sources":["../../src/config/database.config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"database.config.js","sourceRoot":"","sources":["../../src/config/database.config.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,2CAA+C;AAIxC,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAE7B,YACU,aAA4B;QAA5B,kBAAa,GAAb,aAAa,CAAe;IACpC,CAAC;IAEH,oBAAoB;QAClB,OAAO;YACL,IAAI,EAAE,OAAO;YACb,IAAI,EAAG,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,SAAS,CAAC,IAAG,eAAe;YAC1D,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,MAAM,EAAE,EAAE,CAAC;YAC/D,QAAQ,EAAE,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,MAAM;YACrD,QAAQ,EAAE,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,aAAa;YAC5D,QAAQ,EAAE,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,MAAM;YACrD,QAAQ,EAAE,CAAC,SAAS,GAAG,gCAAgC,CAAC;YACxD,WAAW,EAAE,IAAI;YACjB,gBAAgB,EAAE,IAAI;SACvB,CAAC;IACJ,CAAC;CACF,CAAA;AAnBY,gDAAkB;6BAAlB,kBAAkB;IAD9B,IAAA,mBAAU,GAAE;qCAIc,sBAAa;GAH3B,kBAAkB,CAmB9B"}
|
|
@@ -4,6 +4,10 @@ export declare const ENTITYTYPE_ROLE = "ROL";
|
|
|
4
4
|
export declare const ENTITYTYPE_ENTITYTABLE = "ETB";
|
|
5
5
|
export declare const ENTITYTYPE_ENTITYTABLECOLUMN = "ETC";
|
|
6
6
|
export declare const ENTITYTYPE_PREFERENCEMASTER = "PRM";
|
|
7
|
-
export declare const
|
|
8
|
-
export declare const
|
|
7
|
+
export declare const ENTITYTYPE_VIEWMASTER = "VMS";
|
|
8
|
+
export declare const ENTITYTYPE_MEDIA = "MDA";
|
|
9
|
+
export declare const STORAGETYPE_SINGLEJSON = "singlejson";
|
|
10
|
+
export declare const STORAGETYPE_COLUMN = "column";
|
|
9
11
|
export declare const secretKey: string;
|
|
12
|
+
export declare const STATUS_ACTIVE = "ACTIVE";
|
|
13
|
+
export declare const STATUS_INACTIVE = "INACTIVE";
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.secretKey = exports.
|
|
3
|
+
exports.STATUS_INACTIVE = exports.STATUS_ACTIVE = exports.secretKey = exports.STORAGETYPE_COLUMN = exports.STORAGETYPE_SINGLEJSON = exports.ENTITYTYPE_MEDIA = exports.ENTITYTYPE_VIEWMASTER = exports.ENTITYTYPE_PREFERENCEMASTER = exports.ENTITYTYPE_ENTITYTABLECOLUMN = exports.ENTITYTYPE_ENTITYTABLE = exports.ENTITYTYPE_ROLE = exports.ENTITYTYPE_ENTITYMASTER = exports.ENTITYTYPE_USER = void 0;
|
|
4
4
|
exports.ENTITYTYPE_USER = 'USR';
|
|
5
5
|
exports.ENTITYTYPE_ENTITYMASTER = 'EMS';
|
|
6
6
|
exports.ENTITYTYPE_ROLE = 'ROL';
|
|
7
7
|
exports.ENTITYTYPE_ENTITYTABLE = 'ETB';
|
|
8
8
|
exports.ENTITYTYPE_ENTITYTABLECOLUMN = 'ETC';
|
|
9
9
|
exports.ENTITYTYPE_PREFERENCEMASTER = 'PRM';
|
|
10
|
-
exports.
|
|
11
|
-
exports.
|
|
10
|
+
exports.ENTITYTYPE_VIEWMASTER = 'VMS';
|
|
11
|
+
exports.ENTITYTYPE_MEDIA = 'MDA';
|
|
12
|
+
exports.STORAGETYPE_SINGLEJSON = 'singlejson';
|
|
13
|
+
exports.STORAGETYPE_COLUMN = 'column';
|
|
12
14
|
exports.secretKey = process.env.secret_key || '';
|
|
15
|
+
exports.STATUS_ACTIVE = 'ACTIVE';
|
|
16
|
+
exports.STATUS_INACTIVE = 'INACTIVE';
|
|
13
17
|
//# sourceMappingURL=global.constant.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"global.constant.js","sourceRoot":"","sources":["../../src/constant/global.constant.ts"],"names":[],"mappings":";;;AACa,QAAA,eAAe,GAAG,KAAK,CAAC;AACxB,QAAA,uBAAuB,GAAG,KAAK,CAAC;AAChC,QAAA,eAAe,GAAG,KAAK,CAAC;AACxB,QAAA,sBAAsB,GAAG,KAAK,CAAC;AAC/B,QAAA,4BAA4B,GAAG,KAAK,CAAC;AACrC,QAAA,2BAA2B,GAAG,KAAK,
|
|
1
|
+
{"version":3,"file":"global.constant.js","sourceRoot":"","sources":["../../src/constant/global.constant.ts"],"names":[],"mappings":";;;AACa,QAAA,eAAe,GAAG,KAAK,CAAC;AACxB,QAAA,uBAAuB,GAAG,KAAK,CAAC;AAChC,QAAA,eAAe,GAAG,KAAK,CAAC;AACxB,QAAA,sBAAsB,GAAG,KAAK,CAAC;AAC/B,QAAA,4BAA4B,GAAG,KAAK,CAAC;AACrC,QAAA,2BAA2B,GAAG,KAAK,CAAC;AACpC,QAAA,qBAAqB,GAAG,KAAK,CAAC;AAC9B,QAAA,gBAAgB,GAAG,KAAK,CAAC;AAEzB,QAAA,sBAAsB,GAAG,YAAY,CAAC;AACtC,QAAA,kBAAkB,GAAG,QAAQ,CAAC;AAG9B,QAAA,SAAS,GAAW,OAAO,CAAC,GAAG,CAAC,UAAU,IAAI,EAAE,CAAC;AAGjD,QAAA,aAAa,GAAG,QAAQ,CAAC;AACzB,QAAA,eAAe,GAAG,UAAU,CAAC"}
|
package/dist/core.module.js
CHANGED
|
@@ -16,6 +16,7 @@ const user_module_1 = require("./module/user/user.module");
|
|
|
16
16
|
const entity_module_1 = require("./module/meta/entity.module");
|
|
17
17
|
const module_module_1 = require("./module/module/module.module");
|
|
18
18
|
const notification_module_1 = require("./module/notification/notification.module");
|
|
19
|
+
const layout_module_1 = require("./module/layout/layout.module");
|
|
19
20
|
let CoreModule = CoreModule_1 = class CoreModule {
|
|
20
21
|
static forRootAsync(dbModule) {
|
|
21
22
|
if (!dbModule) {
|
|
@@ -31,7 +32,8 @@ let CoreModule = CoreModule_1 = class CoreModule {
|
|
|
31
32
|
utils_module_1.UtilsModule,
|
|
32
33
|
user_module_1.UserModule,
|
|
33
34
|
module_module_1.ModuleModule,
|
|
34
|
-
notification_module_1.NotificationModule
|
|
35
|
+
notification_module_1.NotificationModule,
|
|
36
|
+
layout_module_1.LayoutModule,
|
|
35
37
|
],
|
|
36
38
|
exports: [
|
|
37
39
|
config_1.ConfigModule,
|
|
@@ -41,7 +43,8 @@ let CoreModule = CoreModule_1 = class CoreModule {
|
|
|
41
43
|
utils_module_1.UtilsModule,
|
|
42
44
|
user_module_1.UserModule,
|
|
43
45
|
module_module_1.ModuleModule,
|
|
44
|
-
notification_module_1.NotificationModule
|
|
46
|
+
notification_module_1.NotificationModule,
|
|
47
|
+
layout_module_1.LayoutModule,
|
|
45
48
|
],
|
|
46
49
|
};
|
|
47
50
|
}
|
package/dist/core.module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.module.js","sourceRoot":"","sources":["../src/core.module.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,2CAA+D;AAC/D,2CAA8C;AAC9C,6EAAyE;AACzE,uDAAmD;AACnD,2DAAuD;AACvD,+DAA2D;AAC3D,iEAA6D;AAC7D,mFAA+E;
|
|
1
|
+
{"version":3,"file":"core.module.js","sourceRoot":"","sources":["../src/core.module.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,2CAA+D;AAC/D,2CAA8C;AAC9C,6EAAyE;AACzE,uDAAmD;AACnD,2DAAuD;AACvD,+DAA2D;AAC3D,iEAA6D;AAC7D,mFAA+E;AAC/E,iEAA6D;AAItD,IAAM,UAAU,kBAAhB,MAAM,UAAU;IACrB,MAAM,CAAC,YAAY,CAAC,QAAuB;QACzC,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,MAAM,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAC;QACvD,CAAC;QAED,OAAO;YACL,MAAM,EAAE,YAAU;YAClB,OAAO,EAAE;gBACP,qBAAY,CAAC,OAAO,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;gBACxC,QAAQ;gBACR,4BAAY;gBACZ,oCAAgB;gBAChB,0BAAW;gBACX,wBAAU;gBACV,4BAAY;gBACZ,wCAAkB;gBAClB,4BAAY;aACb;YACD,OAAO,EAAE;gBACP,qBAAY;gBACZ,QAAQ;gBACR,4BAAY;gBACZ,oCAAgB;gBAChB,0BAAW;gBACX,wBAAU;gBACV,4BAAY;gBACZ,wCAAkB;gBAClB,4BAAY;aACb;SACF,CAAC;IACJ,CAAC;CAEF,CAAA;AAjCY,gCAAU;qBAAV,UAAU;IAFtB,IAAA,eAAM,GAAE;IACR,IAAA,eAAM,EAAC,EAAE,CAAC;GACE,UAAU,CAiCtB"}
|
package/dist/main.js
CHANGED
|
@@ -23,6 +23,7 @@ async function bootstrap() {
|
|
|
23
23
|
exceptionFactory: (errors) => {
|
|
24
24
|
const firstError = errors[0];
|
|
25
25
|
return new common_1.BadRequestException({
|
|
26
|
+
success: false,
|
|
26
27
|
field: firstError.property,
|
|
27
28
|
message: firstError.constraints
|
|
28
29
|
? Object.values(firstError.constraints)[0]
|
|
@@ -30,7 +31,7 @@ async function bootstrap() {
|
|
|
30
31
|
});
|
|
31
32
|
},
|
|
32
33
|
}));
|
|
33
|
-
await app.listen(
|
|
34
|
+
await app.listen(3000);
|
|
34
35
|
}
|
|
35
36
|
bootstrap();
|
|
36
37
|
//# sourceMappingURL=main.js.map
|
package/dist/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.js","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":";;AAAA,uCAA2C;AAC3C,2CAAqE;AACrE,+CAA2C;AAC3C,6CAAgD;AAChD,mCAAgC;AAGhC,IAAA,eAAM,GAAE,CAAC;AAET,KAAK,UAAU,SAAS;IAEtB,MAAM,GAAG,GAAG,MAAM,kBAAW,CAAC,MAAM,CAClC,wBAAU,CAAC,YAAY,CACrB,uBAAa,CAAC,YAAY,CAAC;QACzB,UAAU,EAAE,GAAG,EAAE,CAAC,CAAC;YACjB,IAAI,EAAE,OAAO;YACb,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,OAAO,IAAI,WAAW;YACxC,IAAI,EAAE,MAAM,CAAC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,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,IAAI;YACzC,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,OAAO,IAAI,MAAM;YACvC,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,OAAO,IAAI,MAAM;YACvC,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,OAAO,IAAI,MAAM;YACvC,gBAAgB,EAAE,IAAI;YACtB,WAAW,EAAE,IAAI;SAClB,CAAC;KACH,CAAC,CACH,CACF,CAAC;IAEF,GAAG,CAAC,cAAc,CAChB,IAAI,uBAAc,CAAC;QACjB,gBAAgB,EAAE,CAAC,MAAM,EAAE,EAAE;YAC3B,MAAM,UAAU,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;YAE7B,OAAO,IAAI,4BAAmB,CAAC;gBAC7B,OAAO,EAAE,KAAK;gBACd,KAAK,EAAE,UAAU,CAAC,QAAQ;gBAC1B,OAAO,EAAE,UAAU,CAAC,WAAW;oBAC7B,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;oBAC1C,CAAC,CAAC,eAAe;aACpB,CAAC,CAAC;QACL,CAAC;KACF,CAAC,CACH,CAAC;IAEF,MAAM,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AACzB,CAAC;AAED,SAAS,EAAE,CAAC"}
|
|
@@ -30,7 +30,7 @@ exports.AuthModule = AuthModule = __decorate([
|
|
|
30
30
|
imports: [config_1.ConfigModule],
|
|
31
31
|
inject: [config_1.ConfigService],
|
|
32
32
|
useFactory: async (configService) => ({
|
|
33
|
-
secret: configService.get('
|
|
33
|
+
secret: configService.get('SECRET_KEY'),
|
|
34
34
|
signOptions: { expiresIn: '1800s' },
|
|
35
35
|
}),
|
|
36
36
|
}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.module.js","sourceRoot":"","sources":["../../../src/module/auth/auth.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,2CAA6D;AAC7D,qCAAwC;AACxC,6CAAgD;AAChD,4DAAwD;AACxD,wDAAwD;AACxD,kDAAkD;
|
|
1
|
+
{"version":3,"file":"auth.module.js","sourceRoot":"","sources":["../../../src/module/auth/auth.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,2CAA6D;AAC7D,qCAAwC;AACxC,6CAAgD;AAChD,4DAAwD;AACxD,wDAAwD;AACxD,kDAAkD;AAElD,+CAAkD;AAClD,4EAAiE;AACjE,kEAA8D;AAC9D,oDAAiD;AAyB1C,IAAM,UAAU,GAAhB,MAAM,UAAU;CAAG,CAAA;AAAb,gCAAU;qBAAV,UAAU;IAvBtB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,qBAAY;YACZ,yBAAc,CAAC,QAAQ,CAAC,EAAE,eAAe,EAAE,KAAK,EAAE,CAAC;YACnD,eAAS,CAAC,aAAa,CAAC;gBACtB,OAAO,EAAE,CAAC,qBAAY,CAAC;gBACvB,MAAM,EAAE,CAAC,sBAAa,CAAC;gBACvB,UAAU,EAAE,KAAK,EAAE,aAA4B,EAAE,EAAE,CAAC,CAAC;oBACnD,MAAM,EAAG,aAAa,CAAC,GAAG,CAAC,YAAY,CAAC;oBACxC,WAAW,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE;iBACpC,CAAC;aACH,CAAC;YACF,uBAAa,CAAC,UAAU,CAAC,CAAC,iCAAW,CAAC,CAAC;SACxC;QACD,SAAS,EAAE;YACT,4BAAc;YACd,0BAAW;YACX,wBAAY;YACZ,gCAAc;YACd,uBAAU;SACX;QACD,OAAO,EAAE,CAAC,4BAAc,EAAE,wBAAY,EAAE,uBAAU,CAAC;KACpD,CAAC;GACW,UAAU,CAAG"}
|
|
@@ -34,9 +34,9 @@ let RolesGuard = class RolesGuard {
|
|
|
34
34
|
}
|
|
35
35
|
const requiredModule = this.reflector.get('moduleCode', context.getHandler());
|
|
36
36
|
const requiredActions = this.reflector.get('actions', context.getHandler());
|
|
37
|
-
const roleAccess = await this.entityManager.query(`SELECT *
|
|
38
|
-
FROM cr_module_access
|
|
39
|
-
WHERE role_id = ${user['role_id']}
|
|
37
|
+
const roleAccess = await this.entityManager.query(`SELECT *
|
|
38
|
+
FROM cr_module_access
|
|
39
|
+
WHERE role_id = ${user['role_id']}
|
|
40
40
|
AND module_code = '${requiredModule}'`);
|
|
41
41
|
if (!roleAccess || roleAccess.length === 0) {
|
|
42
42
|
throw new common_1.ForbiddenException('Access denied: No permissions found for this module');
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { ConfigService } from '@nestjs/config';
|
|
1
2
|
import { VerifyCallback } from 'passport-google-oauth20';
|
|
2
3
|
declare const GoogleStrategy_base: new (...args: any) => any;
|
|
3
4
|
export declare class GoogleStrategy extends GoogleStrategy_base {
|
|
4
|
-
|
|
5
|
+
private configService;
|
|
6
|
+
constructor(configService: ConfigService);
|
|
5
7
|
validate(accessToken: string, refreshToken: string, profile: any, done: VerifyCallback): Promise<any>;
|
|
6
8
|
}
|
|
7
9
|
export {};
|
|
@@ -11,16 +11,18 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.GoogleStrategy = void 0;
|
|
13
13
|
const common_1 = require("@nestjs/common");
|
|
14
|
+
const config_1 = require("@nestjs/config");
|
|
14
15
|
const passport_1 = require("@nestjs/passport");
|
|
15
16
|
const passport_google_oauth20_1 = require("passport-google-oauth20");
|
|
16
17
|
let GoogleStrategy = class GoogleStrategy extends (0, passport_1.PassportStrategy)(passport_google_oauth20_1.Strategy, 'google') {
|
|
17
|
-
constructor() {
|
|
18
|
+
constructor(configService) {
|
|
18
19
|
super({
|
|
19
|
-
clientID:
|
|
20
|
-
clientSecret:
|
|
21
|
-
callbackURL:
|
|
20
|
+
clientID: configService.get('CLIENT_ID'),
|
|
21
|
+
clientSecret: configService.get('CLIENT_SECRET'),
|
|
22
|
+
callbackURL: configService.get('CALLBACK_URL'),
|
|
22
23
|
scope: ['email', 'profile'],
|
|
23
24
|
});
|
|
25
|
+
this.configService = configService;
|
|
24
26
|
}
|
|
25
27
|
async validate(accessToken, refreshToken, profile, done) {
|
|
26
28
|
const { emails, name } = profile;
|
|
@@ -31,6 +33,6 @@ let GoogleStrategy = class GoogleStrategy extends (0, passport_1.PassportStrateg
|
|
|
31
33
|
exports.GoogleStrategy = GoogleStrategy;
|
|
32
34
|
exports.GoogleStrategy = GoogleStrategy = __decorate([
|
|
33
35
|
(0, common_1.Injectable)(),
|
|
34
|
-
__metadata("design:paramtypes", [])
|
|
36
|
+
__metadata("design:paramtypes", [config_1.ConfigService])
|
|
35
37
|
], GoogleStrategy);
|
|
36
38
|
//# sourceMappingURL=google.strategy.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"google.strategy.js","sourceRoot":"","sources":["../../../../src/module/auth/strategies/google.strategy.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,+CAAoD;AACpD,qEAAmE;AAG5D,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,IAAA,2BAAgB,EAAC,kCAAQ,EAAE,QAAQ,CAAC;IACtE;
|
|
1
|
+
{"version":3,"file":"google.strategy.js","sourceRoot":"","sources":["../../../../src/module/auth/strategies/google.strategy.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,2CAA+C;AAC/C,+CAAoD;AACpD,qEAAmE;AAG5D,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,IAAA,2BAAgB,EAAC,kCAAQ,EAAE,QAAQ,CAAC;IACtE,YACU,aAA4B;QAEpC,KAAK,CAAC;YACJ,QAAQ,EAAE,aAAa,CAAC,GAAG,CAAC,WAAW,CAAC;YACxC,YAAY,EAAE,aAAa,CAAC,GAAG,CAAC,eAAe,CAAC;YAChD,WAAW,EAAC,aAAa,CAAC,GAAG,CAAC,cAAc,CAAC;YAC7C,KAAK,EAAE,CAAC,OAAO,EAAE,SAAS,CAAC;SAC5B,CAAC,CAAC;QAPK,kBAAa,GAAb,aAAa,CAAe;IAQtC,CAAC;IAED,KAAK,CAAC,QAAQ,CACZ,WAAmB,EACnB,YAAoB,EACpB,OAAY,EACZ,IAAoB;QAGpB,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;QACjC,MAAM,KAAK,GAAG,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC;QAGjC,OAAO,IAAI,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IACrC,CAAC;CACF,CAAA;AAzBY,wCAAc;yBAAd,cAAc;IAD1B,IAAA,mBAAU,GAAE;qCAGc,sBAAa;GAF3B,cAAc,CAyB1B"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { UserSession } from '../../../module/user/entity/user-session.entity';
|
|
1
|
+
import { UserSession } from 'src/module/user/entity/user-session.entity';
|
|
3
2
|
import { Repository } from 'typeorm';
|
|
3
|
+
import { ConfigService } from '@nestjs/config';
|
|
4
4
|
declare const JwtStrategy_base: new (...args: any) => any;
|
|
5
5
|
export declare class JwtStrategy extends JwtStrategy_base {
|
|
6
|
-
private readonly configService;
|
|
7
6
|
private userSessionRepository;
|
|
8
|
-
|
|
7
|
+
private configService;
|
|
8
|
+
constructor(userSessionRepository: Repository<UserSession>, configService: ConfigService);
|
|
9
9
|
validate(payload: any): Promise<{
|
|
10
10
|
userId: any;
|
|
11
11
|
sessionToken: any;
|
|
@@ -17,19 +17,18 @@ const passport_jwt_1 = require("passport-jwt");
|
|
|
17
17
|
const passport_1 = require("@nestjs/passport");
|
|
18
18
|
const common_1 = require("@nestjs/common");
|
|
19
19
|
const typeorm_1 = require("@nestjs/typeorm");
|
|
20
|
-
const
|
|
21
|
-
const user_session_entity_1 = require("../../../module/user/entity/user-session.entity");
|
|
20
|
+
const user_session_entity_1 = require("../../user/entity/user-session.entity");
|
|
22
21
|
const typeorm_2 = require("typeorm");
|
|
22
|
+
const config_1 = require("@nestjs/config");
|
|
23
23
|
let JwtStrategy = class JwtStrategy extends (0, passport_1.PassportStrategy)(passport_jwt_1.Strategy) {
|
|
24
|
-
constructor(
|
|
24
|
+
constructor(userSessionRepository, configService) {
|
|
25
25
|
super({
|
|
26
26
|
jwtFromRequest: passport_jwt_1.ExtractJwt.fromAuthHeaderAsBearerToken(),
|
|
27
27
|
ignoreExpiration: false,
|
|
28
|
-
secretOrKey: configService.get('
|
|
28
|
+
secretOrKey: configService.get('SECRET_KEY'),
|
|
29
29
|
});
|
|
30
|
-
this.configService = configService;
|
|
31
30
|
this.userSessionRepository = userSessionRepository;
|
|
32
|
-
|
|
31
|
+
this.configService = configService;
|
|
33
32
|
}
|
|
34
33
|
async validate(payload) {
|
|
35
34
|
const { userId, sessionToken } = payload;
|
|
@@ -47,8 +46,8 @@ let JwtStrategy = class JwtStrategy extends (0, passport_1.PassportStrategy)(pas
|
|
|
47
46
|
exports.JwtStrategy = JwtStrategy;
|
|
48
47
|
exports.JwtStrategy = JwtStrategy = __decorate([
|
|
49
48
|
(0, common_1.Injectable)(),
|
|
50
|
-
__param(
|
|
51
|
-
__metadata("design:paramtypes", [
|
|
52
|
-
|
|
49
|
+
__param(0, (0, typeorm_1.InjectRepository)(user_session_entity_1.UserSession)),
|
|
50
|
+
__metadata("design:paramtypes", [typeorm_2.Repository,
|
|
51
|
+
config_1.ConfigService])
|
|
53
52
|
], JwtStrategy);
|
|
54
53
|
//# sourceMappingURL=jwt.strategy.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jwt.strategy.js","sourceRoot":"","sources":["../../../../src/module/auth/strategies/jwt.strategy.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+CAAoD;AACpD,+CAAoD;AACpD,2CAAmE;
|
|
1
|
+
{"version":3,"file":"j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@@
|
|
|
1
|
+
import { HeaderSectionService } from '../service/header-section.service';
|
|
2
|
+
import { Request, Response } from 'express';
|
|
3
|
+
import { UserService } from '../../user/service/user.service';
|
|
4
|
+
export declare class LayoutController {
|
|
5
|
+
private readonly headerSectionService;
|
|
6
|
+
private readonly userService;
|
|
7
|
+
constructor(headerSectionService: HeaderSectionService, userService: UserService);
|
|
8
|
+
getHeader(req: Request & {
|
|
9
|
+
user: any;
|
|
10
|
+
}, res: Response): Promise<Response<any, Record<string, any>>>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.LayoutController = void 0;
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
17
|
+
const jwt_guard_1 = require("../../auth/guards/jwt.guard");
|
|
18
|
+
const header_section_service_1 = require("../service/header-section.service");
|
|
19
|
+
const user_service_1 = require("../../user/service/user.service");
|
|
20
|
+
const global_constant_1 = require("../../../constant/global.constant");
|
|
21
|
+
let LayoutController = class LayoutController {
|
|
22
|
+
constructor(headerSectionService, userService) {
|
|
23
|
+
this.headerSectionService = headerSectionService;
|
|
24
|
+
this.userService = userService;
|
|
25
|
+
}
|
|
26
|
+
async getHeader(req, res) {
|
|
27
|
+
const userId = req.user.userId;
|
|
28
|
+
const userData = await this.userService.getEntityData(global_constant_1.ENTITYTYPE_USER, userId);
|
|
29
|
+
if (userData) {
|
|
30
|
+
let response = await this.headerSectionService.findByOrganizationId(userData.organization_id);
|
|
31
|
+
return res.json({
|
|
32
|
+
success: true,
|
|
33
|
+
data: response,
|
|
34
|
+
message: 'Header fetched successfully'
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
return res.status(common_1.HttpStatus.BAD_REQUEST).json({
|
|
39
|
+
success: false,
|
|
40
|
+
message: 'User data not found'
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
exports.LayoutController = LayoutController;
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, common_1.Get)('header'),
|
|
48
|
+
__param(0, (0, common_1.Req)()),
|
|
49
|
+
__param(1, (0, common_1.Res)()),
|
|
50
|
+
__metadata("design:type", Function),
|
|
51
|
+
__metadata("design:paramtypes", [Object, Object]),
|
|
52
|
+
__metadata("design:returntype", Promise)
|
|
53
|
+
], LayoutController.prototype, "getHeader", null);
|
|
54
|
+
exports.LayoutController = LayoutController = __decorate([
|
|
55
|
+
(0, common_1.Controller)('layout'),
|
|
56
|
+
(0, common_1.UseGuards)(jwt_guard_1.JwtAuthGuard),
|
|
57
|
+
__param(1, (0, common_1.Inject)('UserService')),
|
|
58
|
+
__metadata("design:paramtypes", [header_section_service_1.HeaderSectionService,
|
|
59
|
+
user_service_1.UserService])
|
|
60
|
+
], LayoutController);
|
|
61
|
+
//# sourceMappingURL=layout.controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout.controller.js","sourceR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C;IAGT,WAAA,IAAA,eAAM,EAAC,aAAa,CAAC,CAAA;qCADiB,6CAAoB;QACL,0BAAW;GAFlE,gBAAgB,CAsB5B"}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=header.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"header.dto.js","sourceRoot":"","sources":["../../../../src/module/layout/dto/header.dto.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.HeaderItems = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
let HeaderItems = class HeaderItems {
|
|
15
|
+
};
|
|
16
|
+
exports.HeaderItems = HeaderItems;
|
|
17
|
+
__decorate([
|
|
18
|
+
(0, typeorm_1.PrimaryGeneratedColumn)(),
|
|
19
|
+
__metadata("design:type", Number)
|
|
20
|
+
], HeaderItems.prototype, "id", void 0);
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
23
|
+
__metadata("design:type", Number)
|
|
24
|
+
], HeaderItems.prototype, "section_id", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, typeorm_1.Column)({ length: 50, nullable: true, type: 'varchar' }),
|
|
27
|
+
__metadata("design:type", String)
|
|
28
|
+
], HeaderItems.prototype, "key", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, typeorm_1.Column)({ length: 50, nullable: true, type: 'varchar' }),
|
|
31
|
+
__metadata("design:type", String)
|
|
32
|
+
], HeaderItems.prototype, "type", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, typeorm_1.Column)({ length: 50, nullable: true, type: 'varchar' }),
|
|
35
|
+
__metadata("design:type", String)
|
|
36
|
+
], HeaderItems.prototype, "icon", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, typeorm_1.Column)({ length: 50, nullable: true, type: 'varchar' }),
|
|
39
|
+
__metadata("design:type", String)
|
|
40
|
+
], HeaderItems.prototype, "border", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, typeorm_1.Column)({ length: 50, nullable: true, type: 'varchar' }),
|
|
43
|
+
__metadata("design:type", String)
|
|
44
|
+
], HeaderItems.prototype, "avatar", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, typeorm_1.Column)({ length: 500, nullable: true, type: 'varchar' }),
|
|
47
|
+
__metadata("design:type", String)
|
|
48
|
+
], HeaderItems.prototype, "options", void 0);
|
|
49
|
+
exports.HeaderItems = HeaderItems = __decorate([
|
|
50
|
+
(0, typeorm_1.Entity)({ name: 'cr_header_items' })
|
|
51
|
+
], HeaderItems);
|
|
52
|
+
//# sourceMappingURL=header-items.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"header-items.entity.js","sourceRoot":"","sources":["../../../../src/module/layout/entity/header-items.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAiE;AAG1D,IAAM,WAAW,GAAjB,MAAM,WAAW;CAwBvB,CAAA;AAxBY,kCAAW;AAEtB;IADC,IAAA,gCAAsB,GAAE;;uCACd;AAGX;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CACR;AAGnB;IADC,IAAA,gBAAM,EAAC,EAAC,MAAM,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAC,CAAC;;wCAC1C;AAGZ;IADC,IAAA,gBAAM,EAAC,EAAC,MAAM,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAC,CAAC;;yCACzC;AAGb;IADC,IAAA,gBAAM,EAAC,EAAC,MAAM,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAC,CAAC;;yCACzC;AAGb;IADC,IAAA,gBAAM,EAAC,EAAC,MAAM,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAC,CAAC;;2CACvC;AAGf;IADC,IAAA,gBAAM,EAAC,EAAC,MAAM,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAC,CAAC;;2CACvC;AAGf;IADC,IAAA,gBAAM,EAAC,EAAC,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAC,CAAC;;4CACvC;sBAvBL,WAAW;IADvB,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,iBAAiB,EAAE,CAAC;GACvB,WAAW,CAwBvB"}
|