TASK22269: consolidate azurestorage hash metadata mapping

This commit is contained in:
2026-03-25 14:27:52 +00:00
parent fcce6a3978
commit 8744d3dafc
2 changed files with 76 additions and 65 deletions
+43 -65
View File
@@ -84,6 +84,31 @@ const buildGetBlobListQueryPath = ({ containerName, casefolderID }) => {
);
};
const buildHashMetadataPaths = ({ containerName, casefolderID, blobname }) => {
return {
"hashedfilepath": hashAPIPath(
buildDownloadBlobQueryPath({
containerName,
casefolderID,
blobname
})
),
"hasheddeletepath": hashAPIPath(
buildDeleteBlobQueryPath({
containerName,
casefolderID,
blobname
})
),
"hashgetblobs": hashAPIPath(
buildGetBlobListQueryPath({
containerName,
casefolderID
})
)
};
};
export const createContainerSas = async (containerName) => {
// Get environment variables
@@ -266,33 +291,18 @@ export const getBlobs = async (containerName, casefolderID) => {
encodeURIComponent(casefolderID) +
"&blobname=" +
encodeURIComponent(blob.name),
"hashedfilepath": hashAPIPath(
buildDownloadBlobQueryPath({
containerName,
casefolderID,
blobname: blob.name.split("/")[2]
})
),
...buildHashMetadataPaths({
containerName,
casefolderID,
blobname: blob.name.split("/")[2]
}),
"deletepath":
"/api/file/deleteblob?container=" +
containerName +
"&casefolderID=" +
encodeURIComponent(casefolderID) +
"&blobname=" +
encodeURIComponent(blob.name.split("/")[2]),
"hasheddeletepath": hashAPIPath(
buildDeleteBlobQueryPath({
containerName,
casefolderID,
blobname: blob.name.split("/")[2]
})
),
"hashgetblobs": hashAPIPath(
buildGetBlobListQueryPath({
containerName,
casefolderID
})
)
encodeURIComponent(blob.name.split("/")[2])
});
}
//console.log("blobObj:", blobObj);
@@ -1296,26 +1306,11 @@ export const getProgressBlobs = async (containerName, caseReference) => {
"contentLength": blob.properties.contentLength,
"contentType": blob.contentType,
"lastModified": blob.properties.lastModified,
"hashedfilepath": hashAPIPath(
buildDownloadBlobQueryPath({
containerName,
casefolderID: caseReference,
blobname: blob.name.split("/")[1]
})
),
"hasheddeletepath": hashAPIPath(
buildDeleteBlobQueryPath({
containerName,
casefolderID: caseReference,
blobname: blob.name.split("/")[1]
})
),
"hashgetblobs": hashAPIPath(
buildGetBlobListQueryPath({
containerName,
casefolderID: caseReference
})
)
...buildHashMetadataPaths({
containerName,
casefolderID: caseReference,
blobname: blob.name.split("/")[1]
})
});
}
@@ -1503,14 +1498,12 @@ export const getRepsFilesBlobs = async (
) +
"&blobname=" +
encodeURIComponent(blob.name.split("/")[3]),
"hashedfilepath": hashAPIPath(
buildDownloadBlobQueryPath({
containerName,
casefolderID:
blob.name.split("/")[0] + "/" + blob.name.split("/")[1],
blobname: blob.name.split("/")[3]
})
),
...buildHashMetadataPaths({
containerName,
casefolderID:
blob.name.split("/")[0] + "/" + blob.name.split("/")[1],
blobname: blob.name.split("/")[3]
}),
"deletepath":
"/api/file/deleteblob?container=" +
containerName +
@@ -1519,22 +1512,7 @@ export const getRepsFilesBlobs = async (
"/" +
blob.name.split("/")[1] +
"&blobname=" +
blob.name.split("/")[3],
"hasheddeletepath": hashAPIPath(
buildDeleteBlobQueryPath({
containerName,
casefolderID:
blob.name.split("/")[0] + "/" + blob.name.split("/")[1],
blobname: blob.name.split("/")[3]
})
),
"hashgetblobs": hashAPIPath(
buildGetBlobListQueryPath({
containerName,
casefolderID:
blob.name.split("/")[0] + "/" + blob.name.split("/")[1]
})
)
blob.name.split("/")[3]
});
}
console.log("blobObj:", blobObj);