mirror of
https://github.com/OpenSignLabs/OpenSign.git
synced 2026-09-11 12:17:41 +02:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
025c30b685 | ||
|
|
e742e85f0e | ||
|
|
476a99feae | ||
|
|
29464585b8 | ||
|
|
9ef1e22fda | ||
|
|
655401e04b | ||
|
|
4d7348abc2 | ||
|
|
ec68479e98 | ||
|
|
b387b6b402 | ||
|
|
e13baeb2fc | ||
|
|
52eb8e4a68 | ||
|
|
71189783a8 | ||
|
|
aec9396524 | ||
|
|
d74390b974 | ||
|
|
998fe013c8 | ||
|
|
06d4c9aeaf | ||
|
|
bc77a9b0a1 | ||
|
|
07c0390401 | ||
|
|
c50d753d74 | ||
|
|
65eef5739d | ||
|
|
01eed3664b | ||
|
|
685e09d406 | ||
|
|
7bacca1f78 | ||
|
|
3764ab5c30 | ||
|
|
2f7a1d67b6 | ||
|
|
b218e96107 | ||
|
|
64a0be8776 | ||
|
|
3ede441f54 | ||
|
|
51edc339cd | ||
|
|
741efff1fa | ||
|
|
38b7311e66 | ||
|
|
e0ccf049a6 | ||
|
|
498bd18630 | ||
|
|
b530ef882a | ||
|
|
850d14064a | ||
|
|
273ada837b |
Generated
+8
-8
@@ -55,7 +55,7 @@
|
|||||||
"web-vitals": "^4.0.1"
|
"web-vitals": "^4.0.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/runtime-corejs2": "^7.24.6",
|
"@babel/runtime-corejs2": "^7.24.7",
|
||||||
"autoprefixer": "^10.4.19",
|
"autoprefixer": "^10.4.19",
|
||||||
"commitizen": "^4.3.0",
|
"commitizen": "^4.3.0",
|
||||||
"eslint": "^8.57.0",
|
"eslint": "^8.57.0",
|
||||||
@@ -65,7 +65,7 @@
|
|||||||
"postcss": "^8.4.38",
|
"postcss": "^8.4.38",
|
||||||
"prettier": "^2.8.8",
|
"prettier": "^2.8.8",
|
||||||
"pretty-quick": "^3.3.1",
|
"pretty-quick": "^3.3.1",
|
||||||
"tailwindcss": "^3.4.3"
|
"tailwindcss": "^3.4.4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@alloc/quick-lru": {
|
"node_modules/@alloc/quick-lru": {
|
||||||
@@ -2000,9 +2000,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@babel/runtime-corejs2": {
|
"node_modules/@babel/runtime-corejs2": {
|
||||||
"version": "7.24.6",
|
"version": "7.24.7",
|
||||||
"resolved": "https://registry.npmjs.org/@babel/runtime-corejs2/-/runtime-corejs2-7.24.6.tgz",
|
"resolved": "https://registry.npmjs.org/@babel/runtime-corejs2/-/runtime-corejs2-7.24.7.tgz",
|
||||||
"integrity": "sha512-5UK2PnfpmiCftYGBeJ+SpFIMNaoMPU/eQt1P5ISx0TB7nGGzEMLT4/3PapNZEfGZh+nGxGOGj2t59prGFBhunQ==",
|
"integrity": "sha512-+Lf6xofiPZLtFwNkpjGHPgJck4b22Yo8h9+WHf3bEbS4ikOyOMNtJk6HSTolEQ2irH1XSoeguaCkrkcgyThrMA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"core-js": "^2.6.12",
|
"core-js": "^2.6.12",
|
||||||
@@ -22700,9 +22700,9 @@
|
|||||||
"integrity": "sha512-Cat63mxsVJlzYvN51JmVXIgNoUokrIaT2zLclCXjRd8boZ0004U4KCs/sToJ75C6sdlByWxpYnb5Boif1VSFew=="
|
"integrity": "sha512-Cat63mxsVJlzYvN51JmVXIgNoUokrIaT2zLclCXjRd8boZ0004U4KCs/sToJ75C6sdlByWxpYnb5Boif1VSFew=="
|
||||||
},
|
},
|
||||||
"node_modules/tailwindcss": {
|
"node_modules/tailwindcss": {
|
||||||
"version": "3.4.3",
|
"version": "3.4.4",
|
||||||
"resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.4.3.tgz",
|
"resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.4.4.tgz",
|
||||||
"integrity": "sha512-U7sxQk/n397Bmx4JHbJx/iSOOv5G+II3f1kpLpY2QeUv5DcPdcTsYLlusZfq1NthHS1c1cZoyFmmkex1rzke0A==",
|
"integrity": "sha512-ZoyXOdJjISB7/BcLTR6SEsLgKtDStYyYZVLsUtWChO4Ps20CBad7lfJKVDiejocV4ME1hLmyY0WJE3hSDcmQ2A==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@alloc/quick-lru": "^5.2.0",
|
"@alloc/quick-lru": "^5.2.0",
|
||||||
"arg": "^5.0.2",
|
"arg": "^5.0.2",
|
||||||
|
|||||||
@@ -85,7 +85,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/runtime-corejs2": "^7.24.6",
|
"@babel/runtime-corejs2": "^7.24.7",
|
||||||
"autoprefixer": "^10.4.19",
|
"autoprefixer": "^10.4.19",
|
||||||
"commitizen": "^4.3.0",
|
"commitizen": "^4.3.0",
|
||||||
"eslint": "^8.57.0",
|
"eslint": "^8.57.0",
|
||||||
@@ -95,7 +95,7 @@
|
|||||||
"postcss": "^8.4.38",
|
"postcss": "^8.4.38",
|
||||||
"prettier": "^2.8.8",
|
"prettier": "^2.8.8",
|
||||||
"pretty-quick": "^3.3.1",
|
"pretty-quick": "^3.3.1",
|
||||||
"tailwindcss": "^3.4.3"
|
"tailwindcss": "^3.4.4"
|
||||||
},
|
},
|
||||||
"overrides": {
|
"overrides": {
|
||||||
"nth-check": "$nth-check"
|
"nth-check": "$nth-check"
|
||||||
|
|||||||
@@ -170,7 +170,11 @@ function PdfRequestFiles() {
|
|||||||
const handleResend = async (e) => {
|
const handleResend = async (e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
setOtpLoader(true);
|
setOtpLoader(true);
|
||||||
await handleSendOTP(Parse.User.current().getEmail());
|
const localuser = localStorage.getItem(
|
||||||
|
`Parse/${appInfo.appId}/currentUser`
|
||||||
|
);
|
||||||
|
const currentUser = JSON.parse(JSON.stringify(localuser));
|
||||||
|
await handleSendOTP(currentUser?.email);
|
||||||
setOtpLoader(false);
|
setOtpLoader(false);
|
||||||
alert("OTP sent on you email");
|
alert("OTP sent on you email");
|
||||||
};
|
};
|
||||||
@@ -178,10 +182,14 @@ function PdfRequestFiles() {
|
|||||||
const handleVerifyEmail = async (e) => {
|
const handleVerifyEmail = async (e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
setOtpLoader(true);
|
setOtpLoader(true);
|
||||||
|
const localuser = localStorage.getItem(
|
||||||
|
`Parse/${appInfo.appId}/currentUser`
|
||||||
|
);
|
||||||
|
const currentUser = JSON.parse(JSON.stringify(localuser));
|
||||||
try {
|
try {
|
||||||
const resEmail = await Parse.Cloud.run("verifyemail", {
|
const resEmail = await Parse.Cloud.run("verifyemail", {
|
||||||
otp: otp,
|
otp: otp,
|
||||||
email: Parse.User.current().getEmail()
|
email: currentUser?.email
|
||||||
});
|
});
|
||||||
if (resEmail?.message === "Email is verified.") {
|
if (resEmail?.message === "Email is verified.") {
|
||||||
setIsEmailVerified(true);
|
setIsEmailVerified(true);
|
||||||
@@ -202,7 +210,11 @@ function PdfRequestFiles() {
|
|||||||
//`handleVerifyBtn` function is used to send otp on user mail
|
//`handleVerifyBtn` function is used to send otp on user mail
|
||||||
const handleVerifyBtn = async () => {
|
const handleVerifyBtn = async () => {
|
||||||
setIsVerifyModal(true);
|
setIsVerifyModal(true);
|
||||||
await handleSendOTP(Parse.User.current().getEmail());
|
const localuser = localStorage.getItem(
|
||||||
|
`Parse/${appInfo.appId}/currentUser`
|
||||||
|
);
|
||||||
|
const currentUser = JSON.parse(JSON.stringify(localuser));
|
||||||
|
await handleSendOTP(currentUser?.email);
|
||||||
};
|
};
|
||||||
async function checkIsSubscribed(extUserId, contactId) {
|
async function checkIsSubscribed(extUserId, contactId) {
|
||||||
const isGuestSign = location.pathname.includes("/load/") || false;
|
const isGuestSign = location.pathname.includes("/load/") || false;
|
||||||
@@ -497,7 +509,6 @@ function PdfRequestFiles() {
|
|||||||
const objectId = res[0].objectId;
|
const objectId = res[0].objectId;
|
||||||
setSignerUserId(objectId);
|
setSignerUserId(objectId);
|
||||||
const tourData = res[0].TourStatus && res[0].TourStatus;
|
const tourData = res[0].TourStatus && res[0].TourStatus;
|
||||||
|
|
||||||
if (tourData && tourData.length > 0) {
|
if (tourData && tourData.length > 0) {
|
||||||
setTourStatus(tourData);
|
setTourStatus(tourData);
|
||||||
setRequestSignTour(tourData[0]?.requestSign || false);
|
setRequestSignTour(tourData[0]?.requestSign || false);
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ const ReportTable = (props) => {
|
|||||||
const [isLoader, setIsLoader] = useState({});
|
const [isLoader, setIsLoader] = useState({});
|
||||||
// const [selectedPublicRole, setSelectedPublicRole] = useState("");
|
// const [selectedPublicRole, setSelectedPublicRole] = useState("");
|
||||||
// const [isCelebration, setIsCelebration] = useState(false);
|
// const [isCelebration, setIsCelebration] = useState(false);
|
||||||
const [currentLists, setCurrentLists] = useState([]);
|
// const [currentLists, setCurrentLists] = useState([]);
|
||||||
// const [isPublic, setIsPublic] = useState({});
|
// const [isPublic, setIsPublic] = useState({});
|
||||||
// const [isPublicProfile, setIsPublicProfile] = useState({});
|
// const [isPublicProfile, setIsPublicProfile] = useState({});
|
||||||
// const [publicUserName, setIsPublicUserName] = useState("");
|
// const [publicUserName, setIsPublicUserName] = useState("");
|
||||||
@@ -250,19 +250,20 @@ const ReportTable = (props) => {
|
|||||||
// Get current list
|
// Get current list
|
||||||
const indexOfLastDoc = currentPage * props.docPerPage;
|
const indexOfLastDoc = currentPage * props.docPerPage;
|
||||||
const indexOfFirstDoc = indexOfLastDoc - props.docPerPage;
|
const indexOfFirstDoc = indexOfLastDoc - props.docPerPage;
|
||||||
useEffect(() => {
|
const currentList = props.List?.slice(indexOfFirstDoc, indexOfLastDoc);
|
||||||
// `currentLists` is total record render on current page
|
// useEffect(() => {
|
||||||
const currentList = props.List?.slice(indexOfFirstDoc, indexOfLastDoc);
|
// // `currentLists` is total record render on current page
|
||||||
//check public template and save in a object to show public and private template
|
// const currentList = props.List?.slice(indexOfFirstDoc, indexOfLastDoc);
|
||||||
// setIsPublic(
|
// //check public template and save in a object to show public and private template
|
||||||
// currentList.reduce((acc, item) => {
|
// // setIsPublic(
|
||||||
// acc[item.objectId] = item?.IsPublic || false;
|
// // currentList.reduce((acc, item) => {
|
||||||
// return acc;
|
// // acc[item.objectId] = item?.IsPublic || false;
|
||||||
// }, {})
|
// // return acc;
|
||||||
// );
|
// // }, {})
|
||||||
setCurrentLists(currentList);
|
// // );
|
||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
// setCurrentLists(currentList);
|
||||||
}, [indexOfLastDoc, indexOfFirstDoc]);
|
// // eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
|
// }, [indexOfLastDoc, indexOfFirstDoc]);
|
||||||
|
|
||||||
// Change page
|
// Change page
|
||||||
const paginateFront = () => setCurrentPage(currentPage + 1);
|
const paginateFront = () => setCurrentPage(currentPage + 1);
|
||||||
@@ -928,7 +929,7 @@ const ReportTable = (props) => {
|
|||||||
<tbody className="text-[12px]">
|
<tbody className="text-[12px]">
|
||||||
{props.List?.length > 0 && (
|
{props.List?.length > 0 && (
|
||||||
<>
|
<>
|
||||||
{currentLists.map((item, index) =>
|
{currentList.map((item, index) =>
|
||||||
props.ReportName === "Contactbook" ? (
|
props.ReportName === "Contactbook" ? (
|
||||||
<tr className="border-y-[1px]" key={index}>
|
<tr className="border-y-[1px]" key={index}>
|
||||||
{props.heading.includes("Sr.No") && (
|
{props.heading.includes("Sr.No") && (
|
||||||
|
|||||||
@@ -247,3 +247,6 @@ export function sanitizeFileName(fileName) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const useLocal = process.env.USE_LOCAL ? process.env.USE_LOCAL.toLowerCase() : 'false';
|
export const useLocal = process.env.USE_LOCAL ? process.env.USE_LOCAL.toLowerCase() : 'false';
|
||||||
|
export const smtpsecure = process.env.SMTP_PORT && process.env.SMTP_PORT !== '465' ? false : true;
|
||||||
|
export const smtpenable =
|
||||||
|
process.env.SMTP_ENABLE && process.env.SMTP_ENABLE.toLowerCase() === 'true' ? true : false;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { updateMailCount } from '../../Utils.js';
|
import { smtpenable, updateMailCount } from '../../Utils.js';
|
||||||
async function getDocument(docId) {
|
async function getDocument(docId) {
|
||||||
try {
|
try {
|
||||||
const query = new Parse.Query('contracts_Document');
|
const query = new Parse.Query('contracts_Document');
|
||||||
@@ -25,9 +25,7 @@ async function sendMailOTPv1(request) {
|
|||||||
|
|
||||||
if (email) {
|
if (email) {
|
||||||
const recipient = request.params.email;
|
const recipient = request.params.email;
|
||||||
const mailsender = process.env.SMTP_ENABLE
|
const mailsender = smtpenable ? process.env.SMTP_USER_EMAIL : process.env.MAILGUN_SENDER;
|
||||||
? process.env.SMTP_USER_EMAIL
|
|
||||||
: process.env.MAILGUN_SENDER;
|
|
||||||
try {
|
try {
|
||||||
await Parse.Cloud.sendEmail({
|
await Parse.Cloud.sendEmail({
|
||||||
from: 'Opensign™' + ' <' + mailsender + '>',
|
from: 'Opensign™' + ' <' + mailsender + '>',
|
||||||
|
|||||||
@@ -81,11 +81,16 @@ export default async function linkContactToDoc(req) {
|
|||||||
const updateDoc = new Parse.Object('contracts_Document');
|
const updateDoc = new Parse.Object('contracts_Document');
|
||||||
updateDoc.id = docId;
|
updateDoc.id = docId;
|
||||||
const signers = _docRes?.Signers || [];
|
const signers = _docRes?.Signers || [];
|
||||||
signers.push({
|
const signerobj = {
|
||||||
__type: 'Pointer',
|
__type: 'Pointer',
|
||||||
className: 'contracts_Contactbook',
|
className: 'contracts_Contactbook',
|
||||||
objectId: existContact.id,
|
objectId: existContact.id,
|
||||||
});
|
};
|
||||||
|
// The splice method is used to add a signer at the desired index
|
||||||
|
// index is the variable where the signer needs to be added
|
||||||
|
// 0 indicates that no elements should be deleted
|
||||||
|
// signerobj is the reference to the signer object
|
||||||
|
signers.splice(index, 0, signerobj);
|
||||||
updateDoc.set('Signers', signers);
|
updateDoc.set('Signers', signers);
|
||||||
|
|
||||||
Placeholders[index] = {
|
Placeholders[index] = {
|
||||||
@@ -128,11 +133,16 @@ export default async function linkContactToDoc(req) {
|
|||||||
const updateDoc = new Parse.Object('contracts_Document');
|
const updateDoc = new Parse.Object('contracts_Document');
|
||||||
updateDoc.id = docId;
|
updateDoc.id = docId;
|
||||||
const signers = _docRes?.Signers || [];
|
const signers = _docRes?.Signers || [];
|
||||||
signers.push({
|
const signerobj = {
|
||||||
__type: 'Pointer',
|
__type: 'Pointer',
|
||||||
className: 'contracts_Contactbook',
|
className: 'contracts_Contactbook',
|
||||||
objectId: contactRes.id,
|
objectId: contactRes.id,
|
||||||
});
|
};
|
||||||
|
// The splice method is used to add a signer at the desired index
|
||||||
|
// index is the variable where the signer needs to be added
|
||||||
|
// 0 indicates that no elements should be deleted
|
||||||
|
// signerobj is the reference to the signer object
|
||||||
|
signers.splice(index, 0, signerobj);
|
||||||
updateDoc.set('Signers', signers);
|
updateDoc.set('Signers', signers);
|
||||||
|
|
||||||
Placeholders[index] = {
|
Placeholders[index] = {
|
||||||
@@ -175,11 +185,16 @@ export default async function linkContactToDoc(req) {
|
|||||||
const updateDoc = new Parse.Object('contracts_Document');
|
const updateDoc = new Parse.Object('contracts_Document');
|
||||||
updateDoc.id = docId;
|
updateDoc.id = docId;
|
||||||
const signers = _docRes?.Signers || [];
|
const signers = _docRes?.Signers || [];
|
||||||
signers.push({
|
const signerobj = {
|
||||||
__type: 'Pointer',
|
__type: 'Pointer',
|
||||||
className: 'contracts_Contactbook',
|
className: 'contracts_Contactbook',
|
||||||
objectId: contactRes.id,
|
objectId: contactRes.id,
|
||||||
});
|
};
|
||||||
|
// The splice method is used to add a signer at the desired index
|
||||||
|
// index is the variable where the signer needs to be added
|
||||||
|
// 0 indicates that no elements should be deleted
|
||||||
|
// signerobj is the reference to the signer object
|
||||||
|
signers.splice(index, 0, signerobj);
|
||||||
updateDoc.set('Signers', signers);
|
updateDoc.set('Signers', signers);
|
||||||
|
|
||||||
Placeholders[index] = {
|
Placeholders[index] = {
|
||||||
@@ -227,13 +242,17 @@ export default async function linkContactToDoc(req) {
|
|||||||
const updateDoc = new Parse.Object('contracts_Document');
|
const updateDoc = new Parse.Object('contracts_Document');
|
||||||
updateDoc.id = docId;
|
updateDoc.id = docId;
|
||||||
const signers = _docRes?.Signers || [];
|
const signers = _docRes?.Signers || [];
|
||||||
signers.push({
|
const signerobj = {
|
||||||
__type: 'Pointer',
|
__type: 'Pointer',
|
||||||
className: 'contracts_Contactbook',
|
className: 'contracts_Contactbook',
|
||||||
objectId: contactRes.id,
|
objectId: contactRes.id,
|
||||||
});
|
};
|
||||||
|
// The splice method is used to add a signer at the desired index
|
||||||
|
// index is the variable where the signer needs to be added
|
||||||
|
// 0 indicates that no elements should be deleted
|
||||||
|
// signerobj is the reference to the signer object
|
||||||
|
signers.splice(index, 0, signerobj);
|
||||||
updateDoc.set('Signers', signers);
|
updateDoc.set('Signers', signers);
|
||||||
|
|
||||||
Placeholders[index] = {
|
Placeholders[index] = {
|
||||||
...Placeholders[index],
|
...Placeholders[index],
|
||||||
signerObjId: contactRes.id,
|
signerObjId: contactRes.id,
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import fs from 'node:fs';
|
|||||||
import https from 'https';
|
import https from 'https';
|
||||||
import formData from 'form-data';
|
import formData from 'form-data';
|
||||||
import Mailgun from 'mailgun.js';
|
import Mailgun from 'mailgun.js';
|
||||||
import { updateMailCount } from '../../Utils.js';
|
import { smtpenable, smtpsecure, updateMailCount } from '../../Utils.js';
|
||||||
import sendMailGmailProvider from './sendMailGmailProvider.js';
|
import sendMailGmailProvider from './sendMailGmailProvider.js';
|
||||||
import { createTransport } from 'nodemailer';
|
import { createTransport } from 'nodemailer';
|
||||||
async function sendMailProvider(req) {
|
async function sendMailProvider(req) {
|
||||||
@@ -10,11 +10,11 @@ async function sendMailProvider(req) {
|
|||||||
let transporterSMTP;
|
let transporterSMTP;
|
||||||
let mailgunClient;
|
let mailgunClient;
|
||||||
let mailgunDomain;
|
let mailgunDomain;
|
||||||
if (process.env.SMTP_ENABLE) {
|
if (smtpenable) {
|
||||||
transporterSMTP = createTransport({
|
transporterSMTP = createTransport({
|
||||||
host: process.env.SMTP_HOST,
|
host: process.env.SMTP_HOST,
|
||||||
port: process.env.SMTP_PORT || 465,
|
port: process.env.SMTP_PORT || 465,
|
||||||
secure: process.env.SMTP_SECURE || true,
|
secure: smtpsecure,
|
||||||
auth: {
|
auth: {
|
||||||
user: process.env.SMTP_USER_EMAIL,
|
user: process.env.SMTP_USER_EMAIL,
|
||||||
pass: process.env.SMTP_PASS,
|
pass: process.env.SMTP_PASS,
|
||||||
@@ -54,8 +54,8 @@ async function sendMailProvider(req) {
|
|||||||
const pdfName = req.params.pdfName && `${req.params.pdfName}.pdf`;
|
const pdfName = req.params.pdfName && `${req.params.pdfName}.pdf`;
|
||||||
const file = {
|
const file = {
|
||||||
filename: pdfName || 'exported.pdf',
|
filename: pdfName || 'exported.pdf',
|
||||||
content: process.env.SMTP_ENABLE ? PdfBuffer : undefined, //fs.readFileSync('./exports/exported_file_1223.pdf'),
|
content: smtpenable ? PdfBuffer : undefined, //fs.readFileSync('./exports/exported_file_1223.pdf'),
|
||||||
data: process.env.SMTP_ENABLE ? undefined : PdfBuffer,
|
data: smtpenable ? undefined : PdfBuffer,
|
||||||
};
|
};
|
||||||
|
|
||||||
let attachment;
|
let attachment;
|
||||||
@@ -64,8 +64,8 @@ async function sendMailProvider(req) {
|
|||||||
const certificateBuffer = fs.readFileSync('./exports/certificate.pdf');
|
const certificateBuffer = fs.readFileSync('./exports/certificate.pdf');
|
||||||
const certificate = {
|
const certificate = {
|
||||||
filename: 'certificate.pdf',
|
filename: 'certificate.pdf',
|
||||||
content: process.env.SMTP_ENABLE ? certificateBuffer : undefined, //fs.readFileSync('./exports/exported_file_1223.pdf'),
|
content: smtpenable ? certificateBuffer : undefined, //fs.readFileSync('./exports/exported_file_1223.pdf'),
|
||||||
data: process.env.SMTP_ENABLE ? undefined : certificateBuffer,
|
data: smtpenable ? undefined : certificateBuffer,
|
||||||
};
|
};
|
||||||
attachment = [file, certificate];
|
attachment = [file, certificate];
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
@@ -73,9 +73,7 @@ async function sendMailProvider(req) {
|
|||||||
console.log('Err in read certificate sendmailv3', err);
|
console.log('Err in read certificate sendmailv3', err);
|
||||||
}
|
}
|
||||||
const from = req.params.from || '';
|
const from = req.params.from || '';
|
||||||
const mailsender = process.env.SMTP_ENABLE
|
const mailsender = smtpenable ? process.env.SMTP_USER_EMAIL : process.env.MAILGUN_SENDER;
|
||||||
? process.env.SMTP_USER_EMAIL
|
|
||||||
: process.env.MAILGUN_SENDER;
|
|
||||||
|
|
||||||
const messageParams = {
|
const messageParams = {
|
||||||
from: from + ' <' + mailsender + '>',
|
from: from + ' <' + mailsender + '>',
|
||||||
@@ -83,8 +81,8 @@ async function sendMailProvider(req) {
|
|||||||
subject: req.params.subject,
|
subject: req.params.subject,
|
||||||
text: req.params.text || 'mail',
|
text: req.params.text || 'mail',
|
||||||
html: req.params.html || '',
|
html: req.params.html || '',
|
||||||
attachments: process.env.SMTP_ENABLE ? attachment : undefined,
|
attachments: smtpenable ? attachment : undefined,
|
||||||
attachment: process.env.SMTP_ENABLE ? undefined : attachment,
|
attachment: smtpenable ? undefined : attachment,
|
||||||
};
|
};
|
||||||
if (transporterSMTP) {
|
if (transporterSMTP) {
|
||||||
const res = await transporterSMTP.sendMail(messageParams);
|
const res = await transporterSMTP.sendMail(messageParams);
|
||||||
@@ -120,9 +118,7 @@ async function sendMailProvider(req) {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const from = req.params.from || '';
|
const from = req.params.from || '';
|
||||||
const mailsender = process.env.SMTP_ENABLE
|
const mailsender = smtpenable ? process.env.SMTP_USER_EMAIL : process.env.MAILGUN_SENDER;
|
||||||
? process.env.SMTP_USER_EMAIL
|
|
||||||
: process.env.MAILGUN_SENDER;
|
|
||||||
|
|
||||||
const messageParams = {
|
const messageParams = {
|
||||||
from: from + ' <' + mailsender + '>',
|
from: from + ' <' + mailsender + '>',
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ import { exec } from 'child_process';
|
|||||||
import { createTransport } from 'nodemailer';
|
import { createTransport } from 'nodemailer';
|
||||||
import { app as v1 } from './cloud/customRoute/v1/apiV1.js';
|
import { app as v1 } from './cloud/customRoute/v1/apiV1.js';
|
||||||
import { PostHog } from 'posthog-node';
|
import { PostHog } from 'posthog-node';
|
||||||
import { useLocal } from './Utils.js';
|
import { smtpenable, smtpsecure, useLocal } from './Utils.js';
|
||||||
import { SSOAuth } from './auth/authadapter.js';
|
import { SSOAuth } from './auth/authadapter.js';
|
||||||
let fsAdapter;
|
let fsAdapter;
|
||||||
if (useLocal !== 'true') {
|
if (useLocal !== 'true') {
|
||||||
@@ -54,12 +54,12 @@ let transporterMail;
|
|||||||
let mailgunClient;
|
let mailgunClient;
|
||||||
let mailgunDomain;
|
let mailgunDomain;
|
||||||
let isMailAdapter = false;
|
let isMailAdapter = false;
|
||||||
if (process.env.SMTP_ENABLE) {
|
if (smtpenable) {
|
||||||
try {
|
try {
|
||||||
transporterMail = createTransport({
|
transporterMail = createTransport({
|
||||||
host: process.env.SMTP_HOST,
|
host: process.env.SMTP_HOST,
|
||||||
port: process.env.SMTP_PORT || 465,
|
port: process.env.SMTP_PORT || 465,
|
||||||
secure: process.env.SMTP_SECURE || true,
|
secure: smtpsecure,
|
||||||
auth: {
|
auth: {
|
||||||
user: process.env.SMTP_USER_EMAIL,
|
user: process.env.SMTP_USER_EMAIL,
|
||||||
pass: process.env.SMTP_PASS,
|
pass: process.env.SMTP_PASS,
|
||||||
@@ -85,9 +85,7 @@ if (process.env.SMTP_ENABLE) {
|
|||||||
console.log('Please provide valid Mailgun credentials');
|
console.log('Please provide valid Mailgun credentials');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const mailsender = process.env.SMTP_ENABLE
|
const mailsender = smtpenable ? process.env.SMTP_USER_EMAIL : process.env.MAILGUN_SENDER;
|
||||||
? process.env.SMTP_USER_EMAIL
|
|
||||||
: process.env.MAILGUN_SENDER;
|
|
||||||
export const config = {
|
export const config = {
|
||||||
databaseURI:
|
databaseURI:
|
||||||
process.env.DATABASE_URI || process.env.MONGODB_URI || 'mongodb://localhost:27017/dev',
|
process.env.DATABASE_URI || process.env.MONGODB_URI || 'mongodb://localhost:27017/dev',
|
||||||
|
|||||||
Generated
+18
-18
@@ -38,11 +38,11 @@
|
|||||||
"posthog-node": "^4.0.1"
|
"posthog-node": "^4.0.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/eslint-parser": "^7.24.6",
|
"@babel/eslint-parser": "^7.24.7",
|
||||||
"eslint": "^9.3.0",
|
"eslint": "^9.3.0",
|
||||||
"jasmine": "^5.1.0",
|
"jasmine": "^5.1.0",
|
||||||
"mongodb-runner": "^5.6.2",
|
"mongodb-runner": "^5.6.2",
|
||||||
"nodemon": "^3.1.2",
|
"nodemon": "^3.1.3",
|
||||||
"nyc": "15.1.0",
|
"nyc": "15.1.0",
|
||||||
"prettier": "^3.3.0",
|
"prettier": "^3.3.0",
|
||||||
"uglify-js": "^3.17.4"
|
"uglify-js": "^3.17.4"
|
||||||
@@ -1303,9 +1303,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@babel/eslint-parser": {
|
"node_modules/@babel/eslint-parser": {
|
||||||
"version": "7.24.6",
|
"version": "7.24.7",
|
||||||
"resolved": "https://registry.npmjs.org/@babel/eslint-parser/-/eslint-parser-7.24.6.tgz",
|
"resolved": "https://registry.npmjs.org/@babel/eslint-parser/-/eslint-parser-7.24.7.tgz",
|
||||||
"integrity": "sha512-Q1BfQX42zXHx732PLW0w4+Y3wJjoZKEMaatFUEAmQ7Z+jCXxinzeqX9bvv2Q8xNPes/H6F0I23oGkcgjaItmLw==",
|
"integrity": "sha512-SO5E3bVxDuxyNxM5agFv480YA2HO6ohZbGxbazZdIk3KQOPOGVNw6q78I9/lbviIf95eq6tPozeYnJLbjnC8IA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@nicolo-ribaudo/eslint-scope-5-internals": "5.1.1-v1",
|
"@nicolo-ribaudo/eslint-scope-5-internals": "5.1.1-v1",
|
||||||
@@ -1906,9 +1906,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@grpc/grpc-js": {
|
"node_modules/@grpc/grpc-js": {
|
||||||
"version": "1.10.8",
|
"version": "1.10.9",
|
||||||
"resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.10.8.tgz",
|
"resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.10.9.tgz",
|
||||||
"integrity": "sha512-vYVqYzHicDqyKB+NQhAc54I1QWCBLCrYG6unqOIcBTHx+7x8C9lcoLj3KVJXs2VB4lUbpWY+Kk9NipcbXYWmvg==",
|
"integrity": "sha512-5tcgUctCG0qoNyfChZifz2tJqbRbXVO9J7X6duFcOjY3HUNCxg5D0ZCK7EP9vIcZ0zRpLU9bWkyCqVCLZ46IbQ==",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@grpc/proto-loader": "^0.7.13",
|
"@grpc/proto-loader": "^0.7.13",
|
||||||
@@ -4300,11 +4300,11 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/braces": {
|
"node_modules/braces": {
|
||||||
"version": "3.0.2",
|
"version": "3.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz",
|
||||||
"integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==",
|
"integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"fill-range": "^7.0.1"
|
"fill-range": "^7.1.1"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=8"
|
"node": ">=8"
|
||||||
@@ -5761,9 +5761,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/fill-range": {
|
"node_modules/fill-range": {
|
||||||
"version": "7.0.1",
|
"version": "7.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz",
|
||||||
"integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==",
|
"integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"to-regex-range": "^5.0.1"
|
"to-regex-range": "^5.0.1"
|
||||||
},
|
},
|
||||||
@@ -8365,9 +8365,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/nodemon": {
|
"node_modules/nodemon": {
|
||||||
"version": "3.1.2",
|
"version": "3.1.3",
|
||||||
"resolved": "https://registry.npmjs.org/nodemon/-/nodemon-3.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/nodemon/-/nodemon-3.1.3.tgz",
|
||||||
"integrity": "sha512-/Ib/kloefDy+N0iRTxIUzyGcdW9lzlnca2Jsa5w73bs3npXjg+WInmiX6VY13mIb6SykkthYX/U5t0ukryGqBw==",
|
"integrity": "sha512-m4Vqs+APdKzDFpuaL9F9EVOF85+h070FnkHVEoU4+rmT6Vw0bmNl7s61VEkY/cJkL7RCv1p4urnUDUMrS5rk2w==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"chokidar": "^3.5.2",
|
"chokidar": "^3.5.2",
|
||||||
|
|||||||
@@ -48,11 +48,11 @@
|
|||||||
},
|
},
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/eslint-parser": "^7.24.6",
|
"@babel/eslint-parser": "^7.24.7",
|
||||||
"eslint": "^9.3.0",
|
"eslint": "^9.3.0",
|
||||||
"jasmine": "^5.1.0",
|
"jasmine": "^5.1.0",
|
||||||
"mongodb-runner": "^5.6.2",
|
"mongodb-runner": "^5.6.2",
|
||||||
"nodemon": "^3.1.2",
|
"nodemon": "^3.1.3",
|
||||||
"nyc": "15.1.0",
|
"nyc": "15.1.0",
|
||||||
"prettier": "^3.3.0",
|
"prettier": "^3.3.0",
|
||||||
"uglify-js": "^3.17.4"
|
"uglify-js": "^3.17.4"
|
||||||
|
|||||||
Generated
+7
-7
@@ -54,12 +54,12 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/braces": {
|
"node_modules/braces": {
|
||||||
"version": "3.0.2",
|
"version": "3.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz",
|
||||||
"integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==",
|
"integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"fill-range": "^7.0.1"
|
"fill-range": "^7.1.1"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=8"
|
"node": ">=8"
|
||||||
@@ -196,9 +196,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/fill-range": {
|
"node_modules/fill-range": {
|
||||||
"version": "7.0.1",
|
"version": "7.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz",
|
||||||
"integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==",
|
"integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"to-regex-range": "^5.0.1"
|
"to-regex-range": "^5.0.1"
|
||||||
|
|||||||
Reference in New Issue
Block a user