Merge pull request #708 from OpenSignLabs/staging

refactor: unnecessary code
This commit is contained in:
prafull-opensignlabs
2025-05-30 14:54:53 +00:00
parent 3d223ba343
commit b19fb29b82
41 changed files with 2589 additions and 555 deletions
-27
View File
@@ -1,27 +0,0 @@
# Use an official Node runtime as the base image
FROM node:20
# Set the working directory inside the container
WORKDIR /usr/src/app
# Copy package.json and package-lock.json first to leverage Docker cache
COPY ./package*.json ./
# Install application dependencies
RUN npm install
# If you have native dependencies, you'll need extra tools. Uncomment the following line if needed.
# RUN apk add --no-cache make gcc g++ python3
# Copy the current directory contents into the container
COPY ./ .
# Make port 8080 available to the world outside this container
EXPOSE 8080
# Define environment variables if needed
# ENV NODE_ENV production
# ENV DATABASE_URL mongodb://db:27017
# Run the application
ENTRYPOINT npm start
+1 -1
View File
@@ -252,7 +252,7 @@ export const mailTemplate = param => {
"</td></tr><tr><td style='font-weight:bold;font-family:sans-serif;font-size:15px'>Note</td><td></td><td style='color:#626363;font-weight:bold'>" +
param.note +
"</td></tr><tr><td></td><td></td></tr></table></div> <div style='margin-left:70px'><a target=_blank href=" +
param.sigingUrl +
param.signingUrl +
"><button style='padding:12px;background-color:#d46b0f;color:white;border:0px;font-weight:bold;margin-top:30px'>Sign here</button></a></div><div style='display:flex;justify-content:center;margin-top:10px'></div></div></div><div><p> This is an automated email from " +
AppName +
'. For any queries regarding this email, please contact the sender ' +
@@ -4,9 +4,9 @@ export default async function Newsletter(request) {
const email = request.params?.email?.toLowerCase()?.replace(/\s/g, '');
const domain = request.params.domain;
try {
const envAppId = process.env.REACT_APP_APPID || 'opensign';
const envAppId = 'opensign';
const headers = { 'Content-Type': 'application/json', 'X-Parse-Application-Id': envAppId };
const envProdServer = process.env.REACT_APP_SERVERURL || 'https://app.opensignlabs.com/api/app';
const envProdServer = 'https://app.opensignlabs.com/api/app';
const newsletter = await axios.post(
`${envProdServer}/classes/Newsletter`,
{ Name: name, Email: email, Domain: domain },
@@ -14,7 +14,7 @@ async function deductcount(docsCount, extUserId) {
}
async function sendMail(document, publicUrl) {
//sessionToken
const baseUrl = new URL(publicUrl); //process.env.PUBLIC_URL
const baseUrl = new URL(publicUrl);
// console.log("pdfDetails", pdfDetails);
const timeToCompleteDays = document?.TimeToCompleteDays || 15;
@@ -71,7 +71,7 @@ async function sendMail(document, publicUrl) {
receiver_phone: existSigner?.Phone || '',
expiry_date: localExpireDate,
company_name: orgName,
signing_url: `<a href=${signPdf} target=_blank>Sign here</a>`,
signing_url: signPdf,
};
replaceVar = replaceMailVaribles(mailSubject, htmlReqBody, variables);
}
@@ -82,7 +82,7 @@ async function sendMail(document, publicUrl) {
title: document.Name,
organization: orgName,
localExpireDate: localExpireDate,
sigingUrl: signPdf,
signingUrl: signPdf,
};
let params = {
extUserId: document.ExtUserPtr.objectId,
@@ -116,7 +116,7 @@ async function sendNotifyMail(doc, signUser, mailProvider, publicUrl) {
const creatorEmail = doc.ExtUserPtr.Email;
const signerName = signUser.Name;
const signerEmail = signUser.Email;
const viewDocUrl = `${publicUrl}/recipientSignPdf/${doc.objectId}`; // ` ${process.env.PUBLIC_URL}/recipientSignPdf/${doc.objectId}`;
const viewDocUrl = `${publicUrl}/recipientSignPdf/${doc.objectId}`;
const subject = `Document "${pdfName}" has been signed by ${signerName}`;
const body =
"<html><head><meta http-equiv='Content-Type' content='text/html; charset=UTF-8'/></head><body><div style='background-color:#f5f5f5;padding:20px'><div style='background-color:white'>" +
+1 -1
View File
@@ -161,7 +161,7 @@ app.use(express.urlencoded({ limit: '50mb', extended: true }));
app.use(function (req, res, next) {
req.headers['x-real-ip'] = getUserIP(req);
const publicUrl = 'https://' + req?.get('host');
req.headers['public_url'] = publicUrl; // process.env.PUBLIC_URL
req.headers['public_url'] = publicUrl;
next();
});
function getUserIP(request) {
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "open_sign_server",
"version": "1.4.0",
"version": "2.21.1",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "open_sign_server",
"version": "1.4.0",
"version": "2.21.1",
"license": "MIT",
"dependencies": {
"@aws-sdk/client-s3": "^3.812.0",