@konplit-services/common 1.0.206 → 1.0.207
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.
|
@@ -8,6 +8,7 @@ import { JetStreamClient } from "nats";
|
|
|
8
8
|
import { LOGACTIONS } from "../log-activities/actions";
|
|
9
9
|
import { JWT_Data } from "./Jwt";
|
|
10
10
|
import { EmailValidationTypes, SMSTYPE } from "../notification";
|
|
11
|
+
import { GatewayError } from "../errors";
|
|
11
12
|
interface User {
|
|
12
13
|
id?: string;
|
|
13
14
|
email?: string;
|
|
@@ -22,6 +23,7 @@ export declare class Service {
|
|
|
22
23
|
protected NotAuthorizedError: typeof NotAuthorizedError;
|
|
23
24
|
protected ServiceNotAvailableError: typeof ServiceNotAvailableError;
|
|
24
25
|
protected AxiosRequestError: typeof AxiosRequestError;
|
|
26
|
+
protected GatewayError: typeof GatewayError;
|
|
25
27
|
activityLog(client: JetStreamClient, user: Partial<User> | Partial<JWT_Data>, action: LOGACTIONS, data: any): void;
|
|
26
28
|
merchantOnlyLogs(client: JetStreamClient, user: Partial<User> | Partial<JWT_Data>, action: LOGACTIONS, data: any): void;
|
|
27
29
|
sendSMS(token: string, type: SMSTYPE, data: any, client: JetStreamClient): void;
|
|
@@ -15,6 +15,7 @@ const app_configs_1 = require("../app.configs");
|
|
|
15
15
|
const util_1 = require("../util");
|
|
16
16
|
const email_publisher_1 = require("../events/publisher/email.publisher");
|
|
17
17
|
const sms_publisher_1 = require("../events/publisher/sms.publisher");
|
|
18
|
+
const errors_1 = require("../errors");
|
|
18
19
|
class Service {
|
|
19
20
|
constructor() {
|
|
20
21
|
this.NotFoundError = not_found_1.NotFoundError;
|
|
@@ -23,6 +24,7 @@ class Service {
|
|
|
23
24
|
this.NotAuthorizedError = notAuthorized_1.NotAuthorizedError;
|
|
24
25
|
this.ServiceNotAvailableError = service_not_available_1.ServiceNotAvailableError;
|
|
25
26
|
this.AxiosRequestError = axios_request_error_1.AxiosRequestError;
|
|
27
|
+
this.GatewayError = errors_1.GatewayError;
|
|
26
28
|
}
|
|
27
29
|
activityLog(client, user, action, data) {
|
|
28
30
|
if (Object.values(helper_1.AdminRoles).includes(user.role)) {
|