@konplit-services/common 1.0.52 → 1.0.54
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/build/events/logs-events/interfaces/admins-logs.created.interface.d.ts +2 -2
- package/build/events/logs-events/interfaces/merchants-logs-created.interface.d.ts +2 -2
- package/build/events/notification-events/interfaces/mailersend.interface.d.ts +2 -2
- package/build/events/notification-events/interfaces/termii-sms.interface.d.ts +2 -2
- package/build/events/subjects.d.ts +4 -8
- package/build/events/subjects.js +2 -6
- package/build/notification/sms/send.js +6 -1
- package/package.json +1 -1
|
@@ -2,8 +2,8 @@ import { LOGACTIONS } from "../../../log-activities/actions";
|
|
|
2
2
|
import { StreamEvent, StreamName, Subjects } from "../../subjects";
|
|
3
3
|
export interface AdminLogsCreatedEvent {
|
|
4
4
|
subject: Subjects.AdminLogCreated;
|
|
5
|
-
streamName: StreamName.
|
|
6
|
-
streamEvents: StreamEvent.
|
|
5
|
+
streamName: StreamName.name;
|
|
6
|
+
streamEvents: StreamEvent.Event;
|
|
7
7
|
data: {
|
|
8
8
|
id?: string;
|
|
9
9
|
role?: string;
|
|
@@ -2,8 +2,8 @@ import { LOGACTIONS } from "../../../log-activities/actions";
|
|
|
2
2
|
import { StreamEvent, StreamName, Subjects } from "../../subjects";
|
|
3
3
|
export interface MerchantLogsCreatedEvent {
|
|
4
4
|
subject: Subjects.MerchantLogCreated;
|
|
5
|
-
streamName: StreamName.
|
|
6
|
-
streamEvents: StreamEvent.
|
|
5
|
+
streamName: StreamName.name;
|
|
6
|
+
streamEvents: StreamEvent.Event;
|
|
7
7
|
data: {
|
|
8
8
|
id?: string;
|
|
9
9
|
email?: string;
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { StreamEvent, StreamName, Subjects } from "../../subjects";
|
|
3
3
|
export interface MailersendEmailCreatedEvent {
|
|
4
4
|
subject: Subjects.NotificationEmailCreated;
|
|
5
|
-
streamName: StreamName.
|
|
6
|
-
streamEvents: StreamEvent.
|
|
5
|
+
streamName: StreamName.name;
|
|
6
|
+
streamEvents: StreamEvent.Event;
|
|
7
7
|
data: {
|
|
8
8
|
to: string;
|
|
9
9
|
subject: string;
|
|
@@ -2,7 +2,7 @@ import { SendSmsRequest } from "../../../notification";
|
|
|
2
2
|
import { StreamEvent, StreamName, Subjects } from "../../subjects";
|
|
3
3
|
export interface TermiiSmsCreatedEvent {
|
|
4
4
|
subject: Subjects.NotificationSmsCreated;
|
|
5
|
-
streamName: StreamName.
|
|
6
|
-
streamEvents: StreamEvent.
|
|
5
|
+
streamName: StreamName.name;
|
|
6
|
+
streamEvents: StreamEvent.Event;
|
|
7
7
|
data: SendSmsRequest;
|
|
8
8
|
}
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
export declare enum StreamEvent {
|
|
2
|
-
Event = "events.>"
|
|
3
|
-
LOG = "logs.>",
|
|
4
|
-
Notification = "notifications.>"
|
|
2
|
+
Event = "events.>"
|
|
5
3
|
}
|
|
6
4
|
export declare enum StreamName {
|
|
7
|
-
name = "EVENTS"
|
|
8
|
-
logName = "LOGS",
|
|
9
|
-
NotificationName = "NOTIFICATIONS"
|
|
5
|
+
name = "EVENTS"
|
|
10
6
|
}
|
|
11
7
|
export declare enum Subjects {
|
|
12
8
|
AccountCreated = "events.account.created",
|
|
@@ -23,8 +19,8 @@ export declare enum Subjects {
|
|
|
23
19
|
PermissionUpdated = "events.permission.updated",
|
|
24
20
|
PermissionRemoved = "events.permission.removed",
|
|
25
21
|
AddPermissionToUser = "events.add.permission.to.user",
|
|
26
|
-
NotificationSmsCreated = "
|
|
27
|
-
NotificationEmailCreated = "
|
|
22
|
+
NotificationSmsCreated = "events.notification.sms.created",
|
|
23
|
+
NotificationEmailCreated = "events.notification.email.created",
|
|
28
24
|
UserRoleUpdated = "events.user.role.updated",
|
|
29
25
|
AdminLogCreated = "events.admin.log.created"
|
|
30
26
|
}
|
package/build/events/subjects.js
CHANGED
|
@@ -4,14 +4,10 @@ exports.Subjects = exports.StreamName = exports.StreamEvent = void 0;
|
|
|
4
4
|
var StreamEvent;
|
|
5
5
|
(function (StreamEvent) {
|
|
6
6
|
StreamEvent["Event"] = "events.>";
|
|
7
|
-
StreamEvent["LOG"] = "logs.>";
|
|
8
|
-
StreamEvent["Notification"] = "notifications.>";
|
|
9
7
|
})(StreamEvent = exports.StreamEvent || (exports.StreamEvent = {}));
|
|
10
8
|
var StreamName;
|
|
11
9
|
(function (StreamName) {
|
|
12
10
|
StreamName["name"] = "EVENTS";
|
|
13
|
-
StreamName["logName"] = "LOGS";
|
|
14
|
-
StreamName["NotificationName"] = "NOTIFICATIONS";
|
|
15
11
|
})(StreamName = exports.StreamName || (exports.StreamName = {}));
|
|
16
12
|
var Subjects;
|
|
17
13
|
(function (Subjects) {
|
|
@@ -35,8 +31,8 @@ var Subjects;
|
|
|
35
31
|
Subjects["PermissionRemoved"] = "events.permission.removed";
|
|
36
32
|
Subjects["AddPermissionToUser"] = "events.add.permission.to.user";
|
|
37
33
|
//Notification
|
|
38
|
-
Subjects["NotificationSmsCreated"] = "
|
|
39
|
-
Subjects["NotificationEmailCreated"] = "
|
|
34
|
+
Subjects["NotificationSmsCreated"] = "events.notification.sms.created";
|
|
35
|
+
Subjects["NotificationEmailCreated"] = "events.notification.email.created";
|
|
40
36
|
// Roles
|
|
41
37
|
Subjects["UserRoleUpdated"] = "events.user.role.updated";
|
|
42
38
|
Subjects["AdminLogCreated"] = "events.admin.log.created";
|
|
@@ -14,11 +14,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.sendSms = void 0;
|
|
16
16
|
const axios_1 = __importDefault(require("axios"));
|
|
17
|
+
const node_querystring_1 = __importDefault(require("node:querystring"));
|
|
17
18
|
const sendSms = (request) => __awaiter(void 0, void 0, void 0, function* () {
|
|
18
19
|
var _a;
|
|
19
20
|
const url = "https://api.ng.termii.com/api/sms/send";
|
|
20
21
|
try {
|
|
21
|
-
const response = yield axios_1.default.post(url, request)
|
|
22
|
+
const response = yield axios_1.default.post(url, node_querystring_1.default.encode(Object.assign({}, request)), {
|
|
23
|
+
headers: {
|
|
24
|
+
"Content-Type": "application/x-www-form-urlencoded",
|
|
25
|
+
},
|
|
26
|
+
});
|
|
22
27
|
return response.data;
|
|
23
28
|
}
|
|
24
29
|
catch (error) {
|