@alacard-project/shared 1.0.0 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/config/base-config.service.d.ts +25 -0
- package/dist/config/base-config.service.js +87 -0
- package/dist/config/base-config.service.js.map +1 -0
- package/dist/constants/auth-config.constants.d.ts +8 -0
- package/dist/constants/auth-config.constants.js +12 -0
- package/dist/constants/auth-config.constants.js.map +1 -0
- package/dist/constants/auth.constants.d.ts +31 -0
- package/dist/constants/auth.constants.js +35 -0
- package/dist/constants/auth.constants.js.map +1 -0
- package/dist/constants/common.constants.d.ts +8 -0
- package/dist/constants/common.constants.js +12 -0
- package/dist/constants/common.constants.js.map +1 -0
- package/dist/constants/env.constants.d.ts +21 -4
- package/dist/constants/env.constants.js +21 -4
- package/dist/constants/env.constants.js.map +1 -1
- package/dist/constants/error-messages.d.ts +1 -0
- package/dist/constants/error-messages.js +13 -0
- package/dist/constants/error-messages.js.map +1 -0
- package/dist/constants/grpc.constants.d.ts +26 -0
- package/dist/constants/grpc.constants.js +26 -0
- package/dist/constants/grpc.constants.js.map +1 -1
- package/dist/constants/index.d.ts +10 -2
- package/dist/constants/index.js +10 -2
- package/dist/constants/index.js.map +1 -1
- package/dist/constants/logging-messages.constants.d.ts +12 -0
- package/dist/constants/logging-messages.constants.js +16 -0
- package/dist/constants/logging-messages.constants.js.map +1 -0
- package/dist/constants/microservices.constants.d.ts +18 -0
- package/dist/constants/microservices.constants.js +22 -0
- package/dist/constants/microservices.constants.js.map +1 -0
- package/dist/constants/monitoring.constants.d.ts +51 -0
- package/dist/constants/monitoring.constants.js +55 -0
- package/dist/constants/monitoring.constants.js.map +1 -0
- package/dist/constants/routes.constants.d.ts +20 -0
- package/dist/constants/routes.constants.js +24 -0
- package/dist/constants/routes.constants.js.map +1 -0
- package/dist/constants/tokens.constants.d.ts +6 -0
- package/dist/constants/tokens.constants.js +10 -0
- package/dist/constants/tokens.constants.js.map +1 -0
- package/dist/contracts/auth.contract.d.ts +88 -0
- package/dist/contracts/auth.contract.js +3 -0
- package/dist/contracts/auth.contract.js.map +1 -0
- package/dist/contracts/index.d.ts +1 -0
- package/dist/contracts/index.js +1 -0
- package/dist/contracts/index.js.map +1 -1
- package/dist/decorators/scopes.decorator.d.ts +2 -0
- package/dist/decorators/scopes.decorator.js +8 -0
- package/dist/decorators/scopes.decorator.js.map +1 -0
- package/dist/dto/auth.dto.d.ts +41 -0
- package/dist/dto/auth.dto.js +53 -0
- package/dist/dto/auth.dto.js.map +1 -0
- package/dist/dto/index.d.ts +2 -0
- package/dist/dto/index.js +19 -0
- package/dist/dto/index.js.map +1 -0
- package/dist/dto/logging.dto.d.ts +29 -0
- package/dist/dto/logging.dto.js +146 -0
- package/dist/dto/logging.dto.js.map +1 -0
- package/dist/enums/{environment.enum.js → env.enum.js} +1 -1
- package/dist/enums/env.enum.js.map +1 -0
- package/dist/enums/error.enum.d.ts +19 -0
- package/dist/enums/error.enum.js +24 -0
- package/dist/enums/error.enum.js.map +1 -0
- package/dist/enums/events.enum.d.ts +20 -0
- package/dist/enums/events.enum.js +14 -0
- package/dist/enums/events.enum.js.map +1 -0
- package/dist/enums/health.enum.d.ts +7 -0
- package/dist/enums/health.enum.js +12 -0
- package/dist/enums/health.enum.js.map +1 -0
- package/dist/enums/index.d.ts +8 -5
- package/dist/enums/index.js +8 -5
- package/dist/enums/index.js.map +1 -1
- package/dist/enums/{log-level.enum.js → logging.enum.js} +1 -1
- package/dist/enums/logging.enum.js.map +1 -0
- package/dist/enums/{notification-type.enum.js → notification.enum.js} +1 -1
- package/dist/enums/notification.enum.js.map +1 -0
- package/dist/enums/permission.enum.d.ts +18 -0
- package/dist/enums/permission.enum.js +23 -0
- package/dist/enums/permission.enum.js.map +1 -0
- package/dist/enums/user.enum.d.ts +8 -0
- package/dist/enums/{user-role.enum.js → user.enum.js} +4 -2
- package/dist/enums/user.enum.js.map +1 -0
- package/dist/errors/app.error.d.ts +17 -0
- package/dist/errors/app.error.js +29 -0
- package/dist/errors/app.error.js.map +1 -0
- package/dist/errors/error-map.d.ts +7 -0
- package/dist/errors/error-map.js +92 -0
- package/dist/errors/error-map.js.map +1 -0
- package/dist/index.d.ts +10 -1
- package/dist/index.js +10 -1
- package/dist/index.js.map +1 -1
- package/dist/types/auth.types.d.ts +5 -0
- package/dist/types/config.types.d.ts +3 -2
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -1
- package/dist/types/monitoring.types.d.ts +60 -0
- package/dist/types/monitoring.types.js +3 -0
- package/dist/types/monitoring.types.js.map +1 -0
- package/dist/types/user.types.d.ts +10 -0
- package/dist/types/user.types.js +3 -0
- package/dist/types/user.types.js.map +1 -0
- package/dist/utils/app.utils.d.ts +8 -0
- package/dist/utils/app.utils.js +25 -0
- package/dist/utils/app.utils.js.map +1 -0
- package/dist/utils/health.utils.d.ts +8 -0
- package/dist/utils/health.utils.js +60 -0
- package/dist/utils/health.utils.js.map +1 -0
- package/dist/utils/logging-client.d.ts +7 -0
- package/dist/utils/logging-client.js +22 -0
- package/dist/utils/logging-client.js.map +1 -0
- package/dist/utils/prometheus.utils.d.ts +9 -0
- package/dist/utils/prometheus.utils.js +66 -0
- package/dist/utils/prometheus.utils.js.map +1 -0
- package/dist/utils/user.utils.d.ts +1 -0
- package/dist/utils/user.utils.js +7 -0
- package/dist/utils/user.utils.js.map +1 -0
- package/package.json +9 -8
- package/src/config/base-config.service.ts +101 -0
- package/src/constants/auth-config.constants.ts +9 -0
- package/src/constants/auth.constants.ts +34 -0
- package/src/constants/common.constants.ts +9 -0
- package/src/constants/env.constants.ts +21 -4
- package/src/constants/error-messages.ts +10 -0
- package/src/constants/grpc.constants.ts +26 -0
- package/src/constants/index.ts +10 -2
- package/src/constants/logging-messages.constants.ts +15 -0
- package/src/constants/microservices.constants.ts +18 -0
- package/src/constants/monitoring.constants.ts +71 -0
- package/src/constants/routes.constants.ts +21 -0
- package/src/constants/tokens.constants.ts +6 -0
- package/src/contracts/auth.contract.ts +98 -0
- package/src/contracts/index.ts +1 -0
- package/src/decorators/scopes.decorator.ts +4 -0
- package/src/dto/auth.dto.ts +62 -0
- package/src/dto/index.ts +2 -0
- package/src/{logging/dto/log-filter.dto.ts → dto/logging.dto.ts} +1 -1
- package/src/enums/error.enum.ts +26 -0
- package/src/enums/events.enum.ts +22 -0
- package/src/enums/health.enum.ts +7 -0
- package/src/enums/index.ts +8 -5
- package/src/enums/permission.enum.ts +31 -0
- package/src/enums/{user-role.enum.ts → user.enum.ts} +3 -1
- package/src/errors/app.error.ts +33 -0
- package/src/errors/error-map.ts +95 -0
- package/src/index.ts +10 -1
- package/src/types/auth.types.ts +5 -0
- package/src/types/config.types.ts +4 -2
- package/src/types/index.ts +2 -1
- package/src/types/monitoring.types.ts +79 -0
- package/src/types/user.types.ts +11 -0
- package/src/utils/app.utils.ts +54 -0
- package/src/utils/health.utils.ts +72 -0
- package/src/utils/logging-client.ts +21 -0
- package/src/utils/prometheus.utils.ts +114 -0
- package/src/utils/user.utils.ts +3 -0
- package/dist/constants/services.constants.d.ts +0 -6
- package/dist/constants/services.constants.js +0 -10
- package/dist/constants/services.constants.js.map +0 -1
- package/dist/enums/environment.enum.js.map +0 -1
- package/dist/enums/error-code.enum.d.ts +0 -8
- package/dist/enums/error-code.enum.js +0 -13
- package/dist/enums/error-code.enum.js.map +0 -1
- package/dist/enums/log-level.enum.js.map +0 -1
- package/dist/enums/notification-type.enum.js.map +0 -1
- package/dist/enums/user-role.enum.d.ts +0 -6
- package/dist/enums/user-role.enum.js.map +0 -1
- package/dist/logging/enums/log-level.enum.d.ts +0 -7
- package/dist/logging/enums/log-level.enum.js +0 -12
- package/dist/logging/enums/log-level.enum.js.map +0 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
- package/proto/token.proto +0 -50
- package/src/constants/services.constants.ts +0 -6
- package/src/enums/error-code.enum.ts +0 -8
- package/src/logging/index.ts +0 -1
- /package/dist/enums/{environment.enum.d.ts → env.enum.d.ts} +0 -0
- /package/dist/enums/{log-level.enum.d.ts → logging.enum.d.ts} +0 -0
- /package/dist/enums/{notification-type.enum.d.ts → notification.enum.d.ts} +0 -0
- /package/src/enums/{environment.enum.ts → env.enum.ts} +0 -0
- /package/src/enums/{log-level.enum.ts → logging.enum.ts} +0 -0
- /package/src/enums/{notification-type.enum.ts → notification.enum.ts} +0 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ConfigService } from '@nestjs/config';
|
|
2
|
+
import { Environment } from '../enums/env.enum';
|
|
3
|
+
export declare abstract class BaseConfigService {
|
|
4
|
+
protected readonly configService: ConfigService;
|
|
5
|
+
constructor(configService: ConfigService);
|
|
6
|
+
get environment(): Environment;
|
|
7
|
+
get isProduction(): boolean;
|
|
8
|
+
get port(): number;
|
|
9
|
+
get databaseUrl(): string;
|
|
10
|
+
get redisHost(): string;
|
|
11
|
+
get redisPort(): number;
|
|
12
|
+
get kafkaBrokers(): string[];
|
|
13
|
+
get corsOrigins(): string[];
|
|
14
|
+
get rabbitmqUrl(): string;
|
|
15
|
+
get rateLimitTtl(): number;
|
|
16
|
+
get rateLimitMax(): number;
|
|
17
|
+
get userServiceUrl(): string;
|
|
18
|
+
get userProtoPath(): string;
|
|
19
|
+
protected getRequiredString(key: string): string;
|
|
20
|
+
protected getRequiredNumber(key: string): number;
|
|
21
|
+
protected getOptionalString(key: string, defaultValue?: string): string | undefined;
|
|
22
|
+
protected getOptionalNumber(key: string, defaultValue?: number): number | undefined;
|
|
23
|
+
protected getOptionalBoolean(key: string, defaultValue?: boolean): boolean;
|
|
24
|
+
protected timeToSeconds(timeStr: string): number;
|
|
25
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BaseConfigService = void 0;
|
|
4
|
+
const env_constants_1 = require("../constants/env.constants");
|
|
5
|
+
const env_enum_1 = require("../enums/env.enum");
|
|
6
|
+
class BaseConfigService {
|
|
7
|
+
constructor(configService) {
|
|
8
|
+
this.configService = configService;
|
|
9
|
+
}
|
|
10
|
+
get environment() {
|
|
11
|
+
return this.configService.get(env_constants_1.ENV_KEYS.NODE_ENV) || env_enum_1.Environment.DEVELOPMENT;
|
|
12
|
+
}
|
|
13
|
+
get isProduction() {
|
|
14
|
+
return this.environment === env_enum_1.Environment.PRODUCTION;
|
|
15
|
+
}
|
|
16
|
+
get port() {
|
|
17
|
+
return this.getOptionalNumber(env_constants_1.ENV_KEYS.PORT, 3000);
|
|
18
|
+
}
|
|
19
|
+
get databaseUrl() {
|
|
20
|
+
return this.getRequiredString(env_constants_1.ENV_KEYS.DATABASE_URL);
|
|
21
|
+
}
|
|
22
|
+
get redisHost() {
|
|
23
|
+
return this.getRequiredString(env_constants_1.ENV_KEYS.REDIS_HOST);
|
|
24
|
+
}
|
|
25
|
+
get redisPort() {
|
|
26
|
+
return this.getRequiredNumber(env_constants_1.ENV_KEYS.REDIS_PORT);
|
|
27
|
+
}
|
|
28
|
+
get kafkaBrokers() {
|
|
29
|
+
const brokers = this.getRequiredString(env_constants_1.ENV_KEYS.KAFKA_BROKERS);
|
|
30
|
+
return brokers.split(',');
|
|
31
|
+
}
|
|
32
|
+
get corsOrigins() {
|
|
33
|
+
const origins = this.getOptionalString(env_constants_1.ENV_KEYS.CORS_ORIGINS);
|
|
34
|
+
return origins ? origins.split(',') : ['*'];
|
|
35
|
+
}
|
|
36
|
+
get rabbitmqUrl() {
|
|
37
|
+
return this.getRequiredString(env_constants_1.ENV_KEYS.RABBITMQ_URL);
|
|
38
|
+
}
|
|
39
|
+
get rateLimitTtl() {
|
|
40
|
+
return this.getOptionalNumber(env_constants_1.ENV_KEYS.RATE_LIMIT_TTL, 60);
|
|
41
|
+
}
|
|
42
|
+
get rateLimitMax() {
|
|
43
|
+
return this.getOptionalNumber(env_constants_1.ENV_KEYS.RATE_LIMIT_MAX, 10);
|
|
44
|
+
}
|
|
45
|
+
get userServiceUrl() {
|
|
46
|
+
return this.getRequiredString(env_constants_1.ENV_KEYS.USER_SERVICE_URL);
|
|
47
|
+
}
|
|
48
|
+
get userProtoPath() {
|
|
49
|
+
return this.getRequiredString(env_constants_1.ENV_KEYS.USER_PROTO_PATH);
|
|
50
|
+
}
|
|
51
|
+
getRequiredString(key) {
|
|
52
|
+
const value = this.configService.get(key);
|
|
53
|
+
if (!value) {
|
|
54
|
+
throw new Error(`Config error: ${key} is required`);
|
|
55
|
+
}
|
|
56
|
+
return value;
|
|
57
|
+
}
|
|
58
|
+
getRequiredNumber(key) {
|
|
59
|
+
const value = this.configService.get(key);
|
|
60
|
+
if (value === undefined) {
|
|
61
|
+
throw new Error(`Config error: ${key} is required`);
|
|
62
|
+
}
|
|
63
|
+
return value;
|
|
64
|
+
}
|
|
65
|
+
getOptionalString(key, defaultValue) {
|
|
66
|
+
return this.configService.get(key) || defaultValue;
|
|
67
|
+
}
|
|
68
|
+
getOptionalNumber(key, defaultValue) {
|
|
69
|
+
return this.configService.get(key) ?? defaultValue;
|
|
70
|
+
}
|
|
71
|
+
getOptionalBoolean(key, defaultValue = false) {
|
|
72
|
+
return this.configService.get(key) ?? defaultValue;
|
|
73
|
+
}
|
|
74
|
+
timeToSeconds(timeStr) {
|
|
75
|
+
const unit = timeStr.slice(-1);
|
|
76
|
+
const value = parseInt(timeStr.slice(0, -1));
|
|
77
|
+
switch (unit) {
|
|
78
|
+
case 's': return value;
|
|
79
|
+
case 'm': return value * 60;
|
|
80
|
+
case 'h': return value * 3600;
|
|
81
|
+
case 'd': return value * 86400;
|
|
82
|
+
default: return parseInt(timeStr);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
exports.BaseConfigService = BaseConfigService;
|
|
87
|
+
//# sourceMappingURL=base-config.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-config.service.js","sourceRoot":"","sources":["../../src/config/base-config.service.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PASSWORD_RESET_CONFIG = exports.INVITATION_CONFIG = void 0;
|
|
4
|
+
exports.INVITATION_CONFIG = {
|
|
5
|
+
DEFAULT_EXPIRATION_DAYS: 7,
|
|
6
|
+
TOKEN_LENGTH: 32,
|
|
7
|
+
};
|
|
8
|
+
exports.PASSWORD_RESET_CONFIG = {
|
|
9
|
+
TOKEN_EXPIRY_HOURS: 1,
|
|
10
|
+
TOKEN_LENGTH: 32,
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=auth-config.constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth-config.constants.js","sourceRoot":"","sources":["../../src/constants/auth-config.constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,iBAAiB,GAAG;IAC7B,uBAAuB,EAAE,CAAC;IAC1B,YAAY,EAAE,EAAE;CACnB,CAAC;AAEW,QAAA,qBAAqB,GAAG;IACjC,kBAAkB,EAAE,CAAC;IACrB,YAAY,EAAE,EAAE;CACnB,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export declare const AUTHENTICATION_MESSAGES: {
|
|
2
|
+
USER_NOT_FOUND: string;
|
|
3
|
+
USER_ALREADY_EXISTS: string;
|
|
4
|
+
INVALID_PASSWORD: string;
|
|
5
|
+
USER_INACTIVE: string;
|
|
6
|
+
INVALID_REFRESH_TOKEN: string;
|
|
7
|
+
LOGOUT_SUCCESS: string;
|
|
8
|
+
REGISTRATION_SUCCESS: string;
|
|
9
|
+
REGISTER_SUCCESS: string;
|
|
10
|
+
LOGIN_SUCCESS: string;
|
|
11
|
+
PASSWORD_RESET_SENT: string;
|
|
12
|
+
PASSWORD_RESET_SUCCESS: string;
|
|
13
|
+
INVALID_CREDENTIALS: string;
|
|
14
|
+
};
|
|
15
|
+
export declare const COOKIE_EXPIRATION: {
|
|
16
|
+
REFRESH_TOKEN_MS: number;
|
|
17
|
+
ACCESS_TOKEN_MS: number;
|
|
18
|
+
};
|
|
19
|
+
export declare const INVITATION_MESSAGES: {
|
|
20
|
+
INVITATION_SENT: string;
|
|
21
|
+
INVITATION_VALID: string;
|
|
22
|
+
INVITATION_NOT_FOUND: string;
|
|
23
|
+
INVITATION_EXPIRED: string;
|
|
24
|
+
INVITATION_ALREADY_USED: string;
|
|
25
|
+
};
|
|
26
|
+
export declare const PASSWORD_RESET_MESSAGES: {
|
|
27
|
+
RESET_EMAIL_SENT: string;
|
|
28
|
+
PASSWORD_RESET_SUCCESS: string;
|
|
29
|
+
INVALID_TOKEN: string;
|
|
30
|
+
TOKEN_EXPIRED: string;
|
|
31
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PASSWORD_RESET_MESSAGES = exports.INVITATION_MESSAGES = exports.COOKIE_EXPIRATION = exports.AUTHENTICATION_MESSAGES = void 0;
|
|
4
|
+
exports.AUTHENTICATION_MESSAGES = {
|
|
5
|
+
USER_NOT_FOUND: 'User with this email was not found.',
|
|
6
|
+
USER_ALREADY_EXISTS: 'User with this email already exists.',
|
|
7
|
+
INVALID_PASSWORD: 'The password you entered is incorrect.',
|
|
8
|
+
USER_INACTIVE: 'Your account is currently inactive. Please contact support.',
|
|
9
|
+
INVALID_REFRESH_TOKEN: 'Your session has expired or the refresh token is invalid.',
|
|
10
|
+
LOGOUT_SUCCESS: 'You have been successfully logged out.',
|
|
11
|
+
REGISTRATION_SUCCESS: 'Your account has been created successfully.',
|
|
12
|
+
REGISTER_SUCCESS: 'Account created successfully.',
|
|
13
|
+
LOGIN_SUCCESS: 'Logged in successfully.',
|
|
14
|
+
PASSWORD_RESET_SENT: 'A password reset link has been sent to your email.',
|
|
15
|
+
PASSWORD_RESET_SUCCESS: 'Your password has been reset successfully.',
|
|
16
|
+
INVALID_CREDENTIALS: 'The email or password you entered is incorrect.',
|
|
17
|
+
};
|
|
18
|
+
exports.COOKIE_EXPIRATION = {
|
|
19
|
+
REFRESH_TOKEN_MS: 7 * 24 * 60 * 60 * 1000,
|
|
20
|
+
ACCESS_TOKEN_MS: 15 * 60 * 1000,
|
|
21
|
+
};
|
|
22
|
+
exports.INVITATION_MESSAGES = {
|
|
23
|
+
INVITATION_SENT: 'Invitation sent successfully.',
|
|
24
|
+
INVITATION_VALID: 'Invitation is valid.',
|
|
25
|
+
INVITATION_NOT_FOUND: 'Invitation not found.',
|
|
26
|
+
INVITATION_EXPIRED: 'Invitation has expired.',
|
|
27
|
+
INVITATION_ALREADY_USED: 'Invitation has already been used.',
|
|
28
|
+
};
|
|
29
|
+
exports.PASSWORD_RESET_MESSAGES = {
|
|
30
|
+
RESET_EMAIL_SENT: 'Password reset email sent.',
|
|
31
|
+
PASSWORD_RESET_SUCCESS: 'Password reset successfully.',
|
|
32
|
+
INVALID_TOKEN: 'Invalid password reset token.',
|
|
33
|
+
TOKEN_EXPIRED: 'Password reset token has expired.',
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=auth.constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.constants.js","sourceRoot":"","sources":["../../src/constants/auth.constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,uBAAuB,GAAG;IACnC,cAAc,EAAE,qCAAqC;IACrD,mBAAmB,EAAE,sCAAsC;IAC3D,gBAAgB,EAAE,wCAAwC;IAC1D,aAAa,EAAE,6DAA6D;IAC5E,qBAAqB,EAAE,2DAA2D;IAClF,cAAc,EAAE,wCAAwC;IACxD,oBAAoB,EAAE,6CAA6C;IACnE,gBAAgB,EAAE,+BAA+B;IACjD,aAAa,EAAE,yBAAyB;IACxC,mBAAmB,EAAE,oDAAoD;IACzE,sBAAsB,EAAE,4CAA4C;IACpE,mBAAmB,EAAE,iDAAiD;CACzE,CAAC;AAEW,QAAA,iBAAiB,GAAG;IAC7B,gBAAgB,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI;IACzC,eAAe,EAAE,EAAE,GAAG,EAAE,GAAG,IAAI;CAClC,CAAC;AAEW,QAAA,mBAAmB,GAAG;IAC/B,eAAe,EAAE,+BAA+B;IAChD,gBAAgB,EAAE,sBAAsB;IACxC,oBAAoB,EAAE,uBAAuB;IAC7C,kBAAkB,EAAE,yBAAyB;IAC7C,uBAAuB,EAAE,mCAAmC;CAC/D,CAAC;AAEW,QAAA,uBAAuB,GAAG;IACnC,gBAAgB,EAAE,4BAA4B;IAC9C,sBAAsB,EAAE,8BAA8B;IACtD,aAAa,EAAE,+BAA+B;IAC9C,aAAa,EAAE,mCAAmC;CACrD,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PASSPORT_STRATEGIES = exports.COOKIE_NAMES = void 0;
|
|
4
|
+
exports.COOKIE_NAMES = {
|
|
5
|
+
ACCESS_TOKEN: 'access_token',
|
|
6
|
+
REFRESH_TOKEN: 'refresh_token',
|
|
7
|
+
};
|
|
8
|
+
exports.PASSPORT_STRATEGIES = {
|
|
9
|
+
LOCAL: 'local',
|
|
10
|
+
JWT: 'jwt',
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=common.constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.constants.js","sourceRoot":"","sources":["../../src/constants/common.constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,YAAY,GAAG;IACxB,YAAY,EAAE,cAAc;IAC5B,aAAa,EAAE,eAAe;CACxB,CAAC;AAEE,QAAA,mBAAmB,GAAG;IAC/B,KAAK,EAAE,OAAO;IACd,GAAG,EAAE,KAAK;CACJ,CAAC"}
|
|
@@ -8,17 +8,34 @@ export declare const ENV_KEYS: {
|
|
|
8
8
|
readonly KAFKA_BROKERS: "KAFKA_BROKERS";
|
|
9
9
|
readonly RABBITMQ_URL: "RABBITMQ_URL";
|
|
10
10
|
readonly JWT_SECRET: "JWT_SECRET";
|
|
11
|
+
readonly JWT_EXPIRES_IN: "JWT_EXPIRES_IN";
|
|
12
|
+
readonly JWT_REFRESH_EXPIRES_IN: "JWT_REFRESH_EXPIRES_IN";
|
|
11
13
|
readonly GRPC_PORT: "GRPC_PORT";
|
|
12
14
|
readonly GRPC_URL: "GRPC_URL";
|
|
13
15
|
readonly LOGGING_PROTO_PATH: "LOGGING_PROTO_PATH";
|
|
14
16
|
readonly INTERNAL_CONFIG_KEY: "INTERNAL_CONFIG_KEY";
|
|
15
17
|
readonly RATE_LIMIT_TTL: "RATE_LIMIT_TTL";
|
|
16
18
|
readonly RATE_LIMIT_MAX: "RATE_LIMIT_MAX";
|
|
19
|
+
readonly NOTIFICATION_SERVICE_URL: "NOTIFICATION_SERVICE_URL";
|
|
20
|
+
readonly LOG_FILE_PATH: "LOG_FILE_PATH";
|
|
21
|
+
readonly LOG_RETENTION_DAYS: "LOG_RETENTION_DAYS";
|
|
17
22
|
readonly CORS_ORIGINS: "CORS_ORIGINS";
|
|
23
|
+
readonly USER_SERVICE_URL: "USER_SERVICE_URL";
|
|
24
|
+
readonly USER_PROTO_PATH: "USER_PROTO_PATH";
|
|
25
|
+
readonly AUTH_SERVICE_URL: "AUTH_SERVICE_URL";
|
|
26
|
+
readonly AUTH_PROTO_PATH: "AUTH_PROTO_PATH";
|
|
27
|
+
readonly LOGGING_SERVICE_URL: "LOGGING_SERVICE_URL";
|
|
28
|
+
readonly TOKEN_SERVICE_URL: "TOKEN_SERVICE_URL";
|
|
29
|
+
readonly TOKEN_PROTO_PATH: "TOKEN_PROTO_PATH";
|
|
30
|
+
readonly CONFIG_SERVICE_URL: "CONFIG_SERVICE_URL";
|
|
31
|
+
readonly CONFIG_SERVICE_ENABLED: "CONFIG_SERVICE_ENABLED";
|
|
18
32
|
};
|
|
19
33
|
export declare const ENV_VALUES: {
|
|
20
|
-
readonly
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
34
|
+
readonly NODE_ENV: {
|
|
35
|
+
readonly DEVELOPMENT: "development";
|
|
36
|
+
readonly PRODUCTION: "production";
|
|
37
|
+
readonly TEST: "test";
|
|
38
|
+
readonly STAGING: "staging";
|
|
39
|
+
readonly LOCAL: "local";
|
|
40
|
+
};
|
|
24
41
|
};
|
|
@@ -11,18 +11,35 @@ exports.ENV_KEYS = {
|
|
|
11
11
|
KAFKA_BROKERS: 'KAFKA_BROKERS',
|
|
12
12
|
RABBITMQ_URL: 'RABBITMQ_URL',
|
|
13
13
|
JWT_SECRET: 'JWT_SECRET',
|
|
14
|
+
JWT_EXPIRES_IN: 'JWT_EXPIRES_IN',
|
|
15
|
+
JWT_REFRESH_EXPIRES_IN: 'JWT_REFRESH_EXPIRES_IN',
|
|
14
16
|
GRPC_PORT: 'GRPC_PORT',
|
|
15
17
|
GRPC_URL: 'GRPC_URL',
|
|
16
18
|
LOGGING_PROTO_PATH: 'LOGGING_PROTO_PATH',
|
|
17
19
|
INTERNAL_CONFIG_KEY: 'INTERNAL_CONFIG_KEY',
|
|
18
20
|
RATE_LIMIT_TTL: 'RATE_LIMIT_TTL',
|
|
19
21
|
RATE_LIMIT_MAX: 'RATE_LIMIT_MAX',
|
|
22
|
+
NOTIFICATION_SERVICE_URL: 'NOTIFICATION_SERVICE_URL',
|
|
23
|
+
LOG_FILE_PATH: 'LOG_FILE_PATH',
|
|
24
|
+
LOG_RETENTION_DAYS: 'LOG_RETENTION_DAYS',
|
|
20
25
|
CORS_ORIGINS: 'CORS_ORIGINS',
|
|
26
|
+
USER_SERVICE_URL: 'USER_SERVICE_URL',
|
|
27
|
+
USER_PROTO_PATH: 'USER_PROTO_PATH',
|
|
28
|
+
AUTH_SERVICE_URL: 'AUTH_SERVICE_URL',
|
|
29
|
+
AUTH_PROTO_PATH: 'AUTH_PROTO_PATH',
|
|
30
|
+
LOGGING_SERVICE_URL: 'LOGGING_SERVICE_URL',
|
|
31
|
+
TOKEN_SERVICE_URL: 'TOKEN_SERVICE_URL',
|
|
32
|
+
TOKEN_PROTO_PATH: 'TOKEN_PROTO_PATH',
|
|
33
|
+
CONFIG_SERVICE_URL: 'CONFIG_SERVICE_URL',
|
|
34
|
+
CONFIG_SERVICE_ENABLED: 'CONFIG_SERVICE_ENABLED',
|
|
21
35
|
};
|
|
22
36
|
exports.ENV_VALUES = {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
37
|
+
NODE_ENV: {
|
|
38
|
+
DEVELOPMENT: 'development',
|
|
39
|
+
PRODUCTION: 'production',
|
|
40
|
+
TEST: 'test',
|
|
41
|
+
STAGING: 'staging',
|
|
42
|
+
LOCAL: 'local',
|
|
43
|
+
},
|
|
27
44
|
};
|
|
28
45
|
//# sourceMappingURL=env.constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env.constants.js","sourceRoot":"","sources":["../../src/constants/env.constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,QAAQ,GAAG;IACpB,QAAQ,EAAE,UAAU;IACpB,IAAI,EAAE,MAAM;IACZ,YAAY,EAAE,cAAc;IAC5B,UAAU,EAAE,YAAY;IACxB,UAAU,EAAE,YAAY;IACxB,cAAc,EAAE,gBAAgB;IAChC,aAAa,EAAE,eAAe;IAC9B,YAAY,EAAE,cAAc;IAC5B,UAAU,EAAE,YAAY;IACxB,SAAS,EAAE,WAAW;IACtB,QAAQ,EAAE,UAAU;IACpB,kBAAkB,EAAE,oBAAoB;IACxC,mBAAmB,EAAE,qBAAqB;IAC1C,cAAc,EAAE,gBAAgB;IAChC,cAAc,EAAE,gBAAgB;IAChC,YAAY,EAAE,cAAc;
|
|
1
|
+
{"version":3,"file":"env.constants.js","sourceRoot":"","sources":["../../src/constants/env.constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,QAAQ,GAAG;IACpB,QAAQ,EAAE,UAAU;IACpB,IAAI,EAAE,MAAM;IACZ,YAAY,EAAE,cAAc;IAC5B,UAAU,EAAE,YAAY;IACxB,UAAU,EAAE,YAAY;IACxB,cAAc,EAAE,gBAAgB;IAChC,aAAa,EAAE,eAAe;IAC9B,YAAY,EAAE,cAAc;IAC5B,UAAU,EAAE,YAAY;IACxB,cAAc,EAAE,gBAAgB;IAChC,sBAAsB,EAAE,wBAAwB;IAChD,SAAS,EAAE,WAAW;IACtB,QAAQ,EAAE,UAAU;IACpB,kBAAkB,EAAE,oBAAoB;IACxC,mBAAmB,EAAE,qBAAqB;IAC1C,cAAc,EAAE,gBAAgB;IAChC,cAAc,EAAE,gBAAgB;IAChC,wBAAwB,EAAE,0BAA0B;IACpD,aAAa,EAAE,eAAe;IAC9B,kBAAkB,EAAE,oBAAoB;IACxC,YAAY,EAAE,cAAc;IAC5B,gBAAgB,EAAE,kBAAkB;IACpC,eAAe,EAAE,iBAAiB;IAClC,gBAAgB,EAAE,kBAAkB;IACpC,eAAe,EAAE,iBAAiB;IAClC,mBAAmB,EAAE,qBAAqB;IAC1C,iBAAiB,EAAE,mBAAmB;IACtC,gBAAgB,EAAE,kBAAkB;IACpC,kBAAkB,EAAE,oBAAoB;IACxC,sBAAsB,EAAE,wBAAwB;CAC1C,CAAC;AAEE,QAAA,UAAU,GAAG;IACtB,QAAQ,EAAE;QACN,WAAW,EAAE,aAAa;QAC1B,UAAU,EAAE,YAAY;QACxB,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,SAAS;QAClB,KAAK,EAAE,OAAO;KACjB;CACK,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ErrorMessages: Record<string, string>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ErrorMessages = void 0;
|
|
4
|
+
const error_enum_1 = require("../enums/error.enum");
|
|
5
|
+
exports.ErrorMessages = {
|
|
6
|
+
[error_enum_1.ErrorCode.INTERNAL_SERVER_ERROR]: 'An internal server error occurred. Please try again later.',
|
|
7
|
+
[error_enum_1.ErrorCode.VALIDATION_ERROR]: 'Input validation failed. Please check your data.',
|
|
8
|
+
[error_enum_1.ErrorCode.AUTH_INVALID_TOKEN]: 'Your session token is invalid or has been revoked.',
|
|
9
|
+
[error_enum_1.ErrorCode.AUTH_TOKEN_EXPIRED]: 'Your session has expired. Please log in again.',
|
|
10
|
+
[error_enum_1.ErrorCode.AUTH_ACCESS_DENIED]: 'Access denied. You do not have the required role or scope.',
|
|
11
|
+
[error_enum_1.ErrorCode.NOT_FOUND]: 'The requested resource was not found.',
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=error-messages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-messages.js","sourceRoot":"","sources":["../../src/constants/error-messages.ts"],"names":[],"mappings":";;;AAAA,oDAAgD;AAEnC,QAAA,aAAa,GAA2B;IACjD,CAAC,sBAAS,CAAC,qBAAqB,CAAC,EAAE,4DAA4D;IAC/F,CAAC,sBAAS,CAAC,gBAAgB,CAAC,EAAE,kDAAkD;IAChF,CAAC,sBAAS,CAAC,kBAAkB,CAAC,EAAE,oDAAoD;IACpF,CAAC,sBAAS,CAAC,kBAAkB,CAAC,EAAE,gDAAgD;IAChF,CAAC,sBAAS,CAAC,kBAAkB,CAAC,EAAE,4DAA4D;IAC5F,CAAC,sBAAS,CAAC,SAAS,CAAC,EAAE,uCAAuC;CACjE,CAAC"}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
export declare const GRPC_PACKAGES: {
|
|
2
2
|
readonly LOGGING: "logging";
|
|
3
3
|
readonly CONFIG: "config";
|
|
4
|
+
readonly AUTH: "auth";
|
|
5
|
+
readonly USER: "user";
|
|
4
6
|
};
|
|
5
7
|
export declare const GRPC_METHODS: {
|
|
6
8
|
readonly LOGGING: {
|
|
9
|
+
readonly SERVICE: "LoggingService";
|
|
7
10
|
readonly LOG_EVENT: "LogEvent";
|
|
8
11
|
readonly LOG_USER_ACTION: "LogUserAction";
|
|
9
12
|
readonly UPDATE_SERVICE_STATUS: "UpdateServiceStatus";
|
|
@@ -11,4 +14,27 @@ export declare const GRPC_METHODS: {
|
|
|
11
14
|
readonly GET_SERVICE_STATUS: "GetServiceStatus";
|
|
12
15
|
readonly GET_USER_ACTIONS: "GetUserActions";
|
|
13
16
|
};
|
|
17
|
+
readonly AUTH: {
|
|
18
|
+
readonly SERVICE: "AuthService";
|
|
19
|
+
readonly LOGIN: "Login";
|
|
20
|
+
readonly REGISTER: "Register";
|
|
21
|
+
readonly VALIDATE: "Validate";
|
|
22
|
+
readonly GET_USER_BY_ID: "GetUserById";
|
|
23
|
+
readonly GET_USER_BY_EMAIL: "GetUserByEmail";
|
|
24
|
+
readonly VALIDATE_TOKEN: "ValidateToken";
|
|
25
|
+
readonly REFRESH_TOKEN: "RefreshToken";
|
|
26
|
+
readonly REVOKE_TOKEN: "RevokeToken";
|
|
27
|
+
readonly CHECK_PERMISSION: "CheckPermission";
|
|
28
|
+
readonly GET_USER_PERMISSIONS: "GetUserPermissions";
|
|
29
|
+
};
|
|
30
|
+
readonly USER: {
|
|
31
|
+
readonly SERVICE: "UserService";
|
|
32
|
+
readonly GET_USER_BY_ID: "GetUserById";
|
|
33
|
+
readonly GET_USER_By_EMAIL: "GetUserByEmail";
|
|
34
|
+
readonly GET_USER_PERMISSIONS: "GetUserPermissions";
|
|
35
|
+
readonly CREATE_USER: "CreateUser";
|
|
36
|
+
readonly UPDATE_USER: "UpdateUser";
|
|
37
|
+
readonly UPDATE_PROFILE: "UpdateProfile";
|
|
38
|
+
readonly DELETE_USER: "DeleteUser";
|
|
39
|
+
};
|
|
14
40
|
};
|
|
@@ -4,9 +4,12 @@ exports.GRPC_METHODS = exports.GRPC_PACKAGES = void 0;
|
|
|
4
4
|
exports.GRPC_PACKAGES = {
|
|
5
5
|
LOGGING: 'logging',
|
|
6
6
|
CONFIG: 'config',
|
|
7
|
+
AUTH: 'auth',
|
|
8
|
+
USER: 'user',
|
|
7
9
|
};
|
|
8
10
|
exports.GRPC_METHODS = {
|
|
9
11
|
LOGGING: {
|
|
12
|
+
SERVICE: 'LoggingService',
|
|
10
13
|
LOG_EVENT: 'LogEvent',
|
|
11
14
|
LOG_USER_ACTION: 'LogUserAction',
|
|
12
15
|
UPDATE_SERVICE_STATUS: 'UpdateServiceStatus',
|
|
@@ -14,5 +17,28 @@ exports.GRPC_METHODS = {
|
|
|
14
17
|
GET_SERVICE_STATUS: 'GetServiceStatus',
|
|
15
18
|
GET_USER_ACTIONS: 'GetUserActions',
|
|
16
19
|
},
|
|
20
|
+
AUTH: {
|
|
21
|
+
SERVICE: 'AuthService',
|
|
22
|
+
LOGIN: 'Login',
|
|
23
|
+
REGISTER: 'Register',
|
|
24
|
+
VALIDATE: 'Validate',
|
|
25
|
+
GET_USER_BY_ID: 'GetUserById',
|
|
26
|
+
GET_USER_BY_EMAIL: 'GetUserByEmail',
|
|
27
|
+
VALIDATE_TOKEN: 'ValidateToken',
|
|
28
|
+
REFRESH_TOKEN: 'RefreshToken',
|
|
29
|
+
REVOKE_TOKEN: 'RevokeToken',
|
|
30
|
+
CHECK_PERMISSION: 'CheckPermission',
|
|
31
|
+
GET_USER_PERMISSIONS: 'GetUserPermissions',
|
|
32
|
+
},
|
|
33
|
+
USER: {
|
|
34
|
+
SERVICE: 'UserService',
|
|
35
|
+
GET_USER_BY_ID: 'GetUserById',
|
|
36
|
+
GET_USER_By_EMAIL: 'GetUserByEmail',
|
|
37
|
+
GET_USER_PERMISSIONS: 'GetUserPermissions',
|
|
38
|
+
CREATE_USER: 'CreateUser',
|
|
39
|
+
UPDATE_USER: 'UpdateUser',
|
|
40
|
+
UPDATE_PROFILE: 'UpdateProfile',
|
|
41
|
+
DELETE_USER: 'DeleteUser',
|
|
42
|
+
},
|
|
17
43
|
};
|
|
18
44
|
//# sourceMappingURL=grpc.constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grpc.constants.js","sourceRoot":"","sources":["../../src/constants/grpc.constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,aAAa,GAAG;IACzB,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,QAAQ;
|
|
1
|
+
{"version":3,"file":"grpc.constants.js","sourceRoot":"","sources":["../../src/constants/grpc.constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,aAAa,GAAG;IACzB,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;CACN,CAAC;AAEE,QAAA,YAAY,GAAG;IACxB,OAAO,EAAE;QACL,OAAO,EAAE,gBAAgB;QACzB,SAAS,EAAE,UAAU;QACrB,eAAe,EAAE,eAAe;QAChC,qBAAqB,EAAE,qBAAqB;QAC5C,gBAAgB,EAAE,gBAAgB;QAClC,kBAAkB,EAAE,kBAAkB;QACtC,gBAAgB,EAAE,gBAAgB;KACrC;IACD,IAAI,EAAE;QACF,OAAO,EAAE,aAAa;QACtB,KAAK,EAAE,OAAO;QACd,QAAQ,EAAE,UAAU;QACpB,QAAQ,EAAE,UAAU;QACpB,cAAc,EAAE,aAAa;QAC7B,iBAAiB,EAAE,gBAAgB;QACnC,cAAc,EAAE,eAAe;QAC/B,aAAa,EAAE,cAAc;QAC7B,YAAY,EAAE,aAAa;QAC3B,gBAAgB,EAAE,iBAAiB;QACnC,oBAAoB,EAAE,oBAAoB;KAC7C;IACD,IAAI,EAAE;QACF,OAAO,EAAE,aAAa;QACtB,cAAc,EAAE,aAAa;QAC7B,iBAAiB,EAAE,gBAAgB;QACnC,oBAAoB,EAAE,oBAAoB;QAC1C,WAAW,EAAE,YAAY;QACzB,WAAW,EAAE,YAAY;QACzB,cAAc,EAAE,eAAe;QAC/B,WAAW,EAAE,YAAY;KAC5B;CACK,CAAC"}
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
export * from './env.constants';
|
|
2
2
|
export * from './http.constants';
|
|
3
|
-
export * from './services.constants';
|
|
4
|
-
export * from './grpc.constants';
|
|
5
3
|
export * from './logging.constants';
|
|
4
|
+
export * from './microservices.constants';
|
|
5
|
+
export * from './grpc.constants';
|
|
6
|
+
export * from './error-messages';
|
|
7
|
+
export * from './auth.constants';
|
|
8
|
+
export * from './logging-messages.constants';
|
|
9
|
+
export * from './routes.constants';
|
|
10
|
+
export * from './common.constants';
|
|
11
|
+
export * from './tokens.constants';
|
|
12
|
+
export * from './auth-config.constants';
|
|
13
|
+
export * from './monitoring.constants';
|
package/dist/constants/index.js
CHANGED
|
@@ -16,7 +16,15 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./env.constants"), exports);
|
|
18
18
|
__exportStar(require("./http.constants"), exports);
|
|
19
|
-
__exportStar(require("./services.constants"), exports);
|
|
20
|
-
__exportStar(require("./grpc.constants"), exports);
|
|
21
19
|
__exportStar(require("./logging.constants"), exports);
|
|
20
|
+
__exportStar(require("./microservices.constants"), exports);
|
|
21
|
+
__exportStar(require("./grpc.constants"), exports);
|
|
22
|
+
__exportStar(require("./error-messages"), exports);
|
|
23
|
+
__exportStar(require("./auth.constants"), exports);
|
|
24
|
+
__exportStar(require("./logging-messages.constants"), exports);
|
|
25
|
+
__exportStar(require("./routes.constants"), exports);
|
|
26
|
+
__exportStar(require("./common.constants"), exports);
|
|
27
|
+
__exportStar(require("./tokens.constants"), exports);
|
|
28
|
+
__exportStar(require("./auth-config.constants"), exports);
|
|
29
|
+
__exportStar(require("./monitoring.constants"), exports);
|
|
22
30
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/constants/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAAgC;AAChC,mDAAiC;AACjC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/constants/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAAgC;AAChC,mDAAiC;AACjC,sDAAoC;AACpC,4DAA0C;AAC1C,mDAAiC;AACjC,mDAAiC;AACjC,mDAAiC;AACjC,+DAA6C;AAC7C,qDAAmC;AACnC,qDAAmC;AACnC,qDAAmC;AACnC,0DAAwC;AACxC,yDAAuC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const LOGGING_MESSAGES: {
|
|
2
|
+
USER_LOGGED_IN: string;
|
|
3
|
+
USER_REGISTERED: string;
|
|
4
|
+
USER_LOGGED_OUT: string;
|
|
5
|
+
LOGIN_ATTEMPT_NONEXISTENT_EMAIL: string;
|
|
6
|
+
LOGIN_ATTEMPT_INVALID_PASSWORD: string;
|
|
7
|
+
ACCESS_TOKEN_VALIDATED: string;
|
|
8
|
+
ACCESS_TOKEN_VALIDATION_FAILED: string;
|
|
9
|
+
CONFIG_RELOADED: string;
|
|
10
|
+
VAULT_CONNECTED: string;
|
|
11
|
+
VAULT_CONNECTION_FAILED: string;
|
|
12
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LOGGING_MESSAGES = void 0;
|
|
4
|
+
exports.LOGGING_MESSAGES = {
|
|
5
|
+
USER_LOGGED_IN: 'User successfully logged in',
|
|
6
|
+
USER_REGISTERED: 'New user registered',
|
|
7
|
+
USER_LOGGED_OUT: 'User logged out',
|
|
8
|
+
LOGIN_ATTEMPT_NONEXISTENT_EMAIL: 'Login attempt with non-existent email',
|
|
9
|
+
LOGIN_ATTEMPT_INVALID_PASSWORD: 'Login attempt with invalid password',
|
|
10
|
+
ACCESS_TOKEN_VALIDATED: 'Access token successfully validated',
|
|
11
|
+
ACCESS_TOKEN_VALIDATION_FAILED: 'Access token validation failed',
|
|
12
|
+
CONFIG_RELOADED: 'Configuration successfully reloaded',
|
|
13
|
+
VAULT_CONNECTED: 'Connected to HashiCorp Vault',
|
|
14
|
+
VAULT_CONNECTION_FAILED: 'Failed to connect to HashiCorp Vault',
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=logging-messages.constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logging-messages.constants.js","sourceRoot":"","sources":["../../src/constants/logging-messages.constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,gBAAgB,GAAG;IAC5B,cAAc,EAAE,6BAA6B;IAC7C,eAAe,EAAE,qBAAqB;IACtC,eAAe,EAAE,iBAAiB;IAElC,+BAA+B,EAAE,uCAAuC;IACxE,8BAA8B,EAAE,qCAAqC;IAErE,sBAAsB,EAAE,qCAAqC;IAC7D,8BAA8B,EAAE,gCAAgC;IAEhE,eAAe,EAAE,qCAAqC;IACtD,eAAe,EAAE,8BAA8B;IAC/C,uBAAuB,EAAE,sCAAsC;CAClE,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare const MICROSERVICES: {
|
|
2
|
+
readonly CONFIG: {
|
|
3
|
+
readonly SERVICE_NAME: "CONFIG_SERVICE";
|
|
4
|
+
readonly PACKAGE: "config";
|
|
5
|
+
};
|
|
6
|
+
readonly LOGGING: {
|
|
7
|
+
readonly SERVICE_NAME: "LOGGING_SERVICE";
|
|
8
|
+
readonly PACKAGE: "logging";
|
|
9
|
+
};
|
|
10
|
+
readonly AUTH: {
|
|
11
|
+
readonly SERVICE_NAME: "AUTH_SERVICE";
|
|
12
|
+
readonly PACKAGE: "auth";
|
|
13
|
+
};
|
|
14
|
+
readonly USER: {
|
|
15
|
+
readonly SERVICE_NAME: "USER_SERVICE";
|
|
16
|
+
readonly PACKAGE: "user";
|
|
17
|
+
};
|
|
18
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MICROSERVICES = void 0;
|
|
4
|
+
exports.MICROSERVICES = {
|
|
5
|
+
CONFIG: {
|
|
6
|
+
SERVICE_NAME: 'CONFIG_SERVICE',
|
|
7
|
+
PACKAGE: 'config',
|
|
8
|
+
},
|
|
9
|
+
LOGGING: {
|
|
10
|
+
SERVICE_NAME: 'LOGGING_SERVICE',
|
|
11
|
+
PACKAGE: 'logging',
|
|
12
|
+
},
|
|
13
|
+
AUTH: {
|
|
14
|
+
SERVICE_NAME: 'AUTH_SERVICE',
|
|
15
|
+
PACKAGE: 'auth',
|
|
16
|
+
},
|
|
17
|
+
USER: {
|
|
18
|
+
SERVICE_NAME: 'USER_SERVICE',
|
|
19
|
+
PACKAGE: 'user',
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=microservices.constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"microservices.constants.js","sourceRoot":"","sources":["../../src/constants/microservices.constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,aAAa,GAAG;IACzB,MAAM,EAAE;QACJ,YAAY,EAAE,gBAAgB;QAC9B,OAAO,EAAE,QAAQ;KACpB;IACD,OAAO,EAAE;QACL,YAAY,EAAE,iBAAiB;QAC/B,OAAO,EAAE,SAAS;KACrB;IACD,IAAI,EAAE;QACF,YAAY,EAAE,cAAc;QAC5B,OAAO,EAAE,MAAM;KAClB;IACD,IAAI,EAAE;QACF,YAAY,EAAE,cAAc;QAC5B,OAAO,EAAE,MAAM;KAClB;CACK,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export declare const PROMETHEUS_METRICS: {
|
|
2
|
+
readonly HTTP_REQUESTS_TOTAL: "http_requests_total";
|
|
3
|
+
readonly HTTP_REQUEST_DURATION: "http_request_duration_seconds";
|
|
4
|
+
readonly HTTP_ERRORS_TOTAL: "http_errors_total";
|
|
5
|
+
readonly HTTP_RESPONSE_SIZE: "http_response_size_bytes";
|
|
6
|
+
readonly DB_CONNECTIONS_ACTIVE: "db_connections_active";
|
|
7
|
+
readonly DB_CONNECTIONS_IDLE: "db_connections_idle";
|
|
8
|
+
readonly DB_QUERY_DURATION: "db_query_duration_seconds";
|
|
9
|
+
readonly DB_QUERIES_TOTAL: "db_queries_total";
|
|
10
|
+
readonly DB_ERRORS_TOTAL: "db_errors_total";
|
|
11
|
+
readonly GRPC_REQUESTS_TOTAL: "grpc_requests_total";
|
|
12
|
+
readonly GRPC_REQUEST_DURATION: "grpc_request_duration_seconds";
|
|
13
|
+
readonly GRPC_ERRORS_TOTAL: "grpc_errors_total";
|
|
14
|
+
readonly KAFKA_MESSAGES_SENT: "kafka_messages_sent_total";
|
|
15
|
+
readonly KAFKA_MESSAGES_RECEIVED: "kafka_messages_received_total";
|
|
16
|
+
readonly KAFKA_ERRORS_TOTAL: "kafka_errors_total";
|
|
17
|
+
readonly PROCESS_CPU_USAGE: "process_cpu_usage_percent";
|
|
18
|
+
readonly PROCESS_MEMORY_USAGE: "process_memory_usage_bytes";
|
|
19
|
+
readonly PROCESS_HEAP_USED: "process_heap_used_bytes";
|
|
20
|
+
readonly PROCESS_HEAP_TOTAL: "process_heap_total_bytes";
|
|
21
|
+
readonly PROCESS_UPTIME: "process_uptime_seconds";
|
|
22
|
+
readonly ACTIVE_USERS: "active_users_total";
|
|
23
|
+
readonly REGISTERED_USERS: "registered_users_total";
|
|
24
|
+
readonly REQUESTS_PER_SECOND: "requests_per_second";
|
|
25
|
+
readonly ERROR_RATE: "error_rate_percent";
|
|
26
|
+
readonly CACHE_HITS: "cache_hits_total";
|
|
27
|
+
readonly CACHE_MISSES: "cache_misses_total";
|
|
28
|
+
readonly CACHE_SIZE: "cache_size_bytes";
|
|
29
|
+
};
|
|
30
|
+
export declare const METRIC_LABELS: {
|
|
31
|
+
readonly SERVICE: "service";
|
|
32
|
+
readonly METHOD: "method";
|
|
33
|
+
readonly STATUS: "status";
|
|
34
|
+
readonly ENDPOINT: "endpoint";
|
|
35
|
+
readonly ERROR_TYPE: "error_type";
|
|
36
|
+
readonly DATABASE: "database";
|
|
37
|
+
readonly QUERY_TYPE: "query_type";
|
|
38
|
+
readonly USER_ROLE: "user_role";
|
|
39
|
+
readonly GRPC_METHOD: "grpc_method";
|
|
40
|
+
readonly KAFKA_TOPIC: "kafka_topic";
|
|
41
|
+
};
|
|
42
|
+
export declare const HEALTH_CHECK_ENDPOINTS: {
|
|
43
|
+
readonly LIVENESS: "/health/liveness";
|
|
44
|
+
readonly READINESS: "/health/readiness";
|
|
45
|
+
readonly STARTUP: "/health/startup";
|
|
46
|
+
};
|
|
47
|
+
export declare const MONITORING_CONFIG: {
|
|
48
|
+
readonly SCRAPE_INTERVAL: 15;
|
|
49
|
+
readonly SCRAPE_TIMEOUT: 10;
|
|
50
|
+
readonly RETENTION_DAYS: 15;
|
|
51
|
+
};
|