add: gui sep requests

This commit is contained in:
2026-02-01 08:32:36 +03:30
parent 2898086499
commit c5aad8deca
3 changed files with 480 additions and 46 deletions

293
index.js
View File

@@ -57,6 +57,27 @@ const {
} = require("./lib/taavon-send-data"); } = require("./lib/taavon-send-data");
const { getAllCities } = require("./lib/getAllCities"); const { getAllCities } = require("./lib/getAllCities");
const { getAllProvinces } = require("./lib/getAllProvinces"); const { getAllProvinces } = require("./lib/getAllProvinces");
const { MongoClient, ObjectId } = require("mongodb");
// MongoDB for SEP pay requests (use MONGODB_URI env to override)
const MONGODB_URI =
process.env.MONGODB_URI ||
"mongodb://root:2pCCFs4wrsLDsO1pjQVA9jORT2WCjLNO5uauS6FUUaGLXCcfjw28IJmAO8RxlEJN@31.7.78.133:14365/?authSource=admin";
const SEP_DB_NAME = "rasadyar";
const SEP_COLLECTION = "sepPayRequests";
let mongoClient = null;
async function getMongoClient() {
if (!mongoClient) {
mongoClient = new MongoClient(MONGODB_URI);
await mongoClient.connect();
}
return mongoClient;
}
async function getSepPayCollection() {
const client = await getMongoClient();
return client.db(SEP_DB_NAME).collection(SEP_COLLECTION);
}
// var _soap2 = _interopRequireDefault(_soap); // var _soap2 = _interopRequireDefault(_soap);
@@ -98,7 +119,7 @@ app.post("/cumulative-dynamic-pay-request", async (req, res) => {
parseInt(orderId), parseInt(orderId),
amount, amount,
additionalData, additionalData,
"https://rasadyar.net/verify-payment" "https://rasadyar.net/verify-payment",
); );
const payRequestRes = payRequestResult.return.split(","); const payRequestRes = payRequestResult.return.split(",");
const responseCode = payRequestRes[0]; const responseCode = payRequestRes[0];
@@ -168,7 +189,7 @@ async function reversePay(orderId, saleOrderId, saleReferenceId) {
let resultReversePay = await bpReversalRequest( let resultReversePay = await bpReversalRequest(
orderId, orderId,
saleOrderId, saleOrderId,
saleReferenceId saleReferenceId,
); );
resultReversePay = resultReversePay.return; resultReversePay = resultReversePay.return;
console.log(resultReversePay); console.log(resultReversePay);
@@ -329,7 +350,7 @@ app.post("/verify-payment", async (req, res) => {
resultCode_bpVerifyRequest = await bpVerifyRequest( resultCode_bpVerifyRequest = await bpVerifyRequest(
saleOrderId, saleOrderId,
saleOrderId, saleOrderId,
saleReferenceId saleReferenceId,
); );
resultCode_bpVerifyRequest = resultCode_bpVerifyRequest.return; resultCode_bpVerifyRequest = resultCode_bpVerifyRequest.return;
console.log("bpVerifyRequest:" + resultCode_bpVerifyRequest); console.log("bpVerifyRequest:" + resultCode_bpVerifyRequest);
@@ -342,10 +363,10 @@ app.post("/verify-payment", async (req, res) => {
resultCode_bpinquiryRequest = await bpInquiryRequest( resultCode_bpinquiryRequest = await bpInquiryRequest(
saleOrderId, saleOrderId,
saleOrderId, saleOrderId,
saleReferenceId saleReferenceId,
); );
resultCode_bpinquiryRequest = parseInt( resultCode_bpinquiryRequest = parseInt(
resultCode_bpinquiryRequest.return resultCode_bpinquiryRequest.return,
); );
console.log("bpinquiryRequest" + resultCode_bpinquiryRequest); console.log("bpinquiryRequest" + resultCode_bpinquiryRequest);
@@ -366,7 +387,7 @@ app.post("/verify-payment", async (req, res) => {
resultCode_bpSettleRequest = await bpSettleRequest( resultCode_bpSettleRequest = await bpSettleRequest(
saleOrderId, saleOrderId,
saleOrderId, saleOrderId,
saleReferenceId saleReferenceId,
); );
resultCode_bpSettleRequest = parseInt(resultCode_bpSettleRequest.return); resultCode_bpSettleRequest = parseInt(resultCode_bpSettleRequest.return);
@@ -492,7 +513,7 @@ app.post("/zarinpay", async (req, res) => {
"Content-Type": "application/json", "Content-Type": "application/json",
accept: "application/json", accept: "application/json",
}, },
} },
); );
if (response.data.data.authority) { if (response.data.data.authority) {
return res.status(201).json(response.data.data); return res.status(201).json(response.data.data);
@@ -530,7 +551,7 @@ app.get("/zarinverify", async (req, res) => {
"Content-Type": "application/json", "Content-Type": "application/json",
accept: "application/json", accept: "application/json",
}, },
} },
); );
console.log("Verification response in verify: ", response.data); console.log("Verification response in verify: ", response.data);
@@ -634,7 +655,7 @@ app.post("/sadad-get-token", async (req, res) => {
"Content-Type": "application/json", "Content-Type": "application/json",
Referer: "https://rasadyar.net/", Referer: "https://rasadyar.net/",
}, },
} },
); );
res.status(201).send(response.data); res.status(201).send(response.data);
@@ -691,7 +712,7 @@ app.post("/sadad-request-payment", async (req, res) => {
"Content-Type": "application/json", "Content-Type": "application/json",
Referer: "https://rasadyar.net/", Referer: "https://rasadyar.net/",
}, },
} },
); );
const responseData = response.data; const responseData = response.data;
@@ -750,7 +771,7 @@ app.post("/asanverify", async (req, res) => {
} }
const encryptedCredintials = await encryptWS( const encryptedCredintials = await encryptWS(
`${config.username},${config.password}` `${config.username},${config.password}`,
); );
const soapClient = await soap.createClientAsync(config.WebServiceUrl); const soapClient = await soap.createClientAsync(config.WebServiceUrl);
const verifyArgs = { const verifyArgs = {
@@ -764,7 +785,7 @@ app.post("/asanverify", async (req, res) => {
return res return res
.status(500) .status(500)
.send( .send(
`خطای شماره: ${verifyResult.RequestVerificationResult} در هنگام Verify` `خطای شماره: ${verifyResult.RequestVerificationResult} در هنگام Verify`,
); );
} }
@@ -773,11 +794,11 @@ app.post("/asanverify", async (req, res) => {
return res return res
.status(500) .status(500)
.send( .send(
`خطای شماره: ${settlementResult.RequestReconciliationResult} در هنگام Settlement` `خطای شماره: ${settlementResult.RequestReconciliationResult} در هنگام Settlement`,
); );
} }
res.send( res.send(
'<div style="width:250px; margin:100px auto; direction:rtl; font:bold 14px Tahoma">تراکنش با موفقیت انجام پذیرفت.</div>' '<div style="width:250px; margin:100px auto; direction:rtl; font:bold 14px Tahoma">تراکنش با موفقیت انجام پذیرفت.</div>',
); );
}); });
}); });
@@ -824,6 +845,9 @@ app.post("/sep-pay-request", async (req, res) => {
return res.status(400).send("Invalid amount"); return res.status(400).send("Invalid amount");
} }
const resNum = generateRandomString();
const redirectUrl = `https://pay.rasadyar.net/sepverify/?Amount=${amount}&province=${provincecode}&isLink=${isLink}`;
try { try {
const response = await axios.post( const response = await axios.post(
SEP_API, SEP_API,
@@ -831,8 +855,8 @@ app.post("/sep-pay-request", async (req, res) => {
action: "token", action: "token",
TerminalId: SEP_TERMINAL_ID, TerminalId: SEP_TERMINAL_ID,
Amount: parsedAmount, Amount: parsedAmount,
ResNum: generateRandomString(), ResNum,
RedirectUrl: `https://pay.rasadyar.net/sepverify/?Amount=${amount}&province=${provincecode}&isLink=${isLink}`, RedirectUrl: redirectUrl,
CellNumber: phone, CellNumber: phone,
SettlementIBANInfo: wages, SettlementIBANInfo: wages,
// TranType: "Government", // TranType: "Government",
@@ -842,8 +866,35 @@ app.post("/sep-pay-request", async (req, res) => {
"Content-Type": "application/json", "Content-Type": "application/json",
accept: "application/json", accept: "application/json",
}, },
} },
); );
// Save to MongoDB before returning
try {
const coll = await getSepPayCollection();
const token = response.data?.Token ?? response.data?.token ?? null;
await coll.insertOne({
amount: parsedAmount,
amountRaw: amount,
phone: phone || null,
provincecode: provincecode || null,
isLink: isLink || null,
wages: wages || null,
resNum,
redirectUrl,
token,
rawResponse: response.data,
verified: false,
refNum: null,
traceNo: null,
securePan: null,
createdAt: new Date(),
updatedAt: new Date(),
});
} catch (dbErr) {
console.error("SEP pay request: failed to save to DB", dbErr);
}
return res.status(201).json(response.data); return res.status(201).json(response.data);
} catch (error) { } catch (error) {
return res return res
@@ -870,12 +921,31 @@ app.post("/sepverify", async (req, res) => {
"Content-Type": "application/json", "Content-Type": "application/json",
accept: "application/json", accept: "application/json",
}, },
} },
); );
if (response.data.ResultCode === 0) { if (response.data.ResultCode === 0) {
let redirectUrl = `https://rasadyar.net/payment?finalAmount=${Amount}&cardHolderPan=${SecurePan}&date=${new Date()}&saleReferenceId=${TraceNo}`; let redirectUrl = `https://rasadyar.net/payment?finalAmount=${Amount}&cardHolderPan=${SecurePan}&date=${new Date()}&saleReferenceId=${TraceNo}`;
let subDomain = "";
// Update DB with verify result for manual submit in GUI
try {
const coll = await getSepPayCollection();
await coll.updateOne(
{ token: Token },
{
$set: {
verified: true,
refNum: RefNum,
traceNo: TraceNo,
securePan: SecurePan,
verifyAmount: Amount,
updatedAt: new Date(),
},
},
);
} catch (dbErr) {
console.error("sepverify: failed to update DB", dbErr);
}
if (isLink) { if (isLink) {
await taavonSendDataZarinPalLink(province, { await taavonSendDataZarinPalLink(province, {
@@ -911,6 +981,149 @@ app.post("/sepverify", async (req, res) => {
} }
}); });
app.get("/sep-pay-requests/gui", async (req, res) => {
const basePath =
(req.baseUrl || "").replace(/\/sep-pay-requests\/gui$/, "") || "";
const listPath = basePath
? basePath + "/sep-pay-requests"
: "/sep-pay-requests";
const submitPathPrefix = basePath
? basePath + "/sep-pay-request/"
: "/sep-pay-request/";
const html = `<!DOCTYPE html>
<html dir="rtl" lang="fa">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>SEP Pay Requests</title>
<style>
* { box-sizing: border-box; }
body { font-family: Tahoma, Arial, sans-serif; margin: 0; padding: 16px; background: #f5f5f5; }
h1 { color: #333; margin-bottom: 16px; }
.card { background: #fff; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); padding: 16px; margin-bottom: 12px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.label { font-weight: bold; color: #555; min-width: 100px; }
.value { color: #333; }
.verified { color: #2e7d32; }
.unverified { color: #c62828; }
button { background: #1976d2; color: #fff; border: none; padding: 8px 16px; border-radius: 6px; cursor: pointer; font-size: 14px; }
button:hover { background: #1565c0; }
button:disabled { background: #9e9e9e; cursor: not-allowed; }
.msg { margin-top: 12px; padding: 8px; border-radius: 6px; }
.msg.success { background: #e8f5e9; color: #2e7d32; }
.msg.error { background: #ffebee; color: #c62828; }
#list { margin-top: 16px; }
</style>
</head>
<body>
<h1>درخواست‌های پرداخت SEP</h1>
<p><a href="${listPath}">API لیست (JSON)</a></p>
<div id="list">در حال بارگذاری...</div>
<script>
const listEl = document.getElementById('list');
const listPath = ${JSON.stringify(listPath)};
const submitPathPrefix = ${JSON.stringify(submitPathPrefix)};
const submitPath = (id) => submitPathPrefix + id + '/submit';
async function load() {
try {
const r = await fetch(listPath);
const data = await r.json();
if (!Array.isArray(data)) { listEl.innerHTML = '<p class="msg error">پاسخ نامعتبر</p>'; return; }
if (data.length === 0) { listEl.innerHTML = '<p>موردی یافت نشد.</p>'; return; }
listEl.innerHTML = data.map(item => {
const id = item._id;
const verified = item.verified === true;
const hasData = verified || (item.token && (item.traceNo || item.securePan));
return '<div class="card" data-id="' + id + '">' +
'<div class="row"><span class="label">مبلغ:</span><span class="value">' + (item.amountRaw || item.amount) + '</span></div>' +
'<div class="row"><span class="label">استان:</span><span class="value">' + (item.provincecode || '-') + '</span></div>' +
'<div class="row"><span class="label">لینک:</span><span class="value">' + (item.isLink ? 'بله' : 'خیر') + '</span></div>' +
'<div class="row"><span class="label">وضعیت:</span><span class="' + (verified ? 'verified' : 'unverified') + '">' + (verified ? 'تایید شده' : 'تایید نشده') + '</span></div>' +
(item.traceNo ? '<div class="row"><span class="label">TraceNo:</span><span class="value">' + item.traceNo + '</span></div>' : '') +
'<div class="row"><span class="label">تاریخ:</span><span class="value">' + (item.createdAt ? new Date(item.createdAt).toLocaleString('fa-IR') : '-') + '</span></div>' +
'<button onclick="submit(\'' + id + '\', this)" ' + (!hasData ? 'disabled title="نیاز به authority/refId/cardHolderPan دارد"' : '') + '>ارسال به تعاون</button>' +
'<span class="msg" id="msg-' + id + '"></span>' +
'</div>';
}).join('');
} catch (e) {
listEl.innerHTML = '<p class="msg error">خطا: ' + e.message + '</p>';
}
}
async function submit(id, btn) {
const msgEl = document.getElementById('msg-' + id);
if (msgEl) { msgEl.textContent = ''; msgEl.className = 'msg'; }
btn.disabled = true;
try {
const r = await fetch(submitPath(id), { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: '{}' });
const j = await r.json();
if (msgEl) { msgEl.textContent = j.error || (j.message || 'ارسال شد'); msgEl.className = 'msg ' + (j.error ? 'error' : 'success'); }
} catch (e) {
if (msgEl) { msgEl.textContent = e.message; msgEl.className = 'msg error'; }
}
btn.disabled = false;
}
load();
</script>
</body>
</html>`;
res.setHeader("Content-Type", "text/html; charset=utf-8");
res.send(html);
});
// List all SEP pay requests (API)
app.get("/sep-pay-requests", async (req, res) => {
try {
const coll = await getSepPayCollection();
const list = await coll
.find({})
.sort({ createdAt: -1 })
.limit(500)
.toArray();
// Ensure _id is string for GUI
const listWithIds = list.map((doc) => ({
...doc,
_id: doc._id ? doc._id.toString() : doc._id,
}));
return res.json(listWithIds);
} catch (err) {
console.error("sep-pay-requests list error", err);
return res.status(500).json({ error: err.message });
}
});
// Manual submit to Taavon (like sepverify does) - use stored or body: authority, refId, cardHolderPan
app.post("/sep-pay-request/:id/submit", async (req, res) => {
const id = req.params.id;
const { authority, refId, cardHolderPan } = req.body;
try {
const coll = await getSepPayCollection();
const doc = await coll.findOne({ _id: new ObjectId(id) });
if (!doc) {
return res.status(404).json({ error: "Record not found" });
}
const province = (doc.provincecode || "").toString().substring(0, 2);
const isLink =
doc.isLink === true || doc.isLink === "true" || doc.isLink === "1";
const data = {
authority: authority ?? doc.token,
refId: refId ?? doc.traceNo,
cardHolderPan: cardHolderPan ?? doc.securePan,
};
if (isLink) {
await taavonSendDataZarinPalLink(province, data);
} else {
await taavonSendDataZarinPal(province, data);
}
return res.json({ ok: true, message: "Submitted to Taavon" });
} catch (err) {
console.error("sep-pay-request submit error", err);
return res.status(500).json({ error: err.message });
}
});
//end sep --------------------------------------------------------------------------------------------- //end sep ---------------------------------------------------------------------------------------------
// samasat crack // samasat crack
@@ -922,12 +1135,12 @@ const getPersianDate = (daysOffset = 0) => {
const jalaaliDate = toJalaali( const jalaaliDate = toJalaali(
currentDate.getFullYear(), currentDate.getFullYear(),
currentDate.getMonth() + 1, currentDate.getMonth() + 1,
currentDate.getDate() currentDate.getDate(),
); );
const { jy, jm, jd } = jalaaliDate; const { jy, jm, jd } = jalaaliDate;
const formattedDate = `${jy}/${String(jm).padStart(2, "0")}/${String( const formattedDate = `${jy}/${String(jm).padStart(2, "0")}/${String(
jd jd,
).padStart(2, "0")}`; ).padStart(2, "0")}`;
return formattedDate; return formattedDate;
@@ -940,13 +1153,13 @@ const getPersianDateForHatching = (daysOffset = 0) => {
const jalaaliDate = toJalaali( const jalaaliDate = toJalaali(
currentDate.getFullYear(), currentDate.getFullYear(),
currentDate.getMonth() + 1, currentDate.getMonth() + 1,
currentDate.getDate() currentDate.getDate(),
); );
const { jy, jm, jd } = jalaaliDate; const { jy, jm, jd } = jalaaliDate;
const formattedDate = `${String(jd).padStart(2, "0")}/${String(jm).padStart( const formattedDate = `${String(jd).padStart(2, "0")}/${String(jm).padStart(
2, 2,
"0" "0",
)}/${jy}`; )}/${jy}`;
return formattedDate; return formattedDate;
@@ -1265,14 +1478,14 @@ app.post("/samasat-users", async (req, res) => {
...updatedUnit, ...updatedUnit,
PId: Id, PId: Id,
Province: getAllProvinces().find( Province: getAllProvinces().find(
(p) => parseInt(p.id) === parseInt(province) (p) => parseInt(p.id) === parseInt(province),
)?.name, )?.name,
City: getAllCities().find( City: getAllCities().find(
(city) => (city) =>
parseInt(city.id) === parseInt(updatedUnit?.LocationIdCity) parseInt(city.id) === parseInt(updatedUnit?.LocationIdCity),
)?.name, )?.name,
}; };
} },
); );
res.json(transformedUsers); res.json(transformedUsers);
@@ -1586,8 +1799,8 @@ app.post("/samasat-good-sum", async (req, res) => {
const jsonData = JSON.parse(data); const jsonData = JSON.parse(data);
res.json( res.json(
jsonData.Data?.filter( jsonData.Data?.filter(
(option) => option?.TrackingStatus === 2 (option) => option?.TrackingStatus === 2,
)?.reduce((acc, item) => acc + Number(item?.GoodAmount || 0), 0) )?.reduce((acc, item) => acc + Number(item?.GoodAmount || 0), 0),
); );
} catch (error) { } catch (error) {
console.error("Error parsing JSON:", error.message); console.error("Error parsing JSON:", error.message);
@@ -1660,7 +1873,7 @@ app.post("/samasat-evacuation", async (req, res) => {
// jsonData.SumLosses + // jsonData.SumLosses +
jsonData.SumIllness + jsonData.SumIllness +
jsonData.SumNaturalOccurrence + jsonData.SumNaturalOccurrence +
jsonData.SumFire jsonData.SumFire,
); );
} }
} else { } else {
@@ -1877,7 +2090,7 @@ async function performLogin() {
response.on("end", () => { response.on("end", () => {
const csrfMatch = data.match( const csrfMatch = data.match(
/<input name="__RequestVerificationToken" type="hidden" value="([^"]+)"/ /<input name="__RequestVerificationToken" type="hidden" value="([^"]+)"/,
); );
const csrfToken = csrfMatch ? csrfMatch[1] : null; const csrfToken = csrfMatch ? csrfMatch[1] : null;
@@ -1973,12 +2186,12 @@ async function makeInquiryRequest(info, type, cookie) {
birthDateString: "1404/08/12", birthDateString: "1404/08/12",
}) })
: type === "unit" : type === "unit"
? querystring.stringify({ ? querystring.stringify({
NationalCode: info, NationalCode: info,
}) })
: JSON.stringify({ : JSON.stringify({
NationaId: info, NationaId: info,
}); });
const requestOptions = { const requestOptions = {
hostname: "ba124.ir", hostname: "ba124.ir",
@@ -1986,8 +2199,8 @@ async function makeInquiryRequest(info, type, cookie) {
type === "person" type === "person"
? "/Inquiries/PersonInfo" ? "/Inquiries/PersonInfo"
: type === "unit" : type === "unit"
? "/Inquiries/CallGetLegalPersonInfoByNationalCode" ? "/Inquiries/CallGetLegalPersonInfoByNationalCode"
: "/Inquiries/AsnafGWLicenseInquiry", : "/Inquiries/AsnafGWLicenseInquiry",
method: "POST", method: "POST",
headers: { headers: {
"Content-Type": "Content-Type":
@@ -2008,8 +2221,8 @@ async function makeInquiryRequest(info, type, cookie) {
type === "person" type === "person"
? "https://ba124.ir/Inquiries/PersonInfo" ? "https://ba124.ir/Inquiries/PersonInfo"
: type === "unit" : type === "unit"
? "https://ba124.ir/Inquiries/GetLegalPersonInfoByNationalCode" ? "https://ba124.ir/Inquiries/GetLegalPersonInfoByNationalCode"
: "https://ba124.ir/Inquiries/AsnafGWLicenseInquiry", : "https://ba124.ir/Inquiries/AsnafGWLicenseInquiry",
"Sec-Ch-Ua": "Sec-Ch-Ua":
'"Chromium";v="142", "Google Chrome";v="142", "Not_A Brand";v="99"', '"Chromium";v="142", "Google Chrome";v="142", "Not_A Brand";v="99"',
"Sec-Ch-Ua-Mobile": "?0", "Sec-Ch-Ua-Mobile": "?0",

232
package-lock.json generated
View File

@@ -16,9 +16,34 @@
"express": "^4.18.2", "express": "^4.18.2",
"jalaali-js": "^1.2.7", "jalaali-js": "^1.2.7",
"moment": "^2.29.4", "moment": "^2.29.4",
"mongodb": "^6.10.0",
"soap": "^0.16.0" "soap": "^0.16.0"
} }
}, },
"node_modules/@mongodb-js/saslprep": {
"version": "1.4.5",
"resolved": "https://registry.npmjs.org/@mongodb-js/saslprep/-/saslprep-1.4.5.tgz",
"integrity": "sha512-k64Lbyb7ycCSXHSLzxVdb2xsKGPMvYZfCICXvDsI8Z65CeWQzTEKS4YmGbnqw+U9RBvLPTsB6UCmwkgsDTGWIw==",
"license": "MIT",
"dependencies": {
"sparse-bitfield": "^3.0.3"
}
},
"node_modules/@types/webidl-conversions": {
"version": "7.0.3",
"resolved": "https://registry.npmjs.org/@types/webidl-conversions/-/webidl-conversions-7.0.3.tgz",
"integrity": "sha512-CiJJvcRtIgzadHCYXw7dqEnMNRjhGZlYK05Mj9OyktqV8uVT8fD2BFOB7S1uwBE3Kj2Z+4UyPmFw/Ixgw/LAlA==",
"license": "MIT"
},
"node_modules/@types/whatwg-url": {
"version": "11.0.5",
"resolved": "https://registry.npmjs.org/@types/whatwg-url/-/whatwg-url-11.0.5.tgz",
"integrity": "sha512-coYR071JRaHa+xoEvvYqvnIHaVqaYrLPbsufM9BF63HkwI5Lgmy2QR8Q5K/lYDYo5AK82wOvSOS0UsLTpTG7uQ==",
"license": "MIT",
"dependencies": {
"@types/webidl-conversions": "*"
}
},
"node_modules/accepts": { "node_modules/accepts": {
"version": "1.3.8", "version": "1.3.8",
"resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz",
@@ -162,6 +187,15 @@
"url": "https://github.com/sponsors/ljharb" "url": "https://github.com/sponsors/ljharb"
} }
}, },
"node_modules/bson": {
"version": "6.10.4",
"resolved": "https://registry.npmjs.org/bson/-/bson-6.10.4.tgz",
"integrity": "sha512-WIsKqkSC0ABoBJuT1LEX+2HEvNmNKKgnTAyd0fL8qzK4SH2i9NXg+t08YtdZp/V9IZ33cxe3iV4yM0qg8lMQng==",
"license": "Apache-2.0",
"engines": {
"node": ">=16.20.1"
}
},
"node_modules/bytes": { "node_modules/bytes": {
"version": "3.1.2", "version": "3.1.2",
"resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz",
@@ -821,6 +855,12 @@
"node": ">= 0.6" "node": ">= 0.6"
} }
}, },
"node_modules/memory-pager": {
"version": "1.5.0",
"resolved": "https://registry.npmjs.org/memory-pager/-/memory-pager-1.5.0.tgz",
"integrity": "sha512-ZS4Bp4r/Zoeq6+NLJpP+0Zzm0pR8whtGPf1XExKLJBAczGMnSi3It14OiNCStjQjM6NU1okjQGSxgEZN8eBYKg==",
"license": "MIT"
},
"node_modules/merge-descriptors": { "node_modules/merge-descriptors": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz",
@@ -872,6 +912,62 @@
"node": "*" "node": "*"
} }
}, },
"node_modules/mongodb": {
"version": "6.21.0",
"resolved": "https://registry.npmjs.org/mongodb/-/mongodb-6.21.0.tgz",
"integrity": "sha512-URyb/VXMjJ4da46OeSXg+puO39XH9DeQpWCslifrRn9JWugy0D+DvvBvkm2WxmHe61O/H19JM66p1z7RHVkZ6A==",
"license": "Apache-2.0",
"dependencies": {
"@mongodb-js/saslprep": "^1.3.0",
"bson": "^6.10.4",
"mongodb-connection-string-url": "^3.0.2"
},
"engines": {
"node": ">=16.20.1"
},
"peerDependencies": {
"@aws-sdk/credential-providers": "^3.188.0",
"@mongodb-js/zstd": "^1.1.0 || ^2.0.0",
"gcp-metadata": "^5.2.0",
"kerberos": "^2.0.1",
"mongodb-client-encryption": ">=6.0.0 <7",
"snappy": "^7.3.2",
"socks": "^2.7.1"
},
"peerDependenciesMeta": {
"@aws-sdk/credential-providers": {
"optional": true
},
"@mongodb-js/zstd": {
"optional": true
},
"gcp-metadata": {
"optional": true
},
"kerberos": {
"optional": true
},
"mongodb-client-encryption": {
"optional": true
},
"snappy": {
"optional": true
},
"socks": {
"optional": true
}
}
},
"node_modules/mongodb-connection-string-url": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/mongodb-connection-string-url/-/mongodb-connection-string-url-3.0.2.tgz",
"integrity": "sha512-rMO7CGo/9BFwyZABcKAWL8UJwH/Kc2x0g72uhDWzG48URRax5TCIcJ7Rc3RZqffZzO/Gwff/jyKwCU9TN8gehA==",
"license": "Apache-2.0",
"dependencies": {
"@types/whatwg-url": "^11.0.2",
"whatwg-url": "^14.1.0 || ^13.0.0"
}
},
"node_modules/ms": { "node_modules/ms": {
"version": "2.0.0", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
@@ -981,9 +1077,10 @@
"integrity": "sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==" "integrity": "sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag=="
}, },
"node_modules/punycode": { "node_modules/punycode": {
"version": "2.3.0", "version": "2.3.1",
"resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz",
"integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==", "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==",
"license": "MIT",
"engines": { "engines": {
"node": ">=6" "node": ">=6"
} }
@@ -1175,6 +1272,15 @@
"node": "*" "node": "*"
} }
}, },
"node_modules/sparse-bitfield": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/sparse-bitfield/-/sparse-bitfield-3.0.3.tgz",
"integrity": "sha512-kvzhi7vqKTfkh0PZU+2D2PIllw2ymqJKujUcyPMd9Y75Nv4nPbGJZXNhxsgdQab2BmlDct1YnfQCguEvHr7VsQ==",
"license": "MIT",
"dependencies": {
"memory-pager": "^1.0.2"
}
},
"node_modules/sshpk": { "node_modules/sshpk": {
"version": "1.18.0", "version": "1.18.0",
"resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.18.0.tgz", "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.18.0.tgz",
@@ -1242,6 +1348,18 @@
"node": ">=0.8" "node": ">=0.8"
} }
}, },
"node_modules/tr46": {
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/tr46/-/tr46-5.1.1.tgz",
"integrity": "sha512-hdF5ZgjTqgAntKkklYw0R03MG2x/bSzTtkxmIRw/sTNV8YXsCJ1tfLAX23lhxhHJlEf3CRCOCGGWw3vI3GaSPw==",
"license": "MIT",
"dependencies": {
"punycode": "^2.3.1"
},
"engines": {
"node": ">=18"
}
},
"node_modules/tunnel-agent": { "node_modules/tunnel-agent": {
"version": "0.6.0", "version": "0.6.0",
"resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz",
@@ -1343,6 +1461,28 @@
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
"integrity": "sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==" "integrity": "sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ=="
}, },
"node_modules/webidl-conversions": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz",
"integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==",
"license": "BSD-2-Clause",
"engines": {
"node": ">=12"
}
},
"node_modules/whatwg-url": {
"version": "14.2.0",
"resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-14.2.0.tgz",
"integrity": "sha512-De72GdQZzNTUBBChsXueQUnPKDkg/5A5zp7pFDuQAj5UFoENpiACU0wlCvzpAGnTkj++ihpKwKyYewn/XNUbKw==",
"license": "MIT",
"dependencies": {
"tr46": "^5.1.0",
"webidl-conversions": "^7.0.0"
},
"engines": {
"node": ">=18"
}
},
"node_modules/xml-crypto": { "node_modules/xml-crypto": {
"version": "0.8.5", "version": "0.8.5",
"resolved": "https://registry.npmjs.org/xml-crypto/-/xml-crypto-0.8.5.tgz", "resolved": "https://registry.npmjs.org/xml-crypto/-/xml-crypto-0.8.5.tgz",
@@ -1374,6 +1514,27 @@
} }
}, },
"dependencies": { "dependencies": {
"@mongodb-js/saslprep": {
"version": "1.4.5",
"resolved": "https://registry.npmjs.org/@mongodb-js/saslprep/-/saslprep-1.4.5.tgz",
"integrity": "sha512-k64Lbyb7ycCSXHSLzxVdb2xsKGPMvYZfCICXvDsI8Z65CeWQzTEKS4YmGbnqw+U9RBvLPTsB6UCmwkgsDTGWIw==",
"requires": {
"sparse-bitfield": "^3.0.3"
}
},
"@types/webidl-conversions": {
"version": "7.0.3",
"resolved": "https://registry.npmjs.org/@types/webidl-conversions/-/webidl-conversions-7.0.3.tgz",
"integrity": "sha512-CiJJvcRtIgzadHCYXw7dqEnMNRjhGZlYK05Mj9OyktqV8uVT8fD2BFOB7S1uwBE3Kj2Z+4UyPmFw/Ixgw/LAlA=="
},
"@types/whatwg-url": {
"version": "11.0.5",
"resolved": "https://registry.npmjs.org/@types/whatwg-url/-/whatwg-url-11.0.5.tgz",
"integrity": "sha512-coYR071JRaHa+xoEvvYqvnIHaVqaYrLPbsufM9BF63HkwI5Lgmy2QR8Q5K/lYDYo5AK82wOvSOS0UsLTpTG7uQ==",
"requires": {
"@types/webidl-conversions": "*"
}
},
"accepts": { "accepts": {
"version": "1.3.8", "version": "1.3.8",
"resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz",
@@ -1495,6 +1656,11 @@
} }
} }
}, },
"bson": {
"version": "6.10.4",
"resolved": "https://registry.npmjs.org/bson/-/bson-6.10.4.tgz",
"integrity": "sha512-WIsKqkSC0ABoBJuT1LEX+2HEvNmNKKgnTAyd0fL8qzK4SH2i9NXg+t08YtdZp/V9IZ33cxe3iV4yM0qg8lMQng=="
},
"bytes": { "bytes": {
"version": "3.1.2", "version": "3.1.2",
"resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz",
@@ -1978,6 +2144,11 @@
"resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz",
"integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==" "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ=="
}, },
"memory-pager": {
"version": "1.5.0",
"resolved": "https://registry.npmjs.org/memory-pager/-/memory-pager-1.5.0.tgz",
"integrity": "sha512-ZS4Bp4r/Zoeq6+NLJpP+0Zzm0pR8whtGPf1XExKLJBAczGMnSi3It14OiNCStjQjM6NU1okjQGSxgEZN8eBYKg=="
},
"merge-descriptors": { "merge-descriptors": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz",
@@ -2011,6 +2182,25 @@
"resolved": "https://registry.npmjs.org/moment/-/moment-2.29.4.tgz", "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.4.tgz",
"integrity": "sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w==" "integrity": "sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w=="
}, },
"mongodb": {
"version": "6.21.0",
"resolved": "https://registry.npmjs.org/mongodb/-/mongodb-6.21.0.tgz",
"integrity": "sha512-URyb/VXMjJ4da46OeSXg+puO39XH9DeQpWCslifrRn9JWugy0D+DvvBvkm2WxmHe61O/H19JM66p1z7RHVkZ6A==",
"requires": {
"@mongodb-js/saslprep": "^1.3.0",
"bson": "^6.10.4",
"mongodb-connection-string-url": "^3.0.2"
}
},
"mongodb-connection-string-url": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/mongodb-connection-string-url/-/mongodb-connection-string-url-3.0.2.tgz",
"integrity": "sha512-rMO7CGo/9BFwyZABcKAWL8UJwH/Kc2x0g72uhDWzG48URRax5TCIcJ7Rc3RZqffZzO/Gwff/jyKwCU9TN8gehA==",
"requires": {
"@types/whatwg-url": "^11.0.2",
"whatwg-url": "^14.1.0 || ^13.0.0"
}
},
"ms": { "ms": {
"version": "2.0.0", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
@@ -2095,9 +2285,9 @@
"integrity": "sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==" "integrity": "sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag=="
}, },
"punycode": { "punycode": {
"version": "2.3.0", "version": "2.3.1",
"resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz",
"integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==" "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg=="
}, },
"qs": { "qs": {
"version": "6.5.3", "version": "6.5.3",
@@ -2257,6 +2447,14 @@
} }
} }
}, },
"sparse-bitfield": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/sparse-bitfield/-/sparse-bitfield-3.0.3.tgz",
"integrity": "sha512-kvzhi7vqKTfkh0PZU+2D2PIllw2ymqJKujUcyPMd9Y75Nv4nPbGJZXNhxsgdQab2BmlDct1YnfQCguEvHr7VsQ==",
"requires": {
"memory-pager": "^1.0.2"
}
},
"sshpk": { "sshpk": {
"version": "1.18.0", "version": "1.18.0",
"resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.18.0.tgz", "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.18.0.tgz",
@@ -2301,6 +2499,14 @@
"punycode": "^2.1.1" "punycode": "^2.1.1"
} }
}, },
"tr46": {
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/tr46/-/tr46-5.1.1.tgz",
"integrity": "sha512-hdF5ZgjTqgAntKkklYw0R03MG2x/bSzTtkxmIRw/sTNV8YXsCJ1tfLAX23lhxhHJlEf3CRCOCGGWw3vI3GaSPw==",
"requires": {
"punycode": "^2.3.1"
}
},
"tunnel-agent": { "tunnel-agent": {
"version": "0.6.0", "version": "0.6.0",
"resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz",
@@ -2378,6 +2584,20 @@
} }
} }
}, },
"webidl-conversions": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz",
"integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g=="
},
"whatwg-url": {
"version": "14.2.0",
"resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-14.2.0.tgz",
"integrity": "sha512-De72GdQZzNTUBBChsXueQUnPKDkg/5A5zp7pFDuQAj5UFoENpiACU0wlCvzpAGnTkj++ihpKwKyYewn/XNUbKw==",
"requires": {
"tr46": "^5.1.0",
"webidl-conversions": "^7.0.0"
}
},
"xml-crypto": { "xml-crypto": {
"version": "0.8.5", "version": "0.8.5",
"resolved": "https://registry.npmjs.org/xml-crypto/-/xml-crypto-0.8.5.tgz", "resolved": "https://registry.npmjs.org/xml-crypto/-/xml-crypto-0.8.5.tgz",

View File

@@ -12,6 +12,7 @@
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"axios": "^1.7.2", "axios": "^1.7.2",
"mongodb": "^6.10.0",
"body-parser": "^1.20.2", "body-parser": "^1.20.2",
"cors": "^2.8.5", "cors": "^2.8.5",
"crypto-js": "^4.2.0", "crypto-js": "^4.2.0",