mirror of
https://github.com/OpenSignLabs/OpenSign.git
synced 2026-08-20 06:35:54 +02:00
Delete apps/OpenSign/package-lock.json
This commit is contained in:
@@ -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!' };
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user