Merge pull request

This commit is contained in:
prafull-opensignlabs
2026-03-04 07:31:19 +00:00
parent 2e2e535b70
commit acb0f3083c
158 changed files with 40172 additions and 1456 deletions
@@ -10,37 +10,28 @@ async function DocumentAfterFind(request) {
const certificateUrl = obj.get('CertificateUrl') && obj.get('CertificateUrl');
const isPrefillExist = obj?.get('Placeholders')?.some(x => x.Role === 'prefill');
const Placeholder = obj?.get('Placeholders') || [];
if (useLocal !== 'true') {
if (isPrefillExist) {
const updatedPlaceHolder = await handleValidImage(Placeholder);
obj.set('Placeholders', updatedPlaceHolder);
const shouldUsePresigned = useLocal !== 'true';
const isLocal = useLocal == 'true';
const resolveUrl = async rawUrl => {
if (!rawUrl) return rawUrl;
if (shouldUsePresigned) {
return await getPresignedUrl(rawUrl);
} else if (isLocal) {
return presignedlocalUrl(rawUrl);
}
if (SignedUrl) {
obj.set('SignedUrl', getPresignedUrl(SignedUrl));
}
if (Url) {
obj.set('URL', getPresignedUrl(Url));
}
if (certificateUrl) {
obj.set('CertificateUrl', getPresignedUrl(certificateUrl));
}
return [obj];
} else if (useLocal == 'true') {
if (isPrefillExist) {
const updatedPlaceHolder = await handleValidImage(Placeholder);
obj.set('Placeholders', updatedPlaceHolder);
}
if (SignedUrl) {
obj.set('SignedUrl', presignedlocalUrl(SignedUrl));
}
if (Url) {
obj.set('URL', presignedlocalUrl(Url));
}
if (certificateUrl) {
obj.set('CertificateUrl', presignedlocalUrl(certificateUrl));
}
return [obj];
};
if (isPrefillExist) {
const updatedPlaceHolder = await handleValidImage(Placeholder);
obj.set('Placeholders', updatedPlaceHolder);
}
if (SignedUrl) obj.set('SignedUrl', await resolveUrl(SignedUrl));
if (Url) obj.set('URL', await resolveUrl(Url));
if (certificateUrl) obj.set('CertificateUrl', await resolveUrl(certificateUrl));
return [obj];
}
}
}