phx-node 1.0.178 → 1.0.179
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.
|
@@ -28,28 +28,25 @@ export interface PushNotiMobile {
|
|
|
28
28
|
module_code: string;
|
|
29
29
|
app: string;
|
|
30
30
|
payload: any;
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
note?: string;
|
|
32
|
+
description?: string;
|
|
33
33
|
}
|
|
34
|
-
export interface
|
|
34
|
+
export interface InappNotiEmail {
|
|
35
35
|
emailType: EmailType;
|
|
36
|
-
to: string;
|
|
37
36
|
subject: string;
|
|
38
37
|
title: string;
|
|
39
38
|
previewText: string;
|
|
40
|
-
isValidEmail?: boolean;
|
|
41
39
|
callToActionURL?: string;
|
|
42
40
|
callToActionText?: string;
|
|
43
41
|
content?: string;
|
|
44
42
|
listRequests?: IGroupRequestType[];
|
|
45
43
|
description?: string;
|
|
46
|
-
schoolId?: number;
|
|
47
44
|
tag?: string;
|
|
48
45
|
attachments?: Attachment[];
|
|
49
46
|
footerMessage?: string;
|
|
50
47
|
}
|
|
51
48
|
export interface RequiredAction {
|
|
52
|
-
|
|
49
|
+
task_target_id: string;
|
|
53
50
|
due_date?: string;
|
|
54
51
|
}
|
|
55
52
|
export interface CompleteRequiredAction {
|
|
@@ -57,20 +54,36 @@ export interface CompleteRequiredAction {
|
|
|
57
54
|
user_id: number;
|
|
58
55
|
app?: string;
|
|
59
56
|
action_code: string;
|
|
60
|
-
|
|
57
|
+
task_target_id: string;
|
|
61
58
|
}
|
|
62
59
|
export declare const ACTION_CODES: readonly ["hrm-checkin-remote-don-cho-duyet", "hrm-checkin-remote-phe-duyet-don", "hrm-checkin-overtime-don-cho-duyet", "hrm-checkin-overtime-phe-duyet-don", "hrm-checkin-leave-don-cho-duyet", "hrm-checkin-leave-phe-duyet-don", "hrm-checkin-late-early-don-cho-duyet", "hrm-checkin-late-early-phe-duyet-don", "hrm-checkin-explanation-don-cho-duyet", "hrm-checkin-explanation-phe-duyet-don", "hrm-checkin-shift-duty-don-cho-duyet", "hrm-checkin-shift-duty-phe-duyet-don"];
|
|
63
60
|
type LiteralUnion<LiteralType extends BaseType, BaseType = string> = LiteralType | (BaseType & {});
|
|
64
61
|
export type ActionCode = LiteralUnion<(typeof ACTION_CODES)[number], string>;
|
|
65
62
|
export interface PushInappNoti {
|
|
66
|
-
user_id: number;
|
|
67
|
-
action_code: ActionCode;
|
|
68
63
|
hostname: string;
|
|
64
|
+
send_to_user_id: number;
|
|
65
|
+
action_code: ActionCode;
|
|
69
66
|
student_id?: number;
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
67
|
+
notification_type?: NotificationType;
|
|
68
|
+
call_to_action_url?: string;
|
|
69
|
+
mobile_push?: {
|
|
70
|
+
enabled: true;
|
|
71
|
+
data: PushNotiMobile;
|
|
72
|
+
} | {
|
|
73
|
+
enabled: false;
|
|
74
|
+
};
|
|
75
|
+
email_push?: {
|
|
76
|
+
enabled: true;
|
|
77
|
+
data: InappNotiEmail;
|
|
78
|
+
} | {
|
|
79
|
+
enabled: false;
|
|
80
|
+
};
|
|
81
|
+
create_required_action?: {
|
|
82
|
+
enabled: true;
|
|
83
|
+
data: RequiredAction;
|
|
84
|
+
} | {
|
|
85
|
+
enabled: false;
|
|
86
|
+
};
|
|
74
87
|
}
|
|
75
88
|
export declare class PHXPushNotificationService {
|
|
76
89
|
private readonly httpService;
|
|
@@ -17,6 +17,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
17
17
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
18
18
|
});
|
|
19
19
|
};
|
|
20
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
21
|
+
var t = {};
|
|
22
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
23
|
+
t[p] = s[p];
|
|
24
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
25
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
26
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
27
|
+
t[p[i]] = s[p[i]];
|
|
28
|
+
}
|
|
29
|
+
return t;
|
|
30
|
+
};
|
|
20
31
|
var PHXPushNotificationService_1;
|
|
21
32
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
33
|
exports.PHXPushNotificationService = exports.ACTION_CODES = exports.NotificationType = exports.EmailType = void 0;
|
|
@@ -59,7 +70,7 @@ let PHXPushNotificationService = PHXPushNotificationService_1 = class PHXPushNot
|
|
|
59
70
|
pushNoti(payload) {
|
|
60
71
|
return __awaiter(this, void 0, void 0, function* () {
|
|
61
72
|
var _a, _b;
|
|
62
|
-
const { hostname } = payload;
|
|
73
|
+
const { hostname } = payload, dto = __rest(payload, ["hostname"]);
|
|
63
74
|
const producerApi = this.configService.get("PRODUCER_API");
|
|
64
75
|
if (!producerApi) {
|
|
65
76
|
const errorMessage = `${hostname}: PRODUCER_API is not configured`;
|
|
@@ -67,7 +78,7 @@ let PHXPushNotificationService = PHXPushNotificationService_1 = class PHXPushNot
|
|
|
67
78
|
throw new Error(errorMessage);
|
|
68
79
|
}
|
|
69
80
|
try {
|
|
70
|
-
const { data } = yield (0, rxjs_1.lastValueFrom)(this.httpService.post(`${producerApi}/emit/inapp-noti`,
|
|
81
|
+
const { data } = yield (0, rxjs_1.lastValueFrom)(this.httpService.post(`${producerApi}/emit/inapp-noti`, dto, {
|
|
71
82
|
headers: {
|
|
72
83
|
hostname,
|
|
73
84
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"push-notification.service.js","sourceRoot":"","sources":["../../../src/module/inapp-noti/push-notification.service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"push-notification.service.js","sourceRoot":"","sources":["../../../src/module/inapp-noti/push-notification.service.ts"],"names":[],"mappings":";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