Delete apps/OpenSign/package-lock.json

This commit is contained in:
prafull-opensignlabs
2025-12-22 09:56:25 +00:00
parent 8a2329dd60
commit 4fb8aa9a16
64 changed files with 16808 additions and 988 deletions
+11
View File
@@ -160,6 +160,17 @@ export const smtpsecure = process.env.SMTP_PORT && process.env.SMTP_PORT !== '46
export const smtpenable =
process.env.SMTP_ENABLE && process.env.SMTP_ENABLE.toLowerCase() === 'true' ? true : false;
export const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
export function signPayload(payload, secret) {
if (payload && secret) {
const signature = crypto
.createHmac('sha256', secret)
.update(JSON.stringify(payload))
.digest('hex');
return { 'x-webhook-signature': signature };
} else {
return {};
}
}
// `generateId` is used to unique Id for fileAdapter
export function generateId(length) {
@@ -8,12 +8,16 @@ async function SignatureAfterFind(request) {
const obj = request.objects[0];
const ImageURL = obj?.get('ImageURL') && obj?.get('ImageURL');
const Initials = obj?.get('Initials') && obj?.get('Initials');
const Stamp = obj?.get('Stamp') && obj?.get('Stamp');
if (ImageURL) {
obj.set('ImageURL', getPresignedUrl(ImageURL));
}
if (Initials) {
obj.set('Initials', getPresignedUrl(Initials));
}
if (Stamp) {
obj.set('Stamp', getPresignedUrl(Stamp));
}
return [obj];
}
}
@@ -23,12 +27,16 @@ async function SignatureAfterFind(request) {
const obj = request.objects[0];
const ImageURL = obj?.get('ImageURL') && obj?.get('ImageURL');
const Initials = obj?.get('Initials') && obj?.get('Initials');
const Stamp = obj?.get('Stamp') && obj?.get('Stamp');
if (ImageURL) {
obj.set('ImageURL', presignedlocalUrl(ImageURL));
}
if (Initials) {
obj.set('Initials', presignedlocalUrl(Initials));
}
if (Stamp) {
obj.set('Stamp', presignedlocalUrl(Stamp));
}
return [obj];
}
}
@@ -101,11 +101,7 @@ async function sendMail(document, publicUrl) {
}
async function batchQuery(userId, Documents, Ip, parseConfig, type, publicUrl) {
const extCls = new Parse.Query('contracts_Users');
extCls.equalTo('UserId', {
__type: 'Pointer',
className: '_User',
objectId: userId,
});
extCls.equalTo('UserId', { __type: 'Pointer', className: '_User', objectId: userId });
const resExt = await extCls.first({ useMasterKey: true });
if (resExt) {
const _resExt = JSON.parse(JSON.stringify(resExt));
@@ -189,6 +185,7 @@ async function batchQuery(userId, Documents, Ip, parseConfig, type, publicUrl) {
},
}
: {}),
...(x?.PenColors?.length > 0 ? { PenColors: x?.PenColors } : {}),
},
};
});
@@ -1,5 +1,5 @@
export default async function manageSign(request) {
const { signature, userId, initials, id, title } = request.params;
const { signature, userId, initials, id, title, stamp } = request.params;
if (!userId) {
throw new Parse.Error(Parse.Error.INVALID_QUERY, 'Missing userId parameter.');
@@ -16,6 +16,7 @@ export default async function manageSign(request) {
signatureCls.set('Initials', initials ? initials : '');
signatureCls.set('ImageURL', signature ? signature : '');
signatureCls.set('SignatureName', title ? title : '');
signatureCls.set('Stamp', stamp ? stamp : '');
if (userPtr) {
signatureCls.set('UserId', userPtr);
}
@@ -114,6 +114,9 @@ export default async function saveAsTemplate(request) {
if (_docRes?.Bcc?.length > 0) {
templateCls.set('Bcc', _docRes?.Bcc);
}
if (_docRes?.PenColors?.length > 0) {
templateCls.set('PenColors', _docRes?.PenColors);
}
const res = await templateCls.save(null, { useMasterKey: true });
return res;
} else {
@@ -1,5 +1,5 @@
export default async function saveSignature(request) {
const { signature, userId, initials, id, title } = request.params;
const { signature, userId, initials, id, title, stamp } = request.params;
if (!userId) {
throw new Parse.Error(Parse.Error.INVALID_QUERY, 'Missing userId parameter.');
@@ -19,6 +19,9 @@ export default async function saveSignature(request) {
if (signature) {
signatureCls.set('ImageURL', signature);
}
if (stamp) {
signatureCls.set('Stamp', stamp);
}
if (title) {
signatureCls.set('SignatureName', title);
}
@@ -8,6 +8,8 @@ export default async function triggerEvent(request) {
const contactId = request.params.contactId;
const serverUrl = cloudServerUrl; //process.env.SERVER_URL;
const appId = serverAppId;
const sessiontoken = request.headers?.sessiontoken;
try {
const docQuery = new Parse.Query('contracts_Document');
docQuery.select(['Name', 'IsEnableOTP', 'SignedUrl', 'AuditTrail']);
@@ -17,13 +19,16 @@ export default async function triggerEvent(request) {
let userId;
if (isEnableOTP) {
const userRes = await axios.get(serverUrl + '/users/me', {
headers: {
'X-Parse-Application-Id': appId,
'X-Parse-Session-Token': request.headers['sessiontoken'],
},
});
userId = userRes.data && userRes.data.objectId;
let userId;
if (sessiontoken) {
const userRes = await axios.get(serverUrl + '/users/me', {
headers: {
'X-Parse-Application-Id': appId,
'X-Parse-Session-Token': sessiontoken,
},
});
userId = userRes.data && userRes.data.objectId;
}
if (!userId) {
return { message: 'User not found!' };
}
@@ -58,7 +63,10 @@ export default async function triggerEvent(request) {
return { message: 'event called!' };
} catch (err) {
console.log(`Err in triggerEvent: ${err}`);
console.log(
`triggerEvent error: `,
err?.response?.data?.error || err?.message || 'Something went wrong!'
);
return { message: 'Something went wrong!' };
}
}
@@ -0,0 +1,19 @@
/**
*
* @param {Parse} Parse
*/
exports.up = async Parse => {
const schema = new Parse.Schema('contracts_Signature');
schema.addString('Stamp');
return schema.update();
};
/**
*
* @param {Parse} Parse
*/
exports.down = async Parse => {
const schema = new Parse.Schema('contracts_Signature');
schema.deleteField('Stamp');
return schema.update();
};
@@ -0,0 +1,27 @@
/**
*
* @param {Parse} Parse
*/
exports.up = async Parse => {
const docSchema = new Parse.Schema('contracts_Document');
docSchema.addArray('PenColors');
await docSchema.update();
const templateSchema = new Parse.Schema('contracts_Template');
templateSchema.addArray('PenColors');
await templateSchema.update();
};
/**
*
* @param {Parse} Parse
*/
exports.down = async Parse => {
const docSchema = new Parse.Schema('contracts_Document');
docSchema.deleteField('PenColors');
await docSchema.update();
const templateSchema = new Parse.Schema('contracts_Template');
templateSchema.deleteField('PenColors');
await templateSchema.update();
};
+14894
View File
File diff suppressed because it is too large Load Diff
+15 -14
View File
@@ -1,6 +1,6 @@
{
"name": "open_sign_server",
"version": "2.32.0",
"version": "2.34.0",
"description": "opensign server using the parse-server module",
"repository": {
"type": "git",
@@ -18,16 +18,16 @@
"watch": "nodemon index.js"
},
"dependencies": {
"@aws-sdk/client-s3": "^3.943.0",
"@aws-sdk/s3-request-presigner": "^3.943.0",
"@aws-sdk/client-s3": "^3.952.0",
"@aws-sdk/s3-request-presigner": "^3.952.0",
"@parse/fs-files-adapter": "^3.0.0",
"@parse/push-adapter": "^8.0.2",
"@parse/push-adapter": "^8.1.0",
"@parse/s3-files-adapter": "^4.2.0",
"@pdf-lib/fontkit": "^1.1.1",
"@signpdf/placeholder-pdf-lib": "^3.2.6",
"@signpdf/signer-p12": "^3.2.4",
"@signpdf/signpdf": "^3.2.5",
"aws-sdk": "^2.1692.0",
"aws-sdk": "^2.1693.0",
"axios": "^1.13.2",
"coherentpdf": "^2.5.5",
"cors": "^2.8.5",
@@ -36,23 +36,24 @@
"express": "^5.2.1",
"form-data": "^4.0.5",
"generate-api-key": "^1.0.2",
"googleapis": "^167.0.0",
"googleapis": "^169.0.0",
"libreoffice-convert": "^1.7.0",
"mailgun.js": "^12.2.0",
"mongodb": "^5.9.2",
"mailgun.js": "^12.4.0",
"moment": "^2.30.1",
"mongodb": "^7.0.0",
"multer": "^2.0.2",
"multer-s3": "^3.0.1",
"node-forge": "^1.3.3",
"nodemailer": "^7.0.11",
"p-limit": "^7.2.0",
"parse": "^7.1.2",
"parse": "^8.0.0",
"parse-dbtool": "^1.2.0",
"parse-server": "^8.5.0",
"parse-server": "^8.6.2",
"parse-server-api-mail-adapter": "^5.0.2",
"pdf-lib": "^1.17.1",
"posthog-node": "^5.14.0",
"posthog-node": "^5.17.2",
"qrcode": "^1.5.4",
"rate-limiter-flexible": "^8.3.0",
"rate-limiter-flexible": "^9.0.1",
"sharp": "^0.34.5",
"speakeasy": "^2.0.0",
"ws": "^8.18.3"
@@ -60,9 +61,9 @@
"type": "module",
"devDependencies": {
"@babel/eslint-parser": "^7.28.5",
"eslint": "^9.39.1",
"eslint": "^9.39.2",
"jasmine": "^5.12.0",
"mongodb-runner": "^5.11.1",
"mongodb-runner": "^6.4.0",
"nodemon": "^3.1.11",
"nyc": "^17.1.0",
"prettier": "^3.7.4"