MCPcopy Index your code
hub / github.com/OpenSignLabs/OpenSign / getSecureUrl

Function getSecureUrl

apps/OpenSign/src/constant/Utils.js:198–215  ·  view source on GitHub ↗
(url)

Source from the content-addressed store, hash-verified

196
197// `getSecureUrl` is used to return local secure url if local files
198export const getSecureUrl = async (url) => {
199 const fileUrl = new URL(url)?.pathname?.includes("/files/");
200 if (fileUrl) {
201 try {
202 const fileRes = await Parse.Cloud.run("fileupload", { url: url });
203 if (fileRes.url) {
204 return { url: fileRes.url };
205 } else {
206 return { url: "" };
207 }
208 } catch (err) {
209 console.log("err while fileupload ", err);
210 return { url: "" };
211 }
212 } else {
213 return { url: url };
214 }
215};
216
217// `generateId` generates a random alphanumeric ID of specified length.
218export function generateId(length) {

Callers 6

uploadFileFunction · 0.90
FormsFunction · 0.90
handlePasswordSubmitFunction · 0.90
handleFileUploadFunction · 0.90
uploadFileFunction · 0.90
convertBase64ToFileFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected