console log tidying

This commit is contained in:
2024-06-05 19:50:56 +01:00
parent 3284bce649
commit 2a6cd32452
44 changed files with 290 additions and 466 deletions
+40 -40
View File
@@ -130,7 +130,7 @@ export const createContainer = async (containerName) => {
//containerName = containerName.toLowerCase();
// console.log(
//console.log(
// "container name:",
// containerName,
// STORAGE_PATH + "/" + containerName
@@ -145,11 +145,11 @@ export const createContainer = async (containerName) => {
const createContainerResponse = await containerClient.createIfNotExists();
console.log(
"\n//////////////////\n container name :",
containerName,
"\n//////////////////\n"
);
//console.log(
// "\n//////////////////\n container name :",
// containerName,
// "\n//////////////////\n"
// );
return containerName;
};
@@ -158,7 +158,7 @@ export const getContainers = async () => {
const creds = new DefaultAzureCredential();
const blobServiceClient = new BlobServiceClient(`${STORAGE_PATH}`, creds);
console.log("Containers:");
//console.log("Containers:");
for await (const container of blobServiceClient.listContainers()) {
console.log(`- ${container.name}`);
}
@@ -486,7 +486,7 @@ export const deleteBlobCase = async (containerName, blobName) => {
containerClient.deleteBlob(blob.name);
}
// containerClient.deleteBlob(blobName);
//containerClient.deleteBlob(blobName);
console.log(`deleted blob ${blobName}`);
for await (const blob of containerClient.listBlobsFlat()) {
console.log(" ------ :", blob.name);
@@ -521,8 +521,8 @@ export const deleteBlobRep = async (containerName, blobName) => {
//containerClient.deleteBlob(blob.name);
}
// containerClient.deleteBlob(blobName);
// console.log(`deleted blob ${blobName}`);
//containerClient.deleteBlob(blobName);
//console.log(`deleted blob ${blobName}`);
// for await (const blob of containerClient.listBlobsFlat()) {
// console.log(" ------ :", blob.name);
// }
@@ -669,7 +669,7 @@ export const uploadPDFRepFiles = async (
foldername
);
// console.log(`files[${prop}] = ${files[prop][0].size}`);
//console.log(`files[${prop}] = ${files[prop][0].size}`);
console.log(foldername + "/files/" + formContent.split("tmp/")[1]);
const blobName = foldername + "/" + formContent.split("tmp/")[1];
@@ -707,14 +707,14 @@ export const uploadPDFAppealFiles = async (
const files = formContent;
// console.log(
//console.log(
// "///////////////////////////// \n",
// formContent,
// containerName,
// foldername,
// "\n///////////////////////////// \n"
// );
// console.log(
//console.log(
// "///////////////////////////// \n",
// "appeal pdf files...",
// files,
@@ -723,7 +723,7 @@ export const uploadPDFAppealFiles = async (
// "\n///////////////////////////// \n"
// );
// console.log(`files[${prop}] = ${files[prop][0].size}`);
//console.log(`files[${prop}] = ${files[prop][0].size}`);
console.log(foldername + "/files/" + formContent.split("tmp/")[1]);
const blobName = foldername + "/files/" + formContent.split("tmp/")[1];
@@ -823,7 +823,7 @@ export const downloadAllProgressFiles = async (
containerName,
progressBlobObj
) => {
// console.log(
//console.log(
// "/////////////////////////\n downloading files: " +
// JSON.stringify(progressBlobObj) +
// "\n/////////////////////////\n"
@@ -899,11 +899,11 @@ export const downloadRepFile = async (
};
export const downloadAllRepsFiles = async (containerName, repsBlobObj) => {
console.log(
"/////////////////////////\n downloading files: " +
JSON.stringify(repsBlobObj) +
"\n/////////////////////////\n"
);
//console.log(
// "/////////////////////////\n downloading files: " +
// JSON.stringify(repsBlobObj) +
// "\n/////////////////////////\n"
// );
const containerToken = await createContainerSas(containerName);
const sasUrl = `${STORAGE_PATH}/${containerName}?${containerToken}`;
@@ -922,7 +922,7 @@ export const downloadAllRepsFiles = async (containerName, repsBlobObj) => {
console.log("is empt and an array");
for (const prop in repsBlobObj) {
console.log(`Progress - ${prop}: ${repsBlobObj[prop].path}`);
//console.log(`Progress - ${prop}: ${repsBlobObj[prop].path}`);
blobClient = containerClient.getBlobClient(repsBlobObj[prop].path);
downloadedBlob = await blobClient.download(0);
let repBlobObj = await streamToBuffer(
@@ -940,7 +940,7 @@ export const downloadAllRepsFiles = async (containerName, repsBlobObj) => {
}
//downloaded = downloaded.substring(0, downloaded.length - 1);
// console.log(
//console.log(
// "/////////////////////////\n downloaded : " +
// JSON.stringify(
// '{ "@odata.count": ' +
@@ -1029,11 +1029,11 @@ export const getProgressBlobs = async (containerName, caseReference) => {
blobCount++;
}
console.log(
"this is the casefolder and blobcount:",
caseReference,
blobCount
);
//console.log(
// "this is the casefolder and blobcount:",
// caseReference,
// blobCount
// );
let blobObj = [];
for await (const blob of containerClient.listBlobsFlat({
@@ -1114,12 +1114,12 @@ export const getAllProgressBlobs = async (containerName) => {
});
}
console.log(
"\n////////////////////////////\n",
"blobObj:",
blobObj,
"\n////////////////////////////"
);
//console.log(
// "\n////////////////////////////\n",
// "blobObj:",
// blobObj,
// "\n////////////////////////////"
// );
return blobObj;
};
@@ -1135,15 +1135,15 @@ export const getRepsBlobs = async (containerName) => {
for await (const blob of containerClient.findBlobsByTags(
"blobType='Representation'"
)) {
console.log(`-----Get Rep Blob ${blobCount++}: ${blob.name}`);
//console.log(`-----Get Rep Blob ${blobCount++}: ${blob.name}`);
blobCount++;
}
console.log(
"this is the casefolder and blobcount:",
//caseReference,
blobCount
);
//console.log(
// "this is the casefolder and blobcount:",
// //caseReference,
// blobCount
// );
const listOptions = {
includeMetadata: true,
@@ -1158,7 +1158,7 @@ export const getRepsBlobs = async (containerName) => {
listOptions
)) {
const blobClient = containerClient.getBlobClient(blob.name);
console.log("getreps blob:", blob);
//console.log("getreps blob:", blob);
blob.name.split("/")[2].indexOf("_rep.json") > 0 &&
blob.name.split("/")[2].indexOf("undefined") < 0 &&
blobObj.push({