ecrs-auth-core 1.0.69 → 1.0.71
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/dist/auth.controller.js +207 -206
- package/dist/auth.service.js +361 -360
- package/dist/index.d.ts +31 -31
- package/dist/index.js +54 -54
- package/dist/interfaces/auth-core-options.interface.d.ts +38 -38
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
export * from './auth.module';
|
|
2
|
-
export * from './auth.service';
|
|
3
|
-
export * from './dtos/login.dto';
|
|
4
|
-
export * from './dtos/login-response.dto';
|
|
5
|
-
export * from './decorators/current-user.decorator';
|
|
6
|
-
export * from './decorators/feature.decorator';
|
|
7
|
-
export * from './decorators/has-permission.decorator';
|
|
8
|
-
export * from './decorators/roles.decorator';
|
|
9
|
-
export * from './decorators/route-permission.decorator';
|
|
10
|
-
export * from './decorators/api-key.decorator';
|
|
11
|
-
export * from './guards/module.guard';
|
|
12
|
-
export * from './guards/roles.guard';
|
|
13
|
-
export * from './guards/feature.guard';
|
|
14
|
-
export * from './guards/route.guard';
|
|
15
|
-
export * from './guards/permission.guard';
|
|
16
|
-
export * from './guards/api-key.guard';
|
|
17
|
-
export * from './jwt/jwt.guard';
|
|
18
|
-
export * from './jwt/jwt.strategy';
|
|
19
|
-
export * from './interfaces/auth-core-options.interface';
|
|
20
|
-
export * from './entities/user.entity';
|
|
21
|
-
export * from './entities/role.entity';
|
|
22
|
-
export * from './entities/module.entity';
|
|
23
|
-
export * from './entities/feature.entity';
|
|
24
|
-
export * from './entities/module-route.entity';
|
|
25
|
-
export * from './entities/user-feature-access.entity';
|
|
26
|
-
export * from './entities/user-module-access.entity';
|
|
27
|
-
export * from './entities/module-screen-permission.entity';
|
|
28
|
-
export * from './entities/api-key.entity';
|
|
29
|
-
export * from './entities/user-last-login.entity';
|
|
30
|
-
export * from './entities/ip-access.entity';
|
|
31
|
-
export * from './entities/work-profile.entity';
|
|
1
|
+
export * from './auth.module';
|
|
2
|
+
export * from './auth.service';
|
|
3
|
+
export * from './dtos/login.dto';
|
|
4
|
+
export * from './dtos/login-response.dto';
|
|
5
|
+
export * from './decorators/current-user.decorator';
|
|
6
|
+
export * from './decorators/feature.decorator';
|
|
7
|
+
export * from './decorators/has-permission.decorator';
|
|
8
|
+
export * from './decorators/roles.decorator';
|
|
9
|
+
export * from './decorators/route-permission.decorator';
|
|
10
|
+
export * from './decorators/api-key.decorator';
|
|
11
|
+
export * from './guards/module.guard';
|
|
12
|
+
export * from './guards/roles.guard';
|
|
13
|
+
export * from './guards/feature.guard';
|
|
14
|
+
export * from './guards/route.guard';
|
|
15
|
+
export * from './guards/permission.guard';
|
|
16
|
+
export * from './guards/api-key.guard';
|
|
17
|
+
export * from './jwt/jwt.guard';
|
|
18
|
+
export * from './jwt/jwt.strategy';
|
|
19
|
+
export * from './interfaces/auth-core-options.interface';
|
|
20
|
+
export * from './entities/user.entity';
|
|
21
|
+
export * from './entities/role.entity';
|
|
22
|
+
export * from './entities/module.entity';
|
|
23
|
+
export * from './entities/feature.entity';
|
|
24
|
+
export * from './entities/module-route.entity';
|
|
25
|
+
export * from './entities/user-feature-access.entity';
|
|
26
|
+
export * from './entities/user-module-access.entity';
|
|
27
|
+
export * from './entities/module-screen-permission.entity';
|
|
28
|
+
export * from './entities/api-key.entity';
|
|
29
|
+
export * from './entities/user-last-login.entity';
|
|
30
|
+
export * from './entities/ip-access.entity';
|
|
31
|
+
export * from './entities/work-profile.entity';
|
package/dist/index.js
CHANGED
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// src/index.ts
|
|
3
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
-
if (k2 === undefined) k2 = k;
|
|
5
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
-
}
|
|
9
|
-
Object.defineProperty(o, k2, desc);
|
|
10
|
-
}) : (function(o, m, k, k2) {
|
|
11
|
-
if (k2 === undefined) k2 = k;
|
|
12
|
-
o[k2] = m[k];
|
|
13
|
-
}));
|
|
14
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
15
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
16
|
-
};
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
__exportStar(require("./auth.module"), exports);
|
|
19
|
-
__exportStar(require("./auth.service"), exports);
|
|
20
|
-
// DTOs
|
|
21
|
-
__exportStar(require("./dtos/login.dto"), exports);
|
|
22
|
-
__exportStar(require("./dtos/login-response.dto"), exports);
|
|
23
|
-
// Decorators
|
|
24
|
-
__exportStar(require("./decorators/current-user.decorator"), exports);
|
|
25
|
-
__exportStar(require("./decorators/feature.decorator"), exports);
|
|
26
|
-
__exportStar(require("./decorators/has-permission.decorator"), exports);
|
|
27
|
-
__exportStar(require("./decorators/roles.decorator"), exports);
|
|
28
|
-
__exportStar(require("./decorators/route-permission.decorator"), exports);
|
|
29
|
-
__exportStar(require("./decorators/api-key.decorator"), exports);
|
|
30
|
-
// Guards
|
|
31
|
-
__exportStar(require("./guards/module.guard"), exports);
|
|
32
|
-
__exportStar(require("./guards/roles.guard"), exports);
|
|
33
|
-
__exportStar(require("./guards/feature.guard"), exports);
|
|
34
|
-
__exportStar(require("./guards/route.guard"), exports);
|
|
35
|
-
__exportStar(require("./guards/permission.guard"), exports);
|
|
36
|
-
__exportStar(require("./guards/api-key.guard"), exports);
|
|
37
|
-
// JWT
|
|
38
|
-
__exportStar(require("./jwt/jwt.guard"), exports);
|
|
39
|
-
__exportStar(require("./jwt/jwt.strategy"), exports);
|
|
40
|
-
// Interfaces
|
|
41
|
-
__exportStar(require("./interfaces/auth-core-options.interface"), exports);
|
|
42
|
-
// ✅ Entities
|
|
43
|
-
__exportStar(require("./entities/user.entity"), exports);
|
|
44
|
-
__exportStar(require("./entities/role.entity"), exports);
|
|
45
|
-
__exportStar(require("./entities/module.entity"), exports);
|
|
46
|
-
__exportStar(require("./entities/feature.entity"), exports);
|
|
47
|
-
__exportStar(require("./entities/module-route.entity"), exports);
|
|
48
|
-
__exportStar(require("./entities/user-feature-access.entity"), exports);
|
|
49
|
-
__exportStar(require("./entities/user-module-access.entity"), exports);
|
|
50
|
-
__exportStar(require("./entities/module-screen-permission.entity"), exports);
|
|
51
|
-
__exportStar(require("./entities/api-key.entity"), exports);
|
|
52
|
-
__exportStar(require("./entities/user-last-login.entity"), exports);
|
|
53
|
-
__exportStar(require("./entities/ip-access.entity"), exports);
|
|
54
|
-
__exportStar(require("./entities/work-profile.entity"), exports);
|
|
1
|
+
"use strict";
|
|
2
|
+
// src/index.ts
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
15
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
16
|
+
};
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
__exportStar(require("./auth.module"), exports);
|
|
19
|
+
__exportStar(require("./auth.service"), exports);
|
|
20
|
+
// DTOs
|
|
21
|
+
__exportStar(require("./dtos/login.dto"), exports);
|
|
22
|
+
__exportStar(require("./dtos/login-response.dto"), exports);
|
|
23
|
+
// Decorators
|
|
24
|
+
__exportStar(require("./decorators/current-user.decorator"), exports);
|
|
25
|
+
__exportStar(require("./decorators/feature.decorator"), exports);
|
|
26
|
+
__exportStar(require("./decorators/has-permission.decorator"), exports);
|
|
27
|
+
__exportStar(require("./decorators/roles.decorator"), exports);
|
|
28
|
+
__exportStar(require("./decorators/route-permission.decorator"), exports);
|
|
29
|
+
__exportStar(require("./decorators/api-key.decorator"), exports);
|
|
30
|
+
// Guards
|
|
31
|
+
__exportStar(require("./guards/module.guard"), exports);
|
|
32
|
+
__exportStar(require("./guards/roles.guard"), exports);
|
|
33
|
+
__exportStar(require("./guards/feature.guard"), exports);
|
|
34
|
+
__exportStar(require("./guards/route.guard"), exports);
|
|
35
|
+
__exportStar(require("./guards/permission.guard"), exports);
|
|
36
|
+
__exportStar(require("./guards/api-key.guard"), exports);
|
|
37
|
+
// JWT
|
|
38
|
+
__exportStar(require("./jwt/jwt.guard"), exports);
|
|
39
|
+
__exportStar(require("./jwt/jwt.strategy"), exports);
|
|
40
|
+
// Interfaces
|
|
41
|
+
__exportStar(require("./interfaces/auth-core-options.interface"), exports);
|
|
42
|
+
// ✅ Entities
|
|
43
|
+
__exportStar(require("./entities/user.entity"), exports);
|
|
44
|
+
__exportStar(require("./entities/role.entity"), exports);
|
|
45
|
+
__exportStar(require("./entities/module.entity"), exports);
|
|
46
|
+
__exportStar(require("./entities/feature.entity"), exports);
|
|
47
|
+
__exportStar(require("./entities/module-route.entity"), exports);
|
|
48
|
+
__exportStar(require("./entities/user-feature-access.entity"), exports);
|
|
49
|
+
__exportStar(require("./entities/user-module-access.entity"), exports);
|
|
50
|
+
__exportStar(require("./entities/module-screen-permission.entity"), exports);
|
|
51
|
+
__exportStar(require("./entities/api-key.entity"), exports);
|
|
52
|
+
__exportStar(require("./entities/user-last-login.entity"), exports);
|
|
53
|
+
__exportStar(require("./entities/ip-access.entity"), exports);
|
|
54
|
+
__exportStar(require("./entities/work-profile.entity"), exports);
|
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
import { Repository } from 'typeorm';
|
|
2
|
-
import { User } from '../entities/user.entity';
|
|
3
|
-
import { Role } from '../entities/role.entity';
|
|
4
|
-
import { Module } from '../entities/module.entity';
|
|
5
|
-
import { Feature } from '../entities/feature.entity';
|
|
6
|
-
import { ModuleRoute } from '../entities/module-route.entity';
|
|
7
|
-
import { UserFeatureAccess } from '../entities/user-feature-access.entity';
|
|
8
|
-
import { UserModuleAccess } from '../entities/user-module-access.entity';
|
|
9
|
-
import { ModuleScreenPermission } from '../entities/module-screen-permission.entity';
|
|
10
|
-
import { ApiKeyEntity } from '../entities/api-key.entity';
|
|
11
|
-
import { UserLastLoginEntity } from '../entities/user-last-login.entity';
|
|
12
|
-
import { EmployeeIPAccessEntity } from '../entities/ip-access.entity';
|
|
13
|
-
import { EmployeeWorkProfileEntity } from '../entities/work-profile.entity';
|
|
14
|
-
export interface Repositories {
|
|
15
|
-
userRepo: Repository<User>;
|
|
16
|
-
roleRepo: Repository<Role>;
|
|
17
|
-
moduleRepo: Repository<Module>;
|
|
18
|
-
featureAccessRepo: Repository<UserFeatureAccess>;
|
|
19
|
-
screenPermissionRepo: Repository<ModuleScreenPermission>;
|
|
20
|
-
featureRepo: Repository<Feature>;
|
|
21
|
-
routeRepo: Repository<ModuleRoute>;
|
|
22
|
-
moduleAccessRepo: Repository<UserModuleAccess>;
|
|
23
|
-
apiKeyRepo?: Repository<ApiKeyEntity>;
|
|
24
|
-
ipRestrictionsRepo?: Repository<EmployeeIPAccessEntity>;
|
|
25
|
-
userLastLoginRepo?: Repository<UserLastLoginEntity>;
|
|
26
|
-
employeeWorkProfileRepo?: Repository<EmployeeWorkProfileEntity>;
|
|
27
|
-
}
|
|
28
|
-
export interface AuthModuleConfig {
|
|
29
|
-
enable2FA?: boolean;
|
|
30
|
-
tokenIssuer?: string;
|
|
31
|
-
[key: string]: any;
|
|
32
|
-
}
|
|
33
|
-
export interface AuthCoreOptions {
|
|
34
|
-
jwtSecret: string;
|
|
35
|
-
jwtExpiresIn: string;
|
|
36
|
-
repositories: Repositories;
|
|
37
|
-
moduleConfig?: AuthModuleConfig;
|
|
38
|
-
}
|
|
1
|
+
import { Repository } from 'typeorm';
|
|
2
|
+
import { User } from '../entities/user.entity';
|
|
3
|
+
import { Role } from '../entities/role.entity';
|
|
4
|
+
import { Module } from '../entities/module.entity';
|
|
5
|
+
import { Feature } from '../entities/feature.entity';
|
|
6
|
+
import { ModuleRoute } from '../entities/module-route.entity';
|
|
7
|
+
import { UserFeatureAccess } from '../entities/user-feature-access.entity';
|
|
8
|
+
import { UserModuleAccess } from '../entities/user-module-access.entity';
|
|
9
|
+
import { ModuleScreenPermission } from '../entities/module-screen-permission.entity';
|
|
10
|
+
import { ApiKeyEntity } from '../entities/api-key.entity';
|
|
11
|
+
import { UserLastLoginEntity } from '../entities/user-last-login.entity';
|
|
12
|
+
import { EmployeeIPAccessEntity } from '../entities/ip-access.entity';
|
|
13
|
+
import { EmployeeWorkProfileEntity } from '../entities/work-profile.entity';
|
|
14
|
+
export interface Repositories {
|
|
15
|
+
userRepo: Repository<User>;
|
|
16
|
+
roleRepo: Repository<Role>;
|
|
17
|
+
moduleRepo: Repository<Module>;
|
|
18
|
+
featureAccessRepo: Repository<UserFeatureAccess>;
|
|
19
|
+
screenPermissionRepo: Repository<ModuleScreenPermission>;
|
|
20
|
+
featureRepo: Repository<Feature>;
|
|
21
|
+
routeRepo: Repository<ModuleRoute>;
|
|
22
|
+
moduleAccessRepo: Repository<UserModuleAccess>;
|
|
23
|
+
apiKeyRepo?: Repository<ApiKeyEntity>;
|
|
24
|
+
ipRestrictionsRepo?: Repository<EmployeeIPAccessEntity>;
|
|
25
|
+
userLastLoginRepo?: Repository<UserLastLoginEntity>;
|
|
26
|
+
employeeWorkProfileRepo?: Repository<EmployeeWorkProfileEntity>;
|
|
27
|
+
}
|
|
28
|
+
export interface AuthModuleConfig {
|
|
29
|
+
enable2FA?: boolean;
|
|
30
|
+
tokenIssuer?: string;
|
|
31
|
+
[key: string]: any;
|
|
32
|
+
}
|
|
33
|
+
export interface AuthCoreOptions {
|
|
34
|
+
jwtSecret: string;
|
|
35
|
+
jwtExpiresIn: string;
|
|
36
|
+
repositories: Repositories;
|
|
37
|
+
moduleConfig?: AuthModuleConfig;
|
|
38
|
+
}
|