phx-node 1.0.62 → 1.0.64
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/module/api/api.service.d.ts +1 -0
- package/dist/module/api/api.service.js +21 -0
- package/dist/module/api/api.service.js.map +1 -1
- package/dist/module/notification/statistical-notification.service.d.ts +2 -2
- package/dist/module/notification/statistical-notification.service.js +2 -3
- package/dist/module/notification/statistical-notification.service.js.map +1 -1
- package/dist/query/notification/query.d.ts +5 -2
- package/dist/query/notification/query.js +4 -4
- package/dist/query/notification/query.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -7,4 +7,5 @@ export declare class ApiService {
|
|
|
7
7
|
constructor(configService: ConfigService, httpService: HttpService);
|
|
8
8
|
postData(req: any, end_point: string): Promise<any>;
|
|
9
9
|
postDataV3(req: any, end_point: string, hostname: string): Promise<any>;
|
|
10
|
+
getData(req: any, end_point: string, hostname: string): Promise<any>;
|
|
10
11
|
}
|
|
@@ -73,6 +73,27 @@ let ApiService = ApiService_1 = class ApiService {
|
|
|
73
73
|
}
|
|
74
74
|
});
|
|
75
75
|
}
|
|
76
|
+
getData(req, end_point, hostname) {
|
|
77
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
78
|
+
const URL = this.configService.get("INTERNAL_API_GATEWAY");
|
|
79
|
+
const path = `${URL}${end_point}`;
|
|
80
|
+
const params = req;
|
|
81
|
+
const config = {
|
|
82
|
+
headers: {
|
|
83
|
+
hostname,
|
|
84
|
+
},
|
|
85
|
+
params,
|
|
86
|
+
};
|
|
87
|
+
try {
|
|
88
|
+
const response = yield this.httpService.get(path, config).toPromise();
|
|
89
|
+
return response.data;
|
|
90
|
+
}
|
|
91
|
+
catch (error) {
|
|
92
|
+
this.logger.error(`Failed to get data: ${error.message}`);
|
|
93
|
+
throw error;
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
}
|
|
76
97
|
};
|
|
77
98
|
exports.ApiService = ApiService;
|
|
78
99
|
exports.ApiService = ApiService = ApiService_1 = __decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.service.js","sourceRoot":"","sources":["../../../src/module/api/api.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA+C;AAC/C,2CAAoD;AACpD,yCAA4C;
|
|
1
|
+
{"version":3,"file":"api.service.js","sourceRoot":"","sources":["../../../src/module/api/api.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA+C;AAC/C,2CAAoD;AACpD,yCAA4C;AAIrC,IAAM,UAAU,kBAAhB,MAAM,UAAU;IAErB,YACmB,aAA4B,EAC5B,WAAwB;QADxB,kBAAa,GAAb,aAAa,CAAe;QAC5B,gBAAW,GAAX,WAAW,CAAa;QAH1B,WAAM,GAAG,IAAI,eAAM,CAAC,YAAU,CAAC,IAAI,CAAC,CAAC;IAInD,CAAC;IAES,QAAQ,CAAC,GAAQ,EAAE,SAAiB;;YAC/C,MAAM,GAAG,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;YAClD,MAAM,IAAI,GAAG,GAAG,GAAG,GAAG,SAAS,EAAE,CAAC;YAClC,MAAM,OAAO,GAAG,GAAG,CAAC;YAEpB,MAAM,MAAM,GAAG;gBACb,OAAO,EAAE;oBACP,cAAc,EAAE,SAAS;iBAC1B;aACF,CAAC;YAEF,IAAI,CAAC;gBACH,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,WAAW;qBACpC,IAAI,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,CAAC;qBAC3B,SAAS,EAAE,CAAC;gBACf,OAAO,QAAQ,CAAC,IAAI,CAAC;YACvB,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,wBAAwB,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;gBAC3D,OAAO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KAAK,EAAE,CAAC;gBACf,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,uBAAuB,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;gBAC1D,MAAM,KAAK,CAAC;YACd,CAAC;QACH,CAAC;KAAA;CACF,CAAA;AA/EY,gCAAU;qBAAV,UAAU;IADtB,IAAA,mBAAU,GAAE;qCAIuB,sBAAa;QACf,mBAAW;GAJhC,UAAU,CA+EtB"}
|
|
@@ -10,8 +10,8 @@ export declare class PHXStatisticalNotificationByModuleService {
|
|
|
10
10
|
hostname: string;
|
|
11
11
|
appName: string;
|
|
12
12
|
moduleCode: string;
|
|
13
|
-
studentCode
|
|
14
|
-
action
|
|
13
|
+
studentCode?: string;
|
|
14
|
+
action?: string;
|
|
15
15
|
totalNotification: number;
|
|
16
16
|
totalNotificationImportant: number;
|
|
17
17
|
}): Promise<void>;
|
|
@@ -32,14 +32,13 @@ let PHXStatisticalNotificationByModuleService = PHXStatisticalNotificationByModu
|
|
|
32
32
|
return __awaiter(this, arguments, void 0, function* ({ userId, deviceId, appName, hostname, moduleCode, action, studentCode, totalNotification, totalNotificationImportant, }) {
|
|
33
33
|
yield this.grpcClientSystemService
|
|
34
34
|
.mutationDataCenter({
|
|
35
|
-
query: (0, query_1.MUTATION_UPDATE_NOTIFICATION_UNREAD)(studentCode),
|
|
35
|
+
query: (0, query_1.MUTATION_UPDATE_NOTIFICATION_UNREAD)({ studentCode, action }),
|
|
36
36
|
variables: {
|
|
37
37
|
user_id: userId,
|
|
38
38
|
device_id: deviceId,
|
|
39
39
|
hostname,
|
|
40
40
|
app: appName,
|
|
41
41
|
module_code: moduleCode,
|
|
42
|
-
action,
|
|
43
42
|
total_notification: totalNotification,
|
|
44
43
|
total_notification_important: totalNotificationImportant,
|
|
45
44
|
},
|
|
@@ -55,7 +54,7 @@ let PHXStatisticalNotificationByModuleService = PHXStatisticalNotificationByModu
|
|
|
55
54
|
return;
|
|
56
55
|
yield this.grpcClientSystemService.mutationDataCenter({
|
|
57
56
|
query: query_1.MUTATION_INSERT_NOTIFICATION,
|
|
58
|
-
variables: Object.assign(Object.assign({ user_id: userId, device_id: deviceId, hostname, app: appName, module_code: moduleCode, action }, (studentCode && { student_code: studentCode })), { total_notification: totalNotification, total_notification_important: totalNotificationImportant }),
|
|
57
|
+
variables: Object.assign(Object.assign(Object.assign({ user_id: userId, device_id: deviceId, hostname, app: appName, module_code: moduleCode }, (action && { action })), (studentCode && { student_code: studentCode })), { total_notification: totalNotification, total_notification_important: totalNotificationImportant }),
|
|
59
58
|
});
|
|
60
59
|
this.logger.log('Insert row statistical notification successfully');
|
|
61
60
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"statistical-notification.service.js","sourceRoot":"","sources":["../../../src/module/notification/statistical-notification.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,2CAAkD;AAClD,0DAGwC;AACxC,0FAAqF;AAG9E,IAAM,yCAAyC,iDAA/C,MAAM,yCAAyC;IAElD,YACqB,uBAAmD;QAAnD,4BAAuB,GAAvB,uBAAuB,CAA4B;QAFxE,WAAM,GAAG,IAAI,eAAM,CAAC,2CAAyC,CAAC,IAAI,CAAC,CAAC;IAGjE,CAAC;IAKS,qCAAqC;6DAAC,EAChD,MAAM,EACN,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,UAAU,EACV,MAAM,EACN,WAAW,EACX,iBAAiB,EACjB,0BAA0B,GAW5B;YACG,MAAM,IAAI,CAAC,uBAAuB;iBAC7B,kBAAkB,CAAC;gBAChB,KAAK,EAAE,IAAA,2CAAmC,EAAC,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"statistical-notification.service.js","sourceRoot":"","sources":["../../../src/module/notification/statistical-notification.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,2CAAkD;AAClD,0DAGwC;AACxC,0FAAqF;AAG9E,IAAM,yCAAyC,iDAA/C,MAAM,yCAAyC;IAElD,YACqB,uBA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BAAkB,EAAE,iBAAiB,EACrC,4BAA4B,EAAE,0BAA0B,GAC3D;iBACJ,CAAC,CAAC;gBAEH,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,kDAAkD,CAAC,CAAC;YACxE,CAAC,CAAA,CAAC,CAAC;QACX,CAAC;KAAA;CACJ,CAAA;AAxEY,8FAAyC;oDAAzC,yCAAyC;IADrD,IAAA,mBAAU,GAAE;qCAIqC,uDAA0B;GAH/D,yCAAyC,CAwErD"}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
export declare const QUERY_GET_LIST_NOTIFICATION_BY_ACTION: string;
|
|
2
2
|
export declare const QUERY_GET_STATISTICAL_NOTIFICATION_UNREAD_BY_MODULE: (studentCode: string) => string;
|
|
3
|
-
export declare const MUTATION_UPDATE_NOTIFICATION_UNREAD: (studentCode
|
|
3
|
+
export declare const MUTATION_UPDATE_NOTIFICATION_UNREAD: ({ studentCode, action }: {
|
|
4
|
+
studentCode: string;
|
|
5
|
+
action: string;
|
|
6
|
+
}) => string;
|
|
4
7
|
export declare const MUTATION_UPDATE_READ_NOTIFICATION: string;
|
|
5
|
-
export declare const MUTATION_INSERT_NOTIFICATION = "\n mutation MyMutation($total_notification: Int!, $total_notification_important: Int!, $user_id: Int!, $hostname: String!, $app: String!, $device_id: String!, $module_code: String!, $action: String
|
|
8
|
+
export declare const MUTATION_INSERT_NOTIFICATION = "\n mutation MyMutation($total_notification: Int!, $total_notification_important: Int!, $user_id: Int!, $hostname: String!, $app: String!, $device_id: String!, $module_code: String!, $action: String = null, $student_code: String = null) {\n insert_feature_mobile_push_count_notification_unread(objects: {app: $app, created_at: \"now\", hostname: $hostname, module_code: $module_code, total_notification: $total_notification, total_notification_important: $total_notification_important, user_id: $user_id, device_id: $device_id, action: $action, student_code: $student_code}) {\n returning {\n total_notification_important\n total_notification\n module_code\n }\n }\n }\n";
|
|
6
9
|
export declare const MUTATION_UPDATE_READ_NOTIFICATION_IN_DETAIL_FORM: string;
|
|
@@ -64,9 +64,9 @@ const QUERY_GET_STATISTICAL_NOTIFICATION_UNREAD_BY_MODULE = (studentCode) => `
|
|
|
64
64
|
}
|
|
65
65
|
`;
|
|
66
66
|
exports.QUERY_GET_STATISTICAL_NOTIFICATION_UNREAD_BY_MODULE = QUERY_GET_STATISTICAL_NOTIFICATION_UNREAD_BY_MODULE;
|
|
67
|
-
const MUTATION_UPDATE_NOTIFICATION_UNREAD = (studentCode) => `
|
|
68
|
-
mutation MyMutation($hostname: String!, $app: String!, $device_id: String!, $module_code: String!, $user_id: Int!, $total_notification: Int!, $total_notification_important: Int
|
|
69
|
-
update_feature_mobile_push_count_notification_unread(where: {deleted_at: {_is_null: true}, hostname: {_eq: $hostname}, module_code: {_eq: $module_code}, app: {_eq: $app}, device_id: {_eq: $device_id}, user_id: {_eq: $user_id}, action: {_eq: $action}, ${studentCode ? `student_code: {_eq: "${studentCode}"}` : ''}}, _set: {total_notification: $total_notification, total_notification_important: $total_notification_important, updated_at: "now"}) {
|
|
67
|
+
const MUTATION_UPDATE_NOTIFICATION_UNREAD = ({ studentCode, action }) => `
|
|
68
|
+
mutation MyMutation($hostname: String!, $app: String!, $device_id: String!, $module_code: String!, $user_id: Int!, $total_notification: Int!, $total_notification_important: Int!) {
|
|
69
|
+
update_feature_mobile_push_count_notification_unread(where: {deleted_at: {_is_null: true}, hostname: {_eq: $hostname}, module_code: {_eq: $module_code}, app: {_eq: $app}, device_id: {_eq: $device_id}, user_id: {_eq: $user_id}, ${action ? `action: {_eq: "${action}"}` : ''}, ${studentCode ? `student_code: {_eq: "${studentCode}"}` : ''}}, _set: {total_notification: $total_notification, total_notification_important: $total_notification_important, updated_at: "now"}) {
|
|
70
70
|
returning {
|
|
71
71
|
id
|
|
72
72
|
total_notification
|
|
@@ -93,7 +93,7 @@ exports.MUTATION_UPDATE_READ_NOTIFICATION = (0, graphql_request_1.gql) `
|
|
|
93
93
|
}
|
|
94
94
|
`;
|
|
95
95
|
exports.MUTATION_INSERT_NOTIFICATION = `
|
|
96
|
-
mutation MyMutation($total_notification: Int!, $total_notification_important: Int!, $user_id: Int!, $hostname: String!, $app: String!, $device_id: String!, $module_code: String!, $action: String
|
|
96
|
+
mutation MyMutation($total_notification: Int!, $total_notification_important: Int!, $user_id: Int!, $hostname: String!, $app: String!, $device_id: String!, $module_code: String!, $action: String = null, $student_code: String = null) {
|
|
97
97
|
insert_feature_mobile_push_count_notification_unread(objects: {app: $app, created_at: "now", hostname: $hostname, module_code: $module_code, total_notification: $total_notification, total_notification_important: $total_notification_important, user_id: $user_id, device_id: $device_id, action: $action, student_code: $student_code}) {
|
|
98
98
|
returning {
|
|
99
99
|
total_notification_important
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query.js","sourceRoot":"","sources":["../../../src/query/notification/query.ts"],"names":[],"mappings":";;;AAAA,qDAAoC;AAEvB,QAAA,qCAAqC,GAAG,IAAA,qBAAG,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkCvD,CAAC;AAEK,MAAM,mDAAmD,GAAG,CAAC,WAAmB,EAAE,EAAE,CAAC;;;;;;;;;;;;;;;;;;UAkBlF,WAAW,CAAC,CAAC,CAAC,wBAAwB,WAAW,IAAI,CAAC,CAAC,CAAC,EAAE;;;;;;;CAOnE,CAAC;AAzBW,QAAA,mDAAmD,uDAyB9D;AAEK,MAAM,mCAAmC,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"query.js","sourceRoot":"","sources":["../../../src/query/notification/query.ts"],"names":[],"mappings":";;;AAAA,qDAAoC;AAEvB,QAAA,qCAAqC,GAAG,IAAA,qBAAG,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkCvD,CAAC;AAEK,MAAM,mDAAmD,GAAG,CAAC,WAAmB,EAAE,EAAE,CAAC;;;;;;;;;;;;;;;;;;UAkBlF,WAAW,CAAC,CAAC,CAAC,wBAAwB,WAAW,IAAI,CAAC,CAAC,CAAC,EAAE;;;;;;;CAOnE,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