Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Register
Sign in
Toggle navigation
Menu
UPSMF
HasuraNodeComponent
Commits
50d3ea0f
Unverified
Commit
50d3ea0f
authored
1 year ago
by
Shishir Suman
Committed by
GitHub
1 year ago
Browse files
Options
Download
Plain Diff
Merge branch 'main' into icici-easypay-endpoint
parents
a7b85eb9
86758167
main
UAT
icici-easypay-endpoint
1 merge request
!19
v2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
endpoints/endpoints.js
+248
-1
endpoints/endpoints.js
index.js
+10
-13
index.js
with
258 additions
and
14 deletions
+258
-14
endpoints/endpoints.js
+
248
−
1
View file @
50d3ea0f
...
...
@@ -33,6 +33,11 @@ const endpoints = [
"
course_applied
"
,
],
},
{
method
:
"
post
"
,
route
:
"
/api/rest/addInstituteCourse
"
,
requestBody
:
[
"
institute_course
"
,
"
institute_form
"
],
},
{
method
:
"
post
"
,
route
:
"
/api/rest/addInstitutePoc
"
,
...
...
@@ -163,17 +168,31 @@ const endpoints = [
route
:
"
/api/rest/filterUsers
"
,
requestBody
:
[
"
offsetNo
"
,
"
limit
"
,
"
condition
"
],
},
{
method
:
"
post
"
,
route
:
"
/api/rest/getAllAssessors
"
,
requestBody
:
[
"
offsetNo
"
,
"
limit
"
],
},
{
method
:
"
post
"
,
route
:
"
/api/rest/getAllCourses
"
,
requestBody
:
[
"
condition
"
],
},
{
method
:
"
get
"
,
route
:
"
/api/rest/getAllRegulatorDeviceId
"
,
},
{
method
:
"
post
"
,
route
:
"
/api/rest/getAll
Use
rs
"
,
route
:
"
/api/rest/getAll
Regulato
rs
"
,
requestBody
:
[
"
offsetNo
"
,
"
limit
"
],
},
{
method
:
"
post
"
,
route
:
"
/api/rest/getApplicant
"
,
requestBody
:
[
"
user_id
"
]
},
{
method
:
"
post
"
,
route
:
"
/api/rest/getApplicantDeviceId
"
,
requestBody
:
[
"
institute_id
"
],
},
{
method
:
"
post
"
,
route
:
"
/api/rest/getApplicationStatus
"
,
...
...
@@ -205,6 +224,11 @@ const endpoints = [
route
:
"
/api/rest/getDesktopAnalysis
"
,
requestBody
:
[
"
offsetNo
"
,
"
limit
"
],
},
{
method
:
"
post
"
,
route
:
"
/api/rest/getDeviceId
"
,
requestBody
:
[
"
user_id
"
],
},
{
method
:
"
post
"
,
route
:
"
/api/rest/getEvents
"
,
requestBody
:
[
"
id
"
]
},
{
method
:
"
post
"
,
route
:
"
/api/rest/getFormData
"
,
requestBody
:
[
"
form_id
"
]
},
{
...
...
@@ -228,16 +252,36 @@ const endpoints = [
route
:
"
/api/rest/getInstitute
"
,
requestBody
:
[
"
institute_id
"
],
},
{
method
:
"
post
"
,
route
:
"
/api/rest/getNOCCertificate
"
,
requestBody
:
[
"
round
"
],
},
{
method
:
"
post
"
,
route
:
"
/api/rest/getNotifications
"
,
requestBody
:
[
"
user_id
"
],
},
{
method
:
"
post
"
,
route
:
"
/api/rest/getOGAList
"
,
requestBody
:
[
"
applicant_form_id
"
,
"
submitted_on
"
],
},
{
method
:
"
post
"
,
route
:
"
/api/rest/getOGIA
"
,
requestBody
:
[
"
offsetNo
"
,
"
limit
"
,
"
formStatus
"
,
"
round
"
],
},
{
method
:
"
post
"
,
route
:
"
/api/rest/getPastInspections
"
,
requestBody
:
[
"
assessor_id
"
,
"
date
"
],
},
{
method
:
"
post
"
,
route
:
"
/api/rest/getPendingInspections
"
,
requestBody
:
[
"
assessor_id
"
,
"
date
"
],
},
{
method
:
"
post
"
,
route
:
"
/api/rest/getRegulator
"
,
requestBody
:
[
"
email
"
]
},
{
method
:
"
post
"
,
...
...
@@ -255,6 +299,11 @@ const endpoints = [
route
:
"
/api/rest/getUpcomingInspections
"
,
requestBody
:
[
"
assessor_id
"
,
"
date
"
],
},
{
method
:
"
post
"
,
route
:
"
/api/rest/getUpcomingSchedules
"
,
requestBody
:
[
"
today
"
],
},
{
method
:
"
post
"
,
route
:
"
/api/rest/getUsersForSchedulingAssessment
"
,
...
...
@@ -287,6 +336,11 @@ const endpoints = [
route
:
"
/api/rest/searchAssessments
"
,
requestBody
:
[
"
offsetNo
"
,
"
limit
"
,
"
searchString
"
],
},
{
method
:
"
post
"
,
route
:
"
/api/rest/searchCourses
"
,
requestBody
:
[
"
searchString
"
],
},
{
method
:
"
post
"
,
route
:
"
/api/rest/searchDesktop
"
,
...
...
@@ -297,6 +351,11 @@ const endpoints = [
route
:
"
/api/rest/searchForms
"
,
requestBody
:
[
"
offsetNo
"
,
"
limit
"
,
"
searchString
"
,
"
formStatus
"
],
},
{
method
:
"
post
"
,
route
:
"
/api/rest/searchNOC
"
,
requestBody
:
[
"
searchString
"
,
"
round
"
],
},
{
method
:
"
post
"
,
route
:
"
/api/rest/searchOGA
"
,
...
...
@@ -314,6 +373,21 @@ const endpoints = [
route
:
"
/api/rest/unpublishForms
"
,
requestBody
:
[
"
form_id
"
],
},
{
method
:
"
put
"
,
route
:
"
/api/rest/updateApplicantDeviceId
"
,
requestBody
:
[
"
user_id
"
,
"
device_id
"
],
},
{
method
:
"
put
"
,
route
:
"
/api/rest/updateAssessorDeviceId
"
,
requestBody
:
[
"
user_id
"
,
"
device_id
"
],
},
{
method
:
"
post
"
,
route
:
"
/api/rest/updateChildCode
"
,
requestBody
:
[
"
form_id
"
,
"
child_code
"
],
},
{
method
:
"
put
"
,
route
:
"
/api/rest/updateForm
"
,
...
...
@@ -352,6 +426,21 @@ const endpoints = [
"
form_id
"
,
],
},
{
method
:
"
post
"
,
route
:
"
/api/rest/updateParentCode
"
,
requestBody
:
[
"
institute_id
"
,
"
parent_code
"
],
},
{
method
:
"
put
"
,
route
:
"
/api/rest/updatePaymentStatus
"
,
requestBody
:
[
"
form_id
"
,
"
payment_status
"
],
},
{
method
:
"
put
"
,
route
:
"
/api/rest/updateRegulatorDeviceId
"
,
requestBody
:
[
"
user_id
"
,
"
device_id
"
],
},
{
method
:
"
post
"
,
route
:
"
/api/rest/validateAssessor
"
,
...
...
@@ -368,6 +457,164 @@ const endpoints = [
route
:
"
/api/rest/viewNotification
"
,
requestBody
:
[
"
notification_id
"
],
},
{
method
:
"
post
"
,
route
:
"
/api/rest/viewSchedule
"
,
requestBody
:
[
"
user_id
"
,
"
date
"
],
},
{
method
:
"
post
"
,
route
:
"
/api/rest/getCourseMapping
"
,
requestBody
:
[
"
courseType
"
,
"
courseLevel
"
],
},
{
method
:
"
post
"
,
route
:
"
/api/rest/filterRegulatorByRole
"
,
requestBody
:
[
"
offsetNo
"
,
"
limit
"
,
"
role
"
],
},
{
method
:
"
post
"
,
route
:
"
/api/rest/getFormSubmissionsByCourseIdApplicantIdFormStatus
"
,
requestBody
:
[
"
course_id
"
,
"
applicant_id
"
,
"
form_status
"
]
},
{
method
:
"
post
"
,
route
:
"
/api/rest/getFormSubmissionCountByStatus
"
,
requestBody
:
[
"
formStatus
"
,
"
offsetNo
"
,
"
limit
"
]
},
{
method
:
"
post
"
,
route
:
"
/api/rest/filterFormSubmissionsByRound
"
,
requestBody
:
[
"
round
"
,
"
offsetNo
"
,
"
limit
"
]
},
{
method
:
"
post
"
,
route
:
"
/api/rest/searchDashboardForms
"
,
requestBody
:
[
"
searchString
"
,
"
offsetNo
"
,
"
limit
"
]
},
{
method
:
"
post
"
,
route
:
"
/api/rest/filterSubmittedFormByRound
"
,
requestBody
:
[
"
param
"
,
"
offsetNo
"
,
"
limit
"
]
},
{
method
:
"
post
"
,
route
:
"
/api/rest/getApprovedSubmissionCount
"
,
requestBody
:
[
"
round
"
]
},
{
method
:
"
post
"
,
route
:
"
/api/rest/getRejectedSubmissionsCount
"
,
requestBody
:
[
"
round
"
]
},
{
method
:
"
post
"
,
route
:
"
/api/rest/getInProgressSubmissionCount
"
,
requestBody
:
[
"
round
"
]
},
{
method
:
"
post
"
,
route
:
"
/api/rest/getOGAFormsCountByRoundAndFormStatus
"
,
requestBody
:
[
"
round
"
,
"
formStatus
"
]
},
{
method
:
"
put
"
,
route
:
"
/api/rest/regulator/activate
"
,
requestBody
:
[
"
requlatorId
"
],
},
{
method
:
"
put
"
,
route
:
"
/api/rest/regulator/deactivate
"
,
requestBody
:
[
"
requlatorId
"
],
},
{
method
:
"
post
"
,
route
:
"
/api/rest/applicantApplicationStatus
"
,
requestBody
:
[
"
applicant_id
"
,
"
noc_path
"
,
"
round
"
],
},
{
method
:
"
post
"
,
route
:
"
/api/rest/findUserByEmail
"
,
requestBody
:
[
"
email
"
],
},
{
method
:
"
put
"
,
route
:
"
/api/rest/instituteFormsDrafts
"
,
requestBody
:
[
"
applicant_id
"
,
"
form_status
"
,
"
assessment_type
"
,
"
round
"
,
"
course_type
"
,
"
course_level
"
,
"
course_id
"
,
"
active
"
,
"
updated_by
"
,
"
created_by
"
,
"
form_data
"
,
"
form_id
"
,
"
created_on
"
,
"
updated_on
"
],
},
{
method
:
"
post
"
,
route
:
"
/api/rest/getAllInstituteDrafts
"
,
requestBody
:
[
"
searchString
"
,
"
offsetNo
"
,
"
limit
"
],
},
{
method
:
"
put
"
,
route
:
"
/api/rest/saveTransactionRecord
"
,
requestBody
:
[
"
created_by
"
,
"
invoice_date
"
,
"
invoice_id
"
,
"
invoice_time
"
,
"
payer_id
"
,
"
payer_type
"
,
"
payment_mode
"
,
"
reference_no
"
,
"
refund_date
"
,
"
refund_id
"
,
"
refund_status
"
,
"
refund_time
"
,
"
transaction_amount
"
,
"
transaction_date
"
,
"
transaction_status
"
,
"
transaction_time
"
],
},
{
method
:
"
post
"
,
route
:
"
/api/rest/getAllTransactionRecords
"
,
requestBody
:
[
"
$offset
"
,
"
limit
"
],
},
{
method
:
"
post
"
,
route
:
"
/api/rest/filterAllTransactionRecords
"
,
requestBody
:
[
"
param
"
,
"
$offset
"
,
"
limit
"
],
},
{
method
:
"
put
"
,
route
:
"
/api/rest/saveInitialFormSubmissions
"
,
requestBody
:
[
"
form_data
"
,
"
form_name
"
],
},
{
method
:
"
post
"
,
route
:
"
/api/rest/getAllInitialFormSubmissions
"
,
requestBody
:
[
"
$offset
"
,
"
limit
"
],
},
{
method
:
"
post
"
,
route
:
"
/api/rest/getInitialFormSubmissionsById
"
,
requestBody
:
[
"
id
"
],
}
];
export
default
endpoints
;
This diff is collapsed.
Click to expand it.
index.js
+
10
−
13
View file @
50d3ea0f
...
...
@@ -2,7 +2,7 @@ import express from "express";
import
{
createProxyMiddleware
}
from
"
http-proxy-middleware
"
;
import
endpoints
from
"
./endpoints/endpoints.js
"
;
import
easyPay
from
"
./utils/easypay.js
"
;
import
axios
from
"
axios
"
;
import
axios
from
"
axios
"
;
const
app
=
express
();
...
...
@@ -20,20 +20,15 @@ endpoints.forEach((endpoint) => {
target
:
targetURL
,
changeOrigin
:
true
,
onProxyReq
:
(
proxyReq
,
req
,
res
)
=>
{
const
bodyData
=
JSON
.
stringify
(
req
.
body
);
proxyReq
.
setHeader
(
"
x-hasura-admin-secret
"
,
req
.
header
(
"
x-hasura-admin-secret
"
)
);
proxyReq
.
setHeader
(
"
Content-Length
"
,
Buffer
.
byteLength
(
bodyData
));
proxyReq
.
setHeader
(
"
x-hasura-admin-secret
"
,
"
myadminsecretkey
"
);
proxyReq
.
setHeader
(
"
Hasura-Client-Name
"
,
"
hasura-console
"
);
if
(
endpoint
.
requestBody
)
{
const
bodyData
=
JSON
.
stringify
(
req
.
body
);
proxyReq
.
setHeader
(
"
Content-Length
"
,
Buffer
.
byteLength
(
bodyData
)
);
}
// Set request body if provided
if
(
endpoint
.
requestBody
&&
req
.
body
)
{
for
(
const
field
of
endpoint
.
requestBody
)
{
if
(
req
.
body
[
field
])
{
console
.
log
(
req
.
body
[
field
]);
proxyReq
.
write
(
JSON
.
stringify
({
[
field
]:
req
.
body
[
field
]
}));
}
}
proxyReq
.
write
(
JSON
.
stringify
(
req
.
body
));
}
proxyReq
.
end
();
},
...
...
@@ -110,6 +105,8 @@ app.post("/payment/v2/generatelink", async (req, res) => {
res
.
status
(
200
).
send
(
response
);
}
catch
(
err
)
{
console
.
log
(
err
);
console
.
error
(
"
Error:
"
,
err
);
console
.
error
(
"
Error message:
"
,
err
.
message
);
res
.
status
(
500
).
send
({
message
:
"
Some Error Occured
"
});
}
});
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets