mirror of
https://github.com/OpenSignLabs/OpenSign.git
synced 2026-09-21 09:07:43 +02:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7930a8f439 |
@@ -694,17 +694,20 @@ function WidgetsValueModal(props) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (isTab === "type") {
|
if (isTab === "type") {
|
||||||
|
//trim user name or typed name value to show in initial signature
|
||||||
const trimmedName = typedSignature
|
const trimmedName = typedSignature
|
||||||
? typedSignature?.trim()
|
? typedSignature?.trim()
|
||||||
: currentUserName?.trim();
|
: currentUserName?.trim();
|
||||||
|
//get full name of user
|
||||||
|
const fullUserName = typedSignature || currentUserName
|
||||||
const firstCharacter = trimmedName?.charAt(0);
|
const firstCharacter = trimmedName?.charAt(0);
|
||||||
const userName =
|
const userName =
|
||||||
currWidgetsDetails?.type === "initials"
|
currWidgetsDetails?.type === "initials"
|
||||||
? firstCharacter
|
? firstCharacter
|
||||||
: typedSignature;
|
: fullUserName;
|
||||||
const signatureValue = currWidgetsDetails?.typeSignature;
|
const signatureValue = currWidgetsDetails?.typeSignature;
|
||||||
setTypedSignature(signatureValue || userName || "");
|
setTypedSignature(signatureValue || userName || "");
|
||||||
convertToImg(fontSelect, userName);
|
convertToImg(fontSelect, signatureValue || userName || "");
|
||||||
}
|
}
|
||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
}, [isTab]);
|
}, [isTab]);
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import axios from 'axios';
|
|||||||
dotenv.config();
|
dotenv.config();
|
||||||
|
|
||||||
export const cloudServerUrl = 'http://localhost:8080/app';
|
export const cloudServerUrl = 'http://localhost:8080/app';
|
||||||
|
export const serverAppId = process.env.APP_ID || 'opensign';
|
||||||
export const appName = 'OpenSign™';
|
export const appName = 'OpenSign™';
|
||||||
|
|
||||||
export const MAX_NAME_LENGTH = 250;
|
export const MAX_NAME_LENGTH = 250;
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import axios from 'axios';
|
|||||||
import multer from 'multer';
|
import multer from 'multer';
|
||||||
import libre from 'libreoffice-convert';
|
import libre from 'libreoffice-convert';
|
||||||
import util from 'node:util';
|
import util from 'node:util';
|
||||||
import { cloudServerUrl, getSecureUrl } from '../../Utils.js';
|
import { cloudServerUrl, getSecureUrl, serverAppId } from '../../Utils.js';
|
||||||
|
|
||||||
libre.convertAsync = util.promisify(libre.convert);
|
libre.convertAsync = util.promisify(libre.convert);
|
||||||
|
|
||||||
@@ -29,7 +29,7 @@ function generatePdfName(length) {
|
|||||||
|
|
||||||
export default async function docxtopdf(req, res) {
|
export default async function docxtopdf(req, res) {
|
||||||
const serverUrl = cloudServerUrl;
|
const serverUrl = cloudServerUrl;
|
||||||
const appId = process.env.APP_ID;
|
const appId = serverAppId;
|
||||||
const masterKey = process.env.MASTER_KEY;
|
const masterKey = process.env.MASTER_KEY;
|
||||||
const inputPath = req.file.path;
|
const inputPath = req.file.path;
|
||||||
const name = generatePdfName(16);
|
const name = generatePdfName(16);
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import multer from 'multer';
|
|||||||
import multerS3 from 'multer-s3';
|
import multerS3 from 'multer-s3';
|
||||||
import aws from 'aws-sdk';
|
import aws from 'aws-sdk';
|
||||||
import dotenv from 'dotenv';
|
import dotenv from 'dotenv';
|
||||||
import { cloudServerUrl, useLocal } from '../../Utils.js';
|
import { cloudServerUrl, serverAppId, useLocal } from '../../Utils.js';
|
||||||
dotenv.config();
|
dotenv.config();
|
||||||
|
|
||||||
function sanitizeFileName(fileName) {
|
function sanitizeFileName(fileName) {
|
||||||
@@ -50,7 +50,7 @@ async function uploadFile(req, res) {
|
|||||||
const DO_SPACE = process.env.DO_SPACE;
|
const DO_SPACE = process.env.DO_SPACE;
|
||||||
|
|
||||||
const parseBaseUrl = cloudServerUrl; //process.env.SERVER_URL;
|
const parseBaseUrl = cloudServerUrl; //process.env.SERVER_URL;
|
||||||
const parseAppId = process.env.APP_ID;
|
const parseAppId = serverAppId;
|
||||||
let fileStorage;
|
let fileStorage;
|
||||||
if (useLocal === 'true') {
|
if (useLocal === 'true') {
|
||||||
fileStorage = multer.diskStorage({
|
fileStorage = multer.diskStorage({
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { cloudServerUrl } from '../../Utils.js';
|
import { cloudServerUrl, serverAppId } from '../../Utils.js';
|
||||||
const serverUrl = cloudServerUrl; //process.env.SERVER_URL;
|
const serverUrl = cloudServerUrl; //process.env.SERVER_URL;
|
||||||
const APPID = process.env.APP_ID;
|
const APPID = serverAppId;
|
||||||
const masterKEY = process.env.MASTER_KEY;
|
const masterKEY = process.env.MASTER_KEY;
|
||||||
async function addTeamAndOrg(extUser) {
|
async function addTeamAndOrg(extUser) {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { cloudServerUrl } from '../../Utils.js';
|
import { cloudServerUrl, serverAppId } from '../../Utils.js';
|
||||||
async function AuthLoginAsMail(request) {
|
async function AuthLoginAsMail(request) {
|
||||||
try {
|
try {
|
||||||
//function for login user using user objectId without touching user's password
|
//function for login user using user objectId without touching user's password
|
||||||
const serverUrl = cloudServerUrl; //process.env.SERVER_URL;
|
const serverUrl = cloudServerUrl; //process.env.SERVER_URL;
|
||||||
const APPID = process.env.APP_ID;
|
const APPID = serverAppId;
|
||||||
const masterKEY = process.env.MASTER_KEY;
|
const masterKEY = process.env.MASTER_KEY;
|
||||||
|
|
||||||
let otpN = request.params.otp;
|
let otpN = request.params.otp;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { appName, cloudServerUrl } from '../../Utils.js';
|
import { appName, cloudServerUrl, serverAppId } from '../../Utils.js';
|
||||||
|
|
||||||
export default async function forwardDoc(request) {
|
export default async function forwardDoc(request) {
|
||||||
try {
|
try {
|
||||||
@@ -58,7 +58,7 @@ export default async function forwardDoc(request) {
|
|||||||
mailRes = await axios.post(`${cloudServerUrl}/functions/sendmailv3`, params, {
|
mailRes = await axios.post(`${cloudServerUrl}/functions/sendmailv3`, params, {
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'X-Parse-Application-Id': process.env.APP_ID,
|
'X-Parse-Application-Id': serverAppId,
|
||||||
'X-Parse-Master-Key': process.env.MASTER_KEY,
|
'X-Parse-Master-Key': process.env.MASTER_KEY,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { cloudServerUrl } from '../../Utils.js';
|
import { cloudServerUrl, serverAppId } from '../../Utils.js';
|
||||||
|
|
||||||
export default async function GetTemplate(request) {
|
export default async function GetTemplate(request) {
|
||||||
const serverUrl = cloudServerUrl; //process.env.SERVER_URL;
|
const serverUrl = cloudServerUrl; //process.env.SERVER_URL;
|
||||||
@@ -10,7 +10,7 @@ export default async function GetTemplate(request) {
|
|||||||
if (sessiontoken) {
|
if (sessiontoken) {
|
||||||
const userRes = await axios.get(serverUrl + '/users/me', {
|
const userRes = await axios.get(serverUrl + '/users/me', {
|
||||||
headers: {
|
headers: {
|
||||||
'X-Parse-Application-Id': process.env.APP_ID,
|
'X-Parse-Application-Id': serverAppId,
|
||||||
'X-Parse-Session-Token': sessiontoken,
|
'X-Parse-Session-Token': sessiontoken,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { cloudServerUrl } from '../../Utils.js';
|
import { cloudServerUrl, serverAppId } from '../../Utils.js';
|
||||||
const appId = process.env.APP_ID;
|
const appId = serverAppId;
|
||||||
const masterkey = process.env.MASTER_KEY;
|
const masterkey = process.env.MASTER_KEY;
|
||||||
export default async function createBatchContact(req) {
|
export default async function createBatchContact(req) {
|
||||||
if (!req?.user) {
|
if (!req?.user) {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { cloudServerUrl, mailTemplate, replaceMailVaribles } from '../../Utils.js';
|
import { cloudServerUrl, mailTemplate, replaceMailVaribles, serverAppId } from '../../Utils.js';
|
||||||
const serverUrl = cloudServerUrl; //process.env.SERVER_URL;
|
const serverUrl = cloudServerUrl; //process.env.SERVER_URL;
|
||||||
const appId = process.env.APP_ID;
|
const appId = serverAppId;
|
||||||
async function deductcount(docsCount, extUserId) {
|
async function deductcount(docsCount, extUserId) {
|
||||||
try {
|
try {
|
||||||
const extCls = new Parse.Object('contracts_Users');
|
const extCls = new Parse.Object('contracts_Users');
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { cloudServerUrl } from '../../Utils.js';
|
import { cloudServerUrl, serverAppId } from '../../Utils.js';
|
||||||
export default async function getDocument(request) {
|
export default async function getDocument(request) {
|
||||||
const serverUrl = cloudServerUrl; //process.env.SERVER_URL;
|
const serverUrl = cloudServerUrl; //process.env.SERVER_URL;
|
||||||
const docId = request.params.docId;
|
const docId = request.params.docId;
|
||||||
@@ -30,7 +30,7 @@ export default async function getDocument(request) {
|
|||||||
try {
|
try {
|
||||||
const userRes = await axios.get(serverUrl + '/users/me', {
|
const userRes = await axios.get(serverUrl + '/users/me', {
|
||||||
headers: {
|
headers: {
|
||||||
'X-Parse-Application-Id': process.env.APP_ID,
|
'X-Parse-Application-Id': serverAppId,
|
||||||
'X-Parse-Session-Token': sessiontoken,
|
'X-Parse-Session-Token': sessiontoken,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { cloudServerUrl } from '../../Utils.js';
|
import { cloudServerUrl, serverAppId } from '../../Utils.js';
|
||||||
export default async function getDrive(request) {
|
export default async function getDrive(request) {
|
||||||
const serverUrl = cloudServerUrl; //process.env.SERVER_URL;
|
const serverUrl = cloudServerUrl; //process.env.SERVER_URL;
|
||||||
const appId = process.env.APP_ID;
|
const appId = serverAppId;
|
||||||
const limit = request.params.limit;
|
const limit = request.params.limit;
|
||||||
const skip = request.params.skip;
|
const skip = request.params.skip;
|
||||||
const docId = request.params.docId;
|
const docId = request.params.docId;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { cloudServerUrl } from '../../Utils.js';
|
import { cloudServerUrl, serverAppId } from '../../Utils.js';
|
||||||
import reportJson from './reportsJson.js';
|
import reportJson from './reportsJson.js';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
|
||||||
@@ -14,7 +14,7 @@ export default async function getReport(request) {
|
|||||||
const searchTerm = request.params.searchTerm || '';
|
const searchTerm = request.params.searchTerm || '';
|
||||||
|
|
||||||
const serverUrl = cloudServerUrl; //process.env.SERVER_URL;
|
const serverUrl = cloudServerUrl; //process.env.SERVER_URL;
|
||||||
const appId = process.env.APP_ID;
|
const appId = serverAppId;
|
||||||
const masterKey = process.env.MASTER_KEY;
|
const masterKey = process.env.MASTER_KEY;
|
||||||
const sessionToken = request.headers['sessiontoken'] || request.headers['x-parse-session-token'];
|
const sessionToken = request.headers['sessiontoken'] || request.headers['x-parse-session-token'];
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import {
|
|||||||
saveFileUsage,
|
saveFileUsage,
|
||||||
getSecureUrl,
|
getSecureUrl,
|
||||||
appName,
|
appName,
|
||||||
|
serverAppId,
|
||||||
} from '../../../Utils.js';
|
} from '../../../Utils.js';
|
||||||
import GenerateCertificate from './GenerateCertificate.js';
|
import GenerateCertificate from './GenerateCertificate.js';
|
||||||
import { pdflibAddPlaceholder } from '@signpdf/placeholder-pdf-lib';
|
import { pdflibAddPlaceholder } from '@signpdf/placeholder-pdf-lib';
|
||||||
@@ -15,7 +16,7 @@ import { SignPdf } from '@signpdf/signpdf';
|
|||||||
import { P12Signer } from '@signpdf/signer-p12';
|
import { P12Signer } from '@signpdf/signer-p12';
|
||||||
|
|
||||||
const serverUrl = cloudServerUrl; // process.env.SERVER_URL;
|
const serverUrl = cloudServerUrl; // process.env.SERVER_URL;
|
||||||
const APPID = process.env.APP_ID;
|
const APPID = serverAppId;
|
||||||
const masterKEY = process.env.MASTER_KEY;
|
const masterKEY = process.env.MASTER_KEY;
|
||||||
const eSignName = 'OpenSign';
|
const eSignName = 'OpenSign';
|
||||||
const eSigncontact = 'hello@opensignlabs.com';
|
const eSigncontact = 'hello@opensignlabs.com';
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { cloudServerUrl } from '../../Utils.js';
|
import { cloudServerUrl, serverAppId } from '../../Utils.js';
|
||||||
const serverUrl = cloudServerUrl; //process.env.SERVER_URL;
|
const serverUrl = cloudServerUrl; //process.env.SERVER_URL;
|
||||||
const APPID = process.env.APP_ID;
|
const APPID = serverAppId;
|
||||||
const masterKEY = process.env.MASTER_KEY;
|
const masterKEY = process.env.MASTER_KEY;
|
||||||
|
|
||||||
async function saveUser(userDetails) {
|
async function saveUser(userDetails) {
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import AWS from 'aws-sdk';
|
|||||||
import { app as customRoute } from './cloud/customRoute/customApp.js';
|
import { app as customRoute } from './cloud/customRoute/customApp.js';
|
||||||
import { exec } from 'child_process';
|
import { exec } from 'child_process';
|
||||||
import { createTransport } from 'nodemailer';
|
import { createTransport } from 'nodemailer';
|
||||||
import { appName, cloudServerUrl, smtpenable, smtpsecure, useLocal } from './Utils.js';
|
import { appName, cloudServerUrl, serverAppId, smtpenable, smtpsecure, useLocal } from './Utils.js';
|
||||||
import { SSOAuth } from './auth/authadapter.js';
|
import { SSOAuth } from './auth/authadapter.js';
|
||||||
import createContactIndex from './migrationdb/createContactIndex.js';
|
import createContactIndex from './migrationdb/createContactIndex.js';
|
||||||
import { validateSignedLocalUrl } from './cloud/parsefunction/getSignedUrl.js';
|
import { validateSignedLocalUrl } from './cloud/parsefunction/getSignedUrl.js';
|
||||||
@@ -97,7 +97,7 @@ export const config = {
|
|||||||
cloud: function () {
|
cloud: function () {
|
||||||
import('./cloud/main.js');
|
import('./cloud/main.js');
|
||||||
},
|
},
|
||||||
appId: process.env.APP_ID || 'opensign',
|
appId: serverAppId,
|
||||||
logLevel: ['error'],
|
logLevel: ['error'],
|
||||||
maxLimit: 500,
|
maxLimit: 500,
|
||||||
maxUploadSize: '30mb',
|
maxUploadSize: '30mb',
|
||||||
@@ -234,8 +234,8 @@ if (!process.env.TESTING) {
|
|||||||
createContactIndex();
|
createContactIndex();
|
||||||
|
|
||||||
const migrate = isWindows
|
const migrate = isWindows
|
||||||
? `set APPLICATION_ID=${process.env.APP_ID}&& set SERVER_URL=${cloudServerUrl}&& set MASTER_KEY=${process.env.MASTER_KEY}&& npx parse-dbtool migrate`
|
? `set APPLICATION_ID=${serverAppId}&& set SERVER_URL=${cloudServerUrl}&& set MASTER_KEY=${process.env.MASTER_KEY}&& npx parse-dbtool migrate`
|
||||||
: `APPLICATION_ID=${process.env.APP_ID} SERVER_URL=${cloudServerUrl} MASTER_KEY=${process.env.MASTER_KEY} npx parse-dbtool migrate`;
|
: `APPLICATION_ID=${serverAppId} SERVER_URL=${cloudServerUrl} MASTER_KEY=${process.env.MASTER_KEY} npx parse-dbtool migrate`;
|
||||||
exec(migrate, (error, stdout, stderr) => {
|
exec(migrate, (error, stdout, stderr) => {
|
||||||
if (error) {
|
if (error) {
|
||||||
console.error(`Error: ${error.message}`);
|
console.error(`Error: ${error.message}`);
|
||||||
|
|||||||
Reference in New Issue
Block a user