{"info":{"_postman_id":"7e724631-6046-4359-96ea-88b3b3cc1828","name":"Shadline API => Shadline Prod","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"description":"<html><head></head><body></body></html>","owner":"14673366","collectionId":"7e724631-6046-4359-96ea-88b3b3cc1828","publishedId":"TzsWuqXw","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"publishDate":"2021-07-21T12:11:40.000Z"},"item":[{"name":"v2.4","item":[{"name":"authenticate","item":[{"name":"authenticate","event":[{"listen":"prerequest","script":{"id":"1b34ac52-093c-49bc-992f-855a549ebfc6","exec":["// TO MONITOR: https://github.com/postmanlabs/postman-app-support/issues/4193#issuecomment-626699439 (#697)\r","\r","const echoPostRequest = {\r","  url: pm.collectionVariables.get(\"protocol\") + \"://\" + pm.collectionVariables.get(\"host\") + \":\" + pm.collectionVariables.get(\"port\") + \"/api/v2/authenticate\",\r","  method: 'POST',\r","  header: {\r","    'Content-Type': 'application/json',\r","    'Accept': '*/*',\r","    'Connection': 'keep-alive',\r","    'x-api-key': pm.collectionVariables.get(\"x-api-key\"),\r","    'Content-Type': 'application/json; charset=utf-8'\r","  }\r","};\r","\r","if(pm.collectionVariables.get(\"throughGw\") == \"true\") {\r","    pm.sendRequest(echoPostRequest, function (err, res) {\r","    console.log(err ? err : res.json());\r","    if(err === null) {\r","      console.info('Refreshing the token')\r","      var responseJson = res.json();\r","      pm.collectionVariables.set('authToken', responseJson.data.token)\r","    }\r","  });\r","}\r",""],"type":"text/javascript"}},{"listen":"test","script":{"id":"96dc17bf-08ad-4470-9a7b-1540e3dbe02e","exec":["pm.test(\"put /authenticate is ok\", function () {","    pm.response.to.have.status(200);","    const response = (pm.response.json()).data;","    const { localPassword } = response;","    pm.collectionVariables.set('localPassword',localPassword);","    postman.setNextRequest('create folder');","});","","if (pm.response.status === 401) {","    console.log('ok');","    postman.setNextRequest('reset-password');","}"],"type":"text/javascript"}}],"id":"4256a8b8-7899-4102-a038-6cf26bae507a","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[{"key":"Authorization","type":"text","value":"Bearer (Automatically filled)"},{"key":"x-api-key","type":"text","value":"(Fill with value in README.md)"},{"key":"x-user-key","type":"text","value":"(Fill with value in README.md)"},{"key":"Content-Type","name":"Content-Type","type":"text","value":"application/x-www-form-urlencoded"}],"body":{"mode":"urlencoded","urlencoded":[{"key":"hpassword","type":"text","value":"(Fill an encrypted password)"}]},"url":"https://shadline.com:4435/api/v2/authenticate","urlObject":{"protocol":"https","port":"4435","path":["api","v2","authenticate"],"host":["shadline.com"],"query":[],"variable":[]}},"response":[],"_postman_id":"4256a8b8-7899-4102-a038-6cf26bae507a"},{"name":"get token","event":[{"listen":"prerequest","script":{"id":"a4089800-f9e0-4f09-bcc6-82a9f8aeadd9","exec":["// TO MONITOR: https://github.com/postmanlabs/postman-app-support/issues/4193#issuecomment-626699439 (#697)\r","\r","const echoPostRequest = {\r","  url: pm.collectionVariables.get(\"protocol\") + \"://\" + pm.collectionVariables.get(\"host\") + \":\" + pm.collectionVariables.get(\"port\") + \"/api/v2/authenticate\",\r","  method: 'POST',\r","  header: {\r","    'Content-Type': 'application/json',\r","    'Accept': '*/*',\r","    'Connection': 'keep-alive',\r","    'x-api-key': pm.collectionVariables.get(\"x-api-key\"),\r","    'Content-Type': 'application/json; charset=utf-8'\r","  }\r","};\r","\r","if(pm.collectionVariables.get(\"throughGw\") == \"true\") {\r","    pm.sendRequest(echoPostRequest, function (err, res) {\r","    console.log(err ? err : res.json());\r","    if(err === null) {\r","      console.info('Refreshing the token')\r","      var responseJson = res.json();\r","      pm.collectionVariables.set('authToken', responseJson.data.token)\r","    }\r","  });\r","}\r",""],"type":"text/javascript"}},{"listen":"test","script":{"id":"c1f6853b-7aba-4f0b-8e5a-4d9a5622e69c","exec":[""],"type":"text/javascript"}}],"id":"6b09c71b-c139-4a05-aeeb-ddc03e235b1f","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"x-api-key","value":"(Fill with value in README.md)","type":"text"},{"key":"Content-Type","name":"Content-Type","value":"application/x-www-form-urlencoded","type":"text"}],"body":{"mode":"urlencoded","urlencoded":[]},"url":"https://shadline.com:4435/api/v2/authenticate","urlObject":{"protocol":"https","port":"4435","path":["api","v2","authenticate"],"host":["shadline.com"],"query":[],"variable":[]}},"response":[],"_postman_id":"6b09c71b-c139-4a05-aeeb-ddc03e235b1f"},{"name":"get localPassword","event":[{"listen":"prerequest","script":{"id":"1bb623da-8dfd-490b-9318-f9fbcb6a738b","exec":["// TO MONITOR: https://github.com/postmanlabs/postman-app-support/issues/4193#issuecomment-626699439 (#697)","","const echoPostRequest = {","  url: pm.collectionVariables.get(\"protocol\") + \"://\" + pm.collectionVariables.get(\"host\") + \":\" + pm.collectionVariables.get(\"port\") + \"/api/v2/authenticate\",","  method: 'POST',","  header: {","    'Content-Type': 'application/json',","    'Accept': '*/*',","    'Connection': 'keep-alive',","    'x-api-key': pm.collectionVariables.get(\"x-api-key\"),","    'Content-Type': 'application/json; charset=utf-8'","  }","};","","if(pm.collectionVariables.get(\"throughGw\") == \"true\") {","    pm.sendRequest(echoPostRequest, function (err, res) {","    console.log(err ? err : res.json());","    if(err === null) {","      console.info('Refreshing the token')","      var responseJson = res.json();","      pm.collectionVariables.set('authToken', responseJson.data.token);","    }","  });","}",""],"type":"text/javascript"}},{"listen":"test","script":{"id":"16853a52-2b70-4be9-8da7-79d02bd70d2b","exec":["pm.test(\"get /authenticate is ok\", function () {","    pm.response.to.have.status(200);","    const response = (pm.response.json()).data;","    const { localPassword } = response;","    pm.collectionVariables.set('localPassword',localPassword);","});"],"type":"text/javascript"}}],"id":"bce8fbb6-247f-4443-970e-1521fbcb4f84","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","value":"Bearer (Automatically filled)","type":"text"},{"key":"x-api-key","value":"(Fill with value in README.md)","type":"text"},{"key":"x-user-key","value":"(Fill with value in README.md)","type":"text"}],"url":"https://shadline.com:4435/api/v2/authenticate/(Fill an encrypted password)","description":"<p>Retrieve localpassword from hpassword</p>\n","urlObject":{"protocol":"https","port":"4435","path":["api","v2","authenticate","(Fill an encrypted password)"],"host":["shadline.com"],"query":[],"variable":[]}},"response":[],"_postman_id":"bce8fbb6-247f-4443-970e-1521fbcb4f84"},{"name":"reset-password","event":[{"listen":"prerequest","script":{"id":"b78e5a82-1d2f-47f1-982b-70d25e9a964c","exec":["// TO MONITOR: https://github.com/postmanlabs/postman-app-support/issues/4193#issuecomment-626699439 (#697)\r","\r","const echoPostRequest = {\r","  url: pm.collectionVariables.get(\"protocol\") + \"://\" + pm.collectionVariables.get(\"host\") + \":\" + pm.collectionVariables.get(\"port\") + \"/api/v2/authenticate\",\r","  method: 'POST',\r","  header: {\r","    'Content-Type': 'application/json',\r","    'Accept': '*/*',\r","    'Connection': 'keep-alive',\r","    'x-api-key': pm.collectionVariables.get(\"x-api-key\"),\r","    'Content-Type': 'application/json; charset=utf-8'\r","  }\r","};\r","\r","if(pm.collectionVariables.get(\"throughGw\") == \"true\") {\r","    pm.sendRequest(echoPostRequest, function (err, res) {\r","    console.log(err ? err : res.json());\r","    if(err === null) {\r","      console.info('Refreshing the token')\r","      var responseJson = res.json();\r","      pm.collectionVariables.set('authToken', responseJson.data.token);\r","    }\r","  });\r","}\r",""],"type":"text/javascript"}},{"listen":"test","script":{"id":"5bc621c0-af2a-4435-a8ce-5494b9f87b72","exec":["pm.test(\"post /reset-password is ok\", function () {","    pm.response.to.have.status(200);","    const response = (pm.response.json()).data;","    const { localPassword } = response;","    pm.collectionVariables.set('localPassword',localPassword);","    postman.setNextRequest('create folder');","});"],"type":"text/javascript"}}],"id":"8971e80a-cd22-4836-bf95-c9b10a36565b","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Authorization","value":"Bearer (Automatically filled)","type":"text"},{"key":"x-api-key","value":"(Fill with value in README.md)","type":"text"},{"key":"x-user-key","value":"(Fill with value in README.md)","type":"text"},{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"hpassword\": \"(Fill an encrypted password)\"\n}"},"url":"https://shadline.com:4435/api/v2/authenticate/reset-password","urlObject":{"protocol":"https","port":"4435","path":["api","v2","authenticate","reset-password"],"host":["shadline.com"],"query":[],"variable":[]}},"response":[],"_postman_id":"8971e80a-cd22-4836-bf95-c9b10a36565b"}],"id":"4ba56bc2-565d-46de-a62f-9d1dfeb19bc1","_postman_id":"4ba56bc2-565d-46de-a62f-9d1dfeb19bc1","description":""},{"name":"file","item":[{"name":"upload file","event":[{"listen":"prerequest","script":{"id":"82e5785f-c819-410e-8a68-a57e4649755f","exec":["// TO MONITOR: https://github.com/postmanlabs/postman-app-support/issues/4193#issuecomment-626699439 (#697)","","const echoPostRequest = {","  url: pm.collectionVariables.get(\"protocol\") + \"://\" + pm.collectionVariables.get(\"host\") + \":\" + pm.collectionVariables.get(\"port\") + \"/api/v2/authenticate\",","  method: 'POST',","  header: {","    'Content-Type': 'application/json',","    'Accept': '*/*',","    'Connection': 'keep-alive',","    'x-api-key': pm.collectionVariables.get(\"x-api-key\"),","    'Content-Type': 'application/json; charset=utf-8'","  }","};","","if(pm.collectionVariables.get(\"throughGw\") == \"true\") {","    pm.sendRequest(echoPostRequest, function (err, res) {","    console.log(err ? err : res.json());","    if(err === null) {","      console.info('Refreshing the token')","      var responseJson = res.json();","      pm.collectionVariables.set('authToken', responseJson.data.token)","    }","  });","}",""],"type":"text/javascript"}},{"listen":"test","script":{"id":"3519ef37-4d33-423a-a469-c3f73d7a4e83","exec":["const response = (pm.response.json()).data;","const { fullPath, id, name, parent, url, user } = response;","","const expectedName = pm.collectionVariables.get('fileName');","const experctedParent = null;","const expectedOwner = pm.collectionVariables.get('x-user-key');","const expectedPath = `/${expectedName}`;","const expectedStatusCode = 201;","const expectedUrl = {","    get: `/storage/${id}/metadata`","};","","pm.test(`status code is ${expectedStatusCode}`, () => {","    pm.response.to.have.status(expectedStatusCode);","","    pm.test(\"file name is correct\", () => {","        pm.expect(name).equal(expectedName);","    });","","    pm.test('file parent is corerct', () => {","        pm.expect(parent).equal(experctedParent);","    });","","    pm.test(\"file is attached to the correct owner\", () => {","        pm.expect(user.id).equal(expectedOwner);","    });","","    pm.test(\"file path is correct\", () => {","        pm.expect(fullPath).equal(expectedPath);","    });","","    pm.test(\"file get url is correct\", () => {","        pm.expect(url.get).equal(expectedUrl.get);","    });","","    pm.collectionVariables.set('fileUuid', id);","    postman.setNextRequest('list files');","});",""],"type":"text/javascript"}}],"id":"eb7b35ce-e072-415f-ac2a-fc40c7ed850a","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Authorization","value":"Bearer (Automatically filled)","type":"text"},{"key":"x-api-key","value":"(Fill with value in README.md)","type":"text"},{"key":"x-user-key","value":"(Fill with value in README.md)","type":"text"},{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"formdata","formdata":[{"key":"name","value":"fileName.test","type":"text"},{"key":"localPassword","value":"(Automatically filled when authenticate request is call)","type":"text"},{"key":"data","type":"file","src":"shadline-logo.png"},{"key":"expireAt","value":"2021-10-02","type":"text","disabled":true},{"key":"parentId","value":"(Last folder created id)","type":"text","disabled":true}]},"url":"https://shadline.com:4435/api/v2/storage/upload","urlObject":{"protocol":"https","port":"4435","path":["api","v2","storage","upload"],"host":["shadline.com"],"query":[],"variable":[]}},"response":[],"_postman_id":"eb7b35ce-e072-415f-ac2a-fc40c7ed850a"},{"name":"update file","event":[{"listen":"prerequest","script":{"id":"c7a820f8-41c7-4af6-86e4-fa2f3932da15","exec":["// TO MONITOR: https://github.com/postmanlabs/postman-app-support/issues/4193#issuecomment-626699439 (#697)\r","\r","const echoPostRequest = {\r","  url: pm.collectionVariables.get(\"protocol\") + \"://\" + pm.collectionVariables.get(\"host\") + \":\" + pm.collectionVariables.get(\"port\") + \"/api/v2/authenticate\",\r","  method: 'POST',\r","  header: {\r","    'Content-Type': 'application/json',\r","    'Accept': '*/*',\r","    'Connection': 'keep-alive',\r","    'x-api-key': pm.collectionVariables.get(\"x-api-key\"),\r","    'Content-Type': 'application/json; charset=utf-8'\r","  }\r","};\r","\r","if(pm.collectionVariables.get(\"throughGw\") == \"true\") {\r","    pm.sendRequest(echoPostRequest, function (err, res) {\r","    console.log(err ? err : res.json());\r","    if(err === null) {\r","      console.info('Refreshing the token')\r","      var responseJson = res.json();\r","      pm.collectionVariables.set('authToken', responseJson.data.token)\r","    }\r","  });\r","}\r",""],"type":"text/javascript"}},{"listen":"test","script":{"id":"349abf67-3044-41e6-b251-e67265e34b79","exec":["const response = (pm.response.json()).data;","const { expireAt, fullPath, id, name, parent, url, user } = response;","","const expectedExpireAt = `${pm.collectionVariables.get('fileExpireAt')}.000Z`;","const expectedId = pm.collectionVariables.get('fileUuid');","const expectedName = pm.collectionVariables.get('fileUpdatedName');","const experctedParent = pm.collectionVariables.get('folderUuid');","const expectedOwner = pm.collectionVariables.get('x-user-key');","const expectedPath = `/${pm.collectionVariables.get('folderUpdatedName')}/${expectedName}`;","const expectedStatusCode = 200;","const expectedUrl = {","    get: `/storage/${id}/metadata`","};","","pm.test(`status code is ${expectedStatusCode}`, () => {","    pm.response.to.have.status(expectedStatusCode);","","    pm.test(\"file name is correctly updated\", () => {","        pm.expect(name).equal(expectedName);","    });","","    pm.test('file parent is corerctly updated', () => {","        pm.expect(parent.id).equal(experctedParent);","    });","","    pm.test('file expireAt is corerctly updated', () => {","        pm.expect(expireAt).equal(expectedExpireAt);","    });","","    pm.test(\"file path is correctly updated\", () => {","        pm.expect(fullPath).equal(expectedPath);","    });","","    pm.test(\"update doesn't affect file id\", () => {","        pm.expect(id).equal(expectedId);","    });","","    pm.test(\"update doesn't affect file owner\", () => {","        pm.expect(user.id).equal(expectedOwner);","    });","","    pm.test(\"update doesn't affect file get url\", () => {","        pm.expect(url.get).equal(expectedUrl.get);","    });","","    postman.setNextRequest('download file');","});",""],"type":"text/javascript"}}],"id":"d2b452c0-3ae4-4496-b771-2d1acaf82004","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[{"key":"Authorization","value":"Bearer (Automatically filled)","type":"text"},{"key":"x-api-key","value":"(Fill with value in README.md)","type":"text"},{"key":"x-user-key","type":"text","value":"(Fill with value in README.md)"},{"key":"Content-Type","name":"Content-Type","value":"application/x-www-form-urlencoded","type":"text"}],"body":{"mode":"urlencoded","urlencoded":[{"key":"expireAt","value":"2030-11-02T10:00:00","type":"text"},{"key":"parentId","value":"(Last folder created id)","type":"text"},{"key":"name","value":"fileUpdatedName.test","type":"text"}]},"url":"https://shadline.com:4435/api/v2/storage/(Last file uploaded id)/metadata","urlObject":{"protocol":"https","port":"4435","path":["api","v2","storage","(Last file uploaded id)","metadata"],"host":["shadline.com"],"query":[],"variable":[]}},"response":[],"_postman_id":"d2b452c0-3ae4-4496-b771-2d1acaf82004"},{"name":"download file","event":[{"listen":"prerequest","script":{"id":"b3de2ae4-47f4-4449-9c55-d546dd3b5752","exec":["// TO MONITOR: https://github.com/postmanlabs/postman-app-support/issues/4193#issuecomment-626699439 (#697)\r","\r","const echoPostRequest = {\r","  url: pm.collectionVariables.get(\"protocol\") + \"://\" + pm.collectionVariables.get(\"host\") + \":\" + pm.collectionVariables.get(\"port\") + \"/api/v2/authenticate\",\r","  method: 'POST',\r","  header: {\r","    'Content-Type': 'application/json',\r","    'Accept': '*/*',\r","    'Connection': 'keep-alive',\r","    'x-api-key': pm.collectionVariables.get(\"x-api-key\"),\r","    'Content-Type': 'application/json; charset=utf-8'\r","  }\r","};\r","\r","if(pm.collectionVariables.get(\"throughGw\") == \"true\") {\r","    pm.sendRequest(echoPostRequest, function (err, res) {\r","    console.log(err ? err : res.json());\r","    if(err === null) {\r","      console.info('Refreshing the token')\r","      var responseJson = res.json();\r","      pm.collectionVariables.set('authToken', responseJson.data.token)\r","    }\r","  });\r","}\r",""],"type":"text/javascript"}},{"listen":"test","script":{"id":"c3c35f40-9338-48b9-a73c-c80c587d154f","exec":["const expectedStatusCode = 200;","const expectedFileName = pm.collectionVariables.get('fileUpdatedName');","const expectedContent = `filename=\"${expectedFileName}\"`;","","pm.test(`status code is ${expectedStatusCode}`, () => {","    pm.response.to.have.status(expectedStatusCode);","","    pm.test('download content is correct', () => {","        pm.expect(pm.response.headers.get('content-disposition')).to.include(expectedContent);","    });","    ","    postman.setNextRequest('get folder');","});"],"type":"text/javascript"}}],"id":"a4e6adba-2ce5-41ea-83a8-7421dd2f35f0","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","value":"Bearer (Automatically filled)","type":"text"},{"key":"x-api-key","value":"(Fill with value in README.md)","type":"text"},{"key":"x-user-key","value":"(Fill with value in README.md)","type":"text"},{"key":"Content-Type","name":"Content-Type","value":"application/x-www-form-urlencoded","type":"text"}],"body":{"mode":"urlencoded","urlencoded":[{"key":"localPassword","value":"(Automatically filled when authenticate request is call)","type":"text"}]},"url":"https://shadline.com:4435/api/v2/storage/download/(Last file uploaded id)","urlObject":{"protocol":"https","port":"4435","path":["api","v2","storage","download","(Last file uploaded id)"],"host":["shadline.com"],"query":[],"variable":[]}},"response":[],"_postman_id":"a4e6adba-2ce5-41ea-83a8-7421dd2f35f0"},{"name":"download multiple files","event":[{"listen":"prerequest","script":{"id":"b9142f42-b9ba-4da6-9d08-58aa649ec50a","exec":["// TO MONITOR: https://github.com/postmanlabs/postman-app-support/issues/4193#issuecomment-626699439 (#697)\r","\r","const echoPostRequest = {\r","  url: pm.collectionVariables.get(\"protocol\") + \"://\" + pm.collectionVariables.get(\"host\") + \":\" + pm.collectionVariables.get(\"port\") + \"/api/v2/authenticate\",\r","  method: 'POST',\r","  header: {\r","    'Content-Type': 'application/json',\r","    'Accept': '*/*',\r","    'Connection': 'keep-alive',\r","    'x-api-key': pm.collectionVariables.get(\"x-api-key\"),\r","    'Content-Type': 'application/json; charset=utf-8'\r","  }\r","};\r","\r","if(pm.collectionVariables.get(\"throughGw\") == \"true\") {\r","    pm.sendRequest(echoPostRequest, function (err, res) {\r","    console.log(err ? err : res.json());\r","    if(err === null) {\r","      console.info('Refreshing the token')\r","      var responseJson = res.json();\r","      pm.collectionVariables.set('authToken', responseJson.data.token)\r","    }\r","  });\r","}\r",""],"type":"text/javascript"}}],"id":"ce05d7a3-3561-411a-8be7-ff0c6feff581","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","type":"text","value":"Bearer (Automatically filled)"},{"key":"x-api-key","type":"text","value":"(Fill with value in README.md)"},{"key":"x-user-key","type":"text","value":"(Fill with value in README.md)"},{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"localPassword\": \"(Automatically filled when authenticate request is call)\",\n\t\"references\": [\"(Last file uploaded id)\"]\n}"},"url":"https://shadline.com:4435/api/v2/storage/download","urlObject":{"protocol":"https","port":"4435","path":["api","v2","storage","download"],"host":["shadline.com"],"query":[],"variable":[]}},"response":[],"_postman_id":"ce05d7a3-3561-411a-8be7-ff0c6feff581"},{"name":"delete multiple files","event":[{"listen":"prerequest","script":{"id":"1ba1f6a4-6d64-4d8d-b4c9-7672716f95e9","exec":["// TO MONITOR: https://github.com/postmanlabs/postman-app-support/issues/4193#issuecomment-626699439 (#697)\r","\r","const echoPostRequest = {\r","  url: pm.collectionVariables.get(\"protocol\") + \"://\" + pm.collectionVariables.get(\"host\") + \":\" + pm.collectionVariables.get(\"port\") + \"/api/v2/authenticate\",\r","  method: 'POST',\r","  header: {\r","    'Content-Type': 'application/json',\r","    'Accept': '*/*',\r","    'Connection': 'keep-alive',\r","    'x-api-key': pm.collectionVariables.get(\"x-api-key\"),\r","    'Content-Type': 'application/json; charset=utf-8'\r","  }\r","};\r","\r","if(pm.collectionVariables.get(\"throughGw\") == \"true\") {\r","    pm.sendRequest(echoPostRequest, function (err, res) {\r","    console.log(err ? err : res.json());\r","    if(err === null) {\r","      console.info('Refreshing the token')\r","      var responseJson = res.json();\r","      pm.collectionVariables.set('authToken', responseJson.data.token)\r","    }\r","  });\r","}\r",""],"type":"text/javascript"}}],"id":"a42d5fdc-9f7d-4796-bcf1-4c968e08f49b","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Authorization","type":"text","value":"Bearer (Automatically filled)"},{"key":"x-api-key","type":"text","value":"(Fill with value in README.md)"},{"key":"x-user-key","type":"text","value":"(Fill with value in README.md)"},{"key":"Content-Type","name":"Content-Type","type":"text","value":"application/json"}],"body":{"mode":"raw","raw":"{\n\t\"localPassword\": \"(Automatically filled when authenticate request is call)\",\n\t\"references\": [\"{{file_uuid}}\"]\n}"},"url":"https://shadline.com:4435/api/v2/storage/delete","urlObject":{"protocol":"https","port":"4435","path":["api","v2","storage","delete"],"host":["shadline.com"],"query":[],"variable":[]}},"response":[],"_postman_id":"a42d5fdc-9f7d-4796-bcf1-4c968e08f49b"},{"name":"delete file","event":[{"listen":"prerequest","script":{"id":"85a5a6fa-eea5-4d14-93f4-501b0e38192e","exec":["// TO MONITOR: https://github.com/postmanlabs/postman-app-support/issues/4193#issuecomment-626699439 (#697)\r","\r","const echoPostRequest = {\r","  url: pm.collectionVariables.get(\"protocol\") + \"://\" + pm.collectionVariables.get(\"host\") + \":\" + pm.collectionVariables.get(\"port\") + \"/api/v2/authenticate\",\r","  method: 'POST',\r","  header: {\r","    'Content-Type': 'application/json',\r","    'Accept': '*/*',\r","    'Connection': 'keep-alive',\r","    'x-api-key': pm.collectionVariables.get(\"x-api-key\"),\r","    'Content-Type': 'application/json; charset=utf-8'\r","  }\r","};\r","\r","if(pm.collectionVariables.get(\"throughGw\") == \"true\") {\r","    pm.sendRequest(echoPostRequest, function (err, res) {\r","    console.log(err ? err : res.json());\r","    if(err === null) {\r","      console.info('Refreshing the token')\r","      var responseJson = res.json();\r","      pm.collectionVariables.set('authToken', responseJson.data.token)\r","    }\r","  });\r","}\r",""],"type":"text/javascript"}},{"listen":"test","script":{"id":"4839672e-1b5d-4da2-a0fe-696bf1586e33","exec":["const expectedStatusCode = 404;","","pm.test(`status code is ${expectedStatusCode}`, () => {","    // Since we have just deleted the parent folder of the file, the file is already deleted, so the status should be 'NOT FOUND'","    pm.response.to.have.status(expectedStatusCode);","    postman.setNextRequest('list folders and files');","});",""],"type":"text/javascript"}}],"id":"4989fb6e-360b-4764-8a68-1a4df202d8ff","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[{"key":"Authorization","value":"Bearer (Automatically filled)","type":"text"},{"key":"x-api-key","value":"(Fill with value in README.md)","type":"text"},{"key":"x-user-key","value":"(Fill with value in README.md)","type":"text"},{"key":"Content-Type","name":"Content-Type","value":"application/x-www-form-urlencoded","type":"text"}],"body":{"mode":"urlencoded","urlencoded":[{"key":"localPassword","value":"(Automatically filled when authenticate request is call)","type":"text"}]},"url":"https://shadline.com:4435/api/v2/storage/(Last file uploaded id)","urlObject":{"protocol":"https","port":"4435","path":["api","v2","storage","(Last file uploaded id)"],"host":["shadline.com"],"query":[],"variable":[]}},"response":[],"_postman_id":"4989fb6e-360b-4764-8a68-1a4df202d8ff"},{"name":"list files","event":[{"listen":"prerequest","script":{"id":"15e359c7-7575-4509-af0d-356e651ab7b2","exec":["// TO MONITOR: https://github.com/postmanlabs/postman-app-support/issues/4193#issuecomment-626699439 (#697)\r","\r","const echoPostRequest = {\r","  url: pm.collectionVariables.get(\"protocol\") + \"://\" + pm.collectionVariables.get(\"host\") + \":\" + pm.collectionVariables.get(\"port\") + \"/api/v2/authenticate\",\r","  method: 'POST',\r","  header: {\r","    'Content-Type': 'application/json',\r","    'Accept': '*/*',\r","    'Connection': 'keep-alive',\r","    'x-api-key': pm.collectionVariables.get(\"x-api-key\"),\r","    'Content-Type': 'application/json; charset=utf-8'\r","  }\r","};\r","\r","if(pm.collectionVariables.get(\"throughGw\") == \"true\") {\r","    pm.sendRequest(echoPostRequest, function (err, res) {\r","    console.log(err ? err : res.json());\r","    if(err === null) {\r","      console.info('Refreshing the token')\r","      var responseJson = res.json();\r","      pm.collectionVariables.set('authToken', responseJson.data.token)\r","    }\r","  });\r","}\r",""],"type":"text/javascript"}},{"listen":"test","script":{"id":"516ce18e-93ae-4e9f-bd96-2c919fd703fb","exec":["const response = (pm.response.json()).data;","const { rows, total } = response;","const [row1, row2] = rows;","","const expectedChildCounts = 0;","const expectedFileId = pm.collectionVariables.get('fileUuid');","const expectedFileName = pm.collectionVariables.get('fileName');","const expectedFilePath = `/${expectedFileName}`;","const expectedFilePreview = true;","const expectedFileStatus = 'READY';","const expectedFileUrl = {","    get: `/storage/${row2.id}/metadata`","};","const expectedFolderId = pm.collectionVariables.get('folderUuid');","const expectedFolderName = pm.collectionVariables.get('folderUpdatedName');","const expectedFolderPath = `/${expectedFolderName}`;","const expectedFolderType = 'folder';","const expectedFolderUrl = {","    get: `/storage/${row1.id}/metadata`,","    list: `/storage/${row1.id}`","};","const expectedParent = null;","const expectedOwner = pm.collectionVariables.get('x-user-key');","const expectedStatusCode = 200;","const expectedTotal = 2;","","pm.test(`status code is ${expectedStatusCode}`, () => {","    pm.response.to.have.status(expectedStatusCode);","","    // At this point there should be a folder and a file at the root of the container","","    // Folder test","    pm.test(\"folder id is correct\", () => {","        pm.expect(row1.id).equal(expectedFolderId);","    });","","    pm.test(\"folder name is correct\", () => {","        pm.expect(row1.name).equal(expectedFolderName);","    });","","    pm.test(\"folder type is correct\", () => {","        pm.expect(row1.type).to.include(expectedFolderType);","    });","","    pm.test(\"folder path is correct\", () => {","        pm.expect(row1.fullPath).equal(expectedFolderPath);","    });","","    pm.test(\"folder get url is correct\", () => {","        pm.expect(row1.url.get).equal(expectedFolderUrl.get);","    });","","    pm.test(\"folder list url is correct\", () => {","        pm.expect(row1.url.list).equal(expectedFolderUrl.list);","    });","","    pm.test(\"folder childCounts are correct\", () => {","        const { childCounts } = row1;","        for (key in childCounts) {","            pm.expect(childCounts[key]).equal(expectedChildCounts);","        }","    });","","    pm.test(\"folder owner is correct\", () => {","        pm.expect(row1.user.id).equal(expectedOwner);","    });","","    pm.test(\"folder parent is correct\", () => {","        pm.expect(row1.parent).equal(expectedParent);","    });","","    //////","","    // File test","    pm.test(\"file id is correct\", () => {","        pm.expect(row2.id).equal(expectedFileId);","    });","","    pm.test(\"file name is correct\", () => {","        pm.expect(row2.name).equal(expectedFileName);","    });","","    pm.test(\"file type is correct\", () => {","        pm.expect(row2.type).to.not.include(expectedFolderType);","    });","","    pm.test(\"file path is correct\", () => {","        pm.expect(row2.fullPath).equal(expectedFilePath);","    });","","    pm.test(\"file get url is correct\", () => {","        pm.expect(row2.url.get).equal(expectedFileUrl.get);","    });","","    pm.test(\"file owner is correct\", () => {","        pm.expect(row2.user.id).equal(expectedOwner);","    });","","    pm.test(\"file parent is correct\", () => {","        pm.expect(row2.parent).equal(expectedParent);","    });","","    pm.test(\"file status is correct\", () => {","        pm.expect(row2.status).equal(expectedFileStatus);","    });","","    pm.test(\"file is previewable\", () => {","        pm.expect(row2.isPreviewable).equal(expectedFilePreview);","    });","","    //////","","    // General test","    pm.test('total is correct', () => {","        pm.expect(total).equal(expectedTotal);","    });","    ","    postman.setNextRequest('update file');","});",""],"type":"text/javascript"}}],"id":"a2a2e942-d23a-4be5-916b-615e1b635d4f","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","value":"Bearer (Automatically filled)","type":"text"},{"key":"x-api-key","value":"(Fill with value in README.md)","type":"text"},{"key":"x-user-key","value":"(Fill with value in README.md)","type":"text"}],"body":{"mode":"raw","raw":""},"url":"https://shadline.com:4435/api/v2/storage","urlObject":{"protocol":"https","port":"4435","path":["api","v2","storage"],"host":["shadline.com"],"query":[],"variable":[]}},"response":[],"_postman_id":"a2a2e942-d23a-4be5-916b-615e1b635d4f"},{"name":"get stored file metadata","event":[{"listen":"prerequest","script":{"id":"986703f2-ed4a-419d-a2b1-b1aa001fb179","exec":["// TO MONITOR: https://github.com/postmanlabs/postman-app-support/issues/4193#issuecomment-626699439 (#697)\r","\r","const echoPostRequest = {\r","  url: pm.collectionVariables.get(\"protocol\") + \"://\" + pm.collectionVariables.get(\"host\") + \":\" + pm.collectionVariables.get(\"port\") + \"/api/v2/authenticate\",\r","  method: 'POST',\r","  header: {\r","    'Content-Type': 'application/json',\r","    'Accept': '*/*',\r","    'Connection': 'keep-alive',\r","    'x-api-key': pm.collectionVariables.get(\"x-api-key\"),\r","    'Content-Type': 'application/json; charset=utf-8'\r","  }\r","};\r","\r","if(pm.collectionVariables.get(\"throughGw\") == \"true\") {\r","    pm.sendRequest(echoPostRequest, function (err, res) {\r","    console.log(err ? err : res.json());\r","    if(err === null) {\r","      console.info('Refreshing the token')\r","      var responseJson = res.json();\r","      pm.collectionVariables.set('authToken', responseJson.data.token)\r","    }\r","  });\r","}\r",""],"type":"text/javascript"}},{"listen":"test","script":{"id":"3f566827-de26-46aa-bda2-eec61744c8ec","exec":["pm.test(\"get /metadata is ok\", function () {","    pm.response.to.have.status(200);","});"],"type":"text/javascript"}}],"id":"92df4719-7501-4120-accc-1346075dac43","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","value":"Bearer (Automatically filled)","type":"text"},{"key":"x-api-key","value":"(Fill with value in README.md)","type":"text"},{"key":"x-user-key","type":"text","value":"(Fill with value in README.md)"}],"url":"https://shadline.com:4435/api/v2/storage/(Last file uploaded id)","urlObject":{"protocol":"https","port":"4435","path":["api","v2","storage","(Last file uploaded id)"],"host":["shadline.com"],"query":[],"variable":[]}},"response":[],"_postman_id":"92df4719-7501-4120-accc-1346075dac43"}],"id":"d50af4dd-e26a-4da1-af3a-15ae8e780eff","_postman_id":"d50af4dd-e26a-4da1-af3a-15ae8e780eff","description":""},{"name":"folder","item":[{"name":"create folder","event":[{"listen":"prerequest","script":{"id":"d2422e6d-bb8d-4a19-987c-0616b7412e3a","exec":["// TO MONITOR: https://github.com/postmanlabs/postman-app-support/issues/4193#issuecomment-626699439 (#697)\r","\r","const echoPostRequest = {\r","  url: pm.collectionVariables.get(\"protocol\") + \"://\" + pm.collectionVariables.get(\"host\") + \":\" + pm.collectionVariables.get(\"port\") + \"/api/v2/authenticate\",\r","  method: 'POST',\r","  header: {\r","    'Content-Type': 'application/json',\r","    'Accept': '*/*',\r","    'Connection': 'keep-alive',\r","    'x-api-key': pm.collectionVariables.get(\"x-api-key\"),\r","    'Content-Type': 'application/json; charset=utf-8'\r","  }\r","};\r","\r","if(pm.collectionVariables.get(\"throughGw\") == \"true\") {\r","    pm.sendRequest(echoPostRequest, function (err, res) {\r","    console.log(err ? err : res.json());\r","    if(err === null) {\r","      console.info('Refreshing the token')\r","      var responseJson = res.json();\r","      pm.collectionVariables.set('authToken', responseJson.data.token)\r","    }\r","  });\r","}\r",""],"type":"text/javascript"}},{"listen":"test","script":{"id":"b6fa59af-7eb8-4240-844b-9e5fe7ea7786","exec":["const response = (pm.response.json()).data;","const { fullPath, id, name, url, user } = response;","","const expectedName = pm.collectionVariables.get('folderName');","const expectedOwner = pm.collectionVariables.get('x-user-key');","const expectedPath = `/${expectedName}`;","const expectedStatusCode = 201;","const expectedUrl = {","    get: `/storage/${id}/metadata`,","    list: `/storage/${id}`","};","","pm.test(`status code is ${expectedStatusCode}`, () => {","    pm.response.to.have.status(expectedStatusCode);","","    pm.test(\"folder name is correct\", () => {","        pm.expect(name).equal(expectedName);","    });","","    pm.test(\"folder is attached to the correct owner\", () => {","        pm.expect(user.id).equal(expectedOwner);","    });","","    pm.test(\"folder path is correct\", () => {","        pm.expect(fullPath).equal(expectedPath);","    });","","    pm.test(\"folder get url is correct\", () => {","        pm.expect(url.get).equal(expectedUrl.get);","    });","","    pm.test(\"folder list url is correct\", () => {","        pm.expect(url.list).equal(expectedUrl.list);","    });","","    pm.collectionVariables.set('folderUuid', id);","    postman.setNextRequest('update folder');","});",""],"type":"text/javascript"}}],"id":"0391fbce-8c74-4c9f-8e31-359207e00d04","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Authorization","type":"text","value":"Bearer (Automatically filled)"},{"key":"x-api-key","type":"text","value":"(Fill with value in README.md)"},{"key":"x-user-key","type":"text","value":"(Fill with value in README.md)"},{"key":"Content-Type","name":"Content-Type","value":"application/x-www-form-urlencoded","type":"text"}],"body":{"mode":"urlencoded","urlencoded":[{"key":"name","value":"folderName","type":"text"}]},"url":"https://shadline.com:4435/api/v2/storage/items/folders","urlObject":{"protocol":"https","port":"4435","path":["api","v2","storage","items","folders"],"host":["shadline.com"],"query":[],"variable":[]}},"response":[],"_postman_id":"0391fbce-8c74-4c9f-8e31-359207e00d04"},{"name":"delete folder","event":[{"listen":"prerequest","script":{"id":"7da28555-b3e7-47f9-9f07-80ba89e38908","exec":["// TO MONITOR: https://github.com/postmanlabs/postman-app-support/issues/4193#issuecomment-626699439 (#697)\r","\r","const echoPostRequest = {\r","  url: pm.collectionVariables.get(\"protocol\") + \"://\" + pm.collectionVariables.get(\"host\") + \":\" + pm.collectionVariables.get(\"port\") + \"/api/v2/authenticate\",\r","  method: 'POST',\r","  header: {\r","    'Content-Type': 'application/json',\r","    'Accept': '*/*',\r","    'Connection': 'keep-alive',\r","    'x-api-key': pm.collectionVariables.get(\"x-api-key\"),\r","    'Content-Type': 'application/json; charset=utf-8'\r","  }\r","};\r","\r","if(pm.collectionVariables.get(\"throughGw\") == \"true\") {\r","    pm.sendRequest(echoPostRequest, function (err, res) {\r","    console.log(err ? err : res.json());\r","    if(err === null) {\r","      console.info('Refreshing the token')\r","      var responseJson = res.json();\r","      pm.collectionVariables.set('authToken', responseJson.data.token)\r","    }\r","  });\r","}\r",""],"type":"text/javascript"}},{"listen":"test","script":{"id":"4f8ffc2c-8c29-4fad-a725-fe086a974cf8","exec":["const expectedStatusCode = 200;","","pm.test(`status code is ${expectedStatusCode}`, () => {","    pm.response.to.have.status(200);","    postman.setNextRequest('delete file');","});"],"type":"text/javascript"}}],"id":"01bd54b2-cccd-4866-9df7-5fcc61f82632","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[{"key":"Authorization","type":"text","value":"Bearer (Automatically filled)"},{"key":"x-api-key","type":"text","value":"(Fill with value in README.md)"},{"key":"x-user-key","type":"text","value":"(Fill with value in README.md)"},{"key":"Content-Type","name":"Content-Type","type":"text","value":"application/x-www-form-urlencoded"}],"body":{"mode":"urlencoded","urlencoded":[{"key":"localPassword","value":"(Automatically filled when authenticate request is call)","type":"text"}]},"url":"https://shadline.com:4435/api/v2/storage/(Last folder created id)","urlObject":{"protocol":"https","port":"4435","path":["api","v2","storage","(Last folder created id)"],"host":["shadline.com"],"query":[],"variable":[]}},"response":[],"_postman_id":"01bd54b2-cccd-4866-9df7-5fcc61f82632"},{"name":"update folder","event":[{"listen":"prerequest","script":{"id":"dffadbcd-b19c-4bf3-9614-368c1bf7a125","exec":["// TO MONITOR: https://github.com/postmanlabs/postman-app-support/issues/4193#issuecomment-626699439 (#697)\r","\r","const echoPostRequest = {\r","  url: pm.collectionVariables.get(\"protocol\") + \"://\" + pm.collectionVariables.get(\"host\") + \":\" + pm.collectionVariables.get(\"port\") + \"/api/v2/authenticate\",\r","  method: 'POST',\r","  header: {\r","    'Content-Type': 'application/json',\r","    'Accept': '*/*',\r","    'Connection': 'keep-alive',\r","    'x-api-key': pm.collectionVariables.get(\"x-api-key\"),\r","    'Content-Type': 'application/json; charset=utf-8'\r","  }\r","};\r","\r","if(pm.collectionVariables.get(\"throughGw\") == \"true\") {\r","    pm.sendRequest(echoPostRequest, function (err, res) {\r","    console.log(err ? err : res.json());\r","    if(err === null) {\r","      console.info('Refreshing the token')\r","      var responseJson = res.json();\r","      pm.collectionVariables.set('authToken', responseJson.data.token)\r","    }\r","  });\r","}\r",""],"type":"text/javascript"}},{"listen":"test","script":{"id":"116f47df-9227-430a-9232-76877ec026ff","exec":["const response = (pm.response.json()).data;","const { fullPath, id, name, url, user } = response;","","const expectedId = pm.collectionVariables.get('folderUuid');","const expectedName = pm.collectionVariables.get('folderUpdatedName');","const expectedOwner = pm.collectionVariables.get('x-user-key');","const expectedPath = `/${expectedName}`;","const expectedStatusCode = 200;","const expectedUrl = {","    get: `/storage/${id}/metadata`,","    list: `/storage/${id}`","};","","pm.test(`status code is ${expectedStatusCode}`, () => {","    pm.response.to.have.status(expectedStatusCode);","","    pm.test(\"name update is correctly done\", () => {","        pm.expect(name).equal(expectedName);","    });","","    pm.test(\"update doesn't affect folder owner\", () => {","        pm.expect(user.id).equal(expectedOwner);","    });","","    pm.test(\"update doesn't affect folder id\", () => {","        pm.expect(id).equal(expectedId);    ","    });","","    pm.test(\"update doesn't affect folder path\", () => {","        pm.expect(fullPath).equal(expectedPath);    ","    });","","    pm.test(\"update doesn't affect folder get url\", () => {","        pm.expect(url.get).equal(expectedUrl.get);    ","    });","","    pm.test(\"update doesn't affect folder list url\", () => {","        pm.expect(url.list).equal(expectedUrl.list);    ","    });","","    postman.setNextRequest('upload file');","});",""],"type":"text/javascript"}}],"id":"abce2bad-26d1-4a5f-afab-22bdfb0e45ab","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[{"key":"Authorization","type":"text","value":"Bearer (Automatically filled)"},{"key":"x-api-key","type":"text","value":"(Fill with value in README.md)"},{"key":"x-user-key","type":"text","value":"(Fill with value in README.md)"},{"key":"Content-Type","name":"Content-Type","type":"text","value":"application/x-www-form-urlencoded"}],"body":{"mode":"urlencoded","urlencoded":[{"key":"name","type":"text","value":"folderUpdatedName"},{"key":"parentId","type":"text","value":"(Last folder created id)","disabled":true}]},"url":"https://shadline.com:4435/api/v2/storage/(Last folder created id)","urlObject":{"protocol":"https","port":"4435","path":["api","v2","storage","(Last folder created id)"],"host":["shadline.com"],"query":[],"variable":[]}},"response":[],"_postman_id":"abce2bad-26d1-4a5f-afab-22bdfb0e45ab"},{"name":"get folder","event":[{"listen":"prerequest","script":{"id":"beba2198-e9f7-4e24-b4ad-0bed7c002c34","exec":["// TO MONITOR: https://github.com/postmanlabs/postman-app-support/issues/4193#issuecomment-626699439 (#697)\r","\r","const echoPostRequest = {\r","  url: pm.collectionVariables.get(\"protocol\") + \"://\" + pm.collectionVariables.get(\"host\") + \":\" + pm.collectionVariables.get(\"port\") + \"/api/v2/authenticate\",\r","  method: 'POST',\r","  header: {\r","    'Content-Type': 'application/json',\r","    'Accept': '*/*',\r","    'Connection': 'keep-alive',\r","    'x-api-key': pm.collectionVariables.get(\"x-api-key\"),\r","    'Content-Type': 'application/json; charset=utf-8'\r","  }\r","};\r","\r","if(pm.collectionVariables.get(\"throughGw\") == \"true\") {\r","    pm.sendRequest(echoPostRequest, function (err, res) {\r","    console.log(err ? err : res.json());\r","    if(err === null) {\r","      console.info('Refreshing the token')\r","      var responseJson = res.json();\r","      pm.collectionVariables.set('authToken', responseJson.data.token)\r","    }\r","  });\r","}\r",""],"type":"text/javascript"}},{"listen":"test","script":{"id":"e1f898eb-e898-4087-a7ed-d46e4b1cd46a","exec":["const response = (pm.response.json()).data;","const { rows, total } = response;","const [row] = rows;","","const expectedChildCounts = 0;","const expectedFileId = pm.collectionVariables.get('fileUuid');","const expectedFileName = pm.collectionVariables.get('fileUpdatedName');","const expectedFilePath = `/${pm.collectionVariables.get('folderUpdatedName')}/${expectedFileName}`;","const expectedFilePreview = true;","const expectedFileStatus = 'READY';","const expectedFileUrl = {","    get: `/storage/${row.id}/metadata`","};","const experctedParent = pm.collectionVariables.get('folderUuid');","const expectedOwner = pm.collectionVariables.get('x-user-key');","const expectedStatusCode = 200;","const expectedTotal = 1;","","pm.test(`status code is ${expectedStatusCode}`, () => {","    pm.response.to.have.status(expectedStatusCode);","","    // At this point there should be a file in the folder previously created","","    pm.test(\"file id is correct\", () => {","        pm.expect(row.id).equal(expectedFileId);","    });","","    pm.test(\"file name is correct\", () => {","        pm.expect(row.name).equal(expectedFileName);","    });","","    pm.test(\"file path is correct\", () => {","        pm.expect(row.fullPath).equal(expectedFilePath);","    });","","    pm.test(\"file get url is correct\", () => {","        pm.expect(row.url.get).equal(expectedFileUrl.get);","    });","","    pm.test(\"file owner is correct\", () => {","        pm.expect(row.user.id).equal(expectedOwner);","    });","","    pm.test(\"file parent is correct\", () => {","        pm.expect(row.parent.id).equal(experctedParent);","    });","","    pm.test(\"file status is correct\", () => {","        pm.expect(row.status).equal(expectedFileStatus);","    });","","    pm.test(\"file is previewable\", () => {","        pm.expect(row.isPreviewable).equal(expectedFilePreview);","    });","    ","    pm.test('total is correct', () => {","        pm.expect(total).equal(expectedTotal);","    });","    ","    postman.setNextRequest('list folders');","});",""],"type":"text/javascript"}}],"id":"c8a1fc38-7d5a-4c86-97b5-6c06dc40e87d","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","type":"text","value":"Bearer (Automatically filled)"},{"key":"x-api-key","type":"text","value":"(Fill with value in README.md)"},{"key":"x-user-key","type":"text","value":"(Fill with value in README.md)"}],"url":"https://shadline.com:4435/api/v2/storage/(Last folder created id)","urlObject":{"protocol":"https","port":"4435","path":["api","v2","storage","(Last folder created id)"],"host":["shadline.com"],"query":[],"variable":[]}},"response":[],"_postman_id":"c8a1fc38-7d5a-4c86-97b5-6c06dc40e87d"},{"name":"list folders","event":[{"listen":"prerequest","script":{"id":"0170a618-84b4-4a98-86dc-0808b8353883","exec":["// TO MONITOR: https://github.com/postmanlabs/postman-app-support/issues/4193#issuecomment-626699439 (#697)\r","\r","const echoPostRequest = {\r","  url: pm.collectionVariables.get(\"protocol\") + \"://\" + pm.collectionVariables.get(\"host\") + \":\" + pm.collectionVariables.get(\"port\") + \"/api/v2/authenticate\",\r","  method: 'POST',\r","  header: {\r","    'Content-Type': 'application/json',\r","    'Accept': '*/*',\r","    'Connection': 'keep-alive',\r","    'x-api-key': pm.collectionVariables.get(\"x-api-key\"),\r","    'Content-Type': 'application/json; charset=utf-8'\r","  }\r","};\r","\r","if(pm.collectionVariables.get(\"throughGw\") == \"true\") {\r","    pm.sendRequest(echoPostRequest, function (err, res) {\r","    console.log(err ? err : res.json());\r","    if(err === null) {\r","      console.info('Refreshing the token')\r","      var responseJson = res.json();\r","      pm.collectionVariables.set('authToken', responseJson.data.token)\r","    }\r","  });\r","}\r",""],"type":"text/javascript"}},{"listen":"test","script":{"id":"fcae6bf8-152d-4b5f-98c0-b7cdb97c90bd","exec":["const response = (pm.response.json()).data;","const { rows, total } = response;","const [row] = rows;","const { id, name, type, fullPath, url, childCounts, user, parent } = row;","","const expectedChildFilesCount = 1;","const expectedChildFoldersCount = 0;","const expectedFolderId = pm.collectionVariables.get('folderUuid');","const expectedFolderName = pm.collectionVariables.get('folderUpdatedName');","const expectedFolderPath = `/${expectedFolderName}`;","const expectedFolderType = 'folder';","const expectedFolderUrl = {","    get: `/storage/${row.id}/metadata`,","    list: `/storage/${row.id}`","};","const experctedParent = null;","const expectedOwner = pm.collectionVariables.get('x-user-key');","const expectedStatusCode = 200;","const expectedTotal = 1;","","pm.test(`status code is ${expectedStatusCode}`, () => {","    pm.response.to.have.status(expectedStatusCode);","","    // At this point there should be only a folde at the root of the container","","    pm.test(\"folder id is correct\", () => {","        pm.expect(id).equal(expectedFolderId);","    });","","    pm.test(\"folder name is correct\", () => {","        pm.expect(name).equal(expectedFolderName);","    });","","    pm.test(\"folder type is correct\", () => {","        pm.expect(type).to.include(expectedFolderType);","    });","","    pm.test(\"folder path is correct\", () => {","        pm.expect(fullPath).equal(expectedFolderPath);","    });","","    pm.test(\"folder get url is correct\", () => {","        pm.expect(url.get).equal(expectedFolderUrl.get);","    });","","    pm.test(\"folder list url is correct\", () => {","        pm.expect(url.list).equal(expectedFolderUrl.list);","    });","","    pm.test(\"folder childCounts files is correct\", () => {","        pm.expect(childCounts.files).equal(expectedChildFilesCount);","    });","","    pm.test(\"folder childCounts folder is correct\", () => {","        pm.expect(childCounts.folders).equal(expectedChildFoldersCount);","    });","","    pm.test(\"folder owner is correct\", () => {","        pm.expect(user.id).equal(expectedOwner);","    });","","    pm.test(\"folder parent is correct\", () => {","        pm.expect(parent).equal(experctedParent);","    });","","    pm.test('total is correct', () => {","        pm.expect(total).equal(expectedTotal);","    });","    ","    postman.setNextRequest('delete folder');","});",""],"type":"text/javascript"}}],"id":"8466e129-4a35-41f6-8044-530a044bcb19","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","type":"text","value":"Bearer (Automatically filled)"},{"key":"x-api-key","type":"text","value":"(Fill with value in README.md)"},{"key":"x-user-key","type":"text","value":"(Fill with value in README.md)"}],"url":"https://shadline.com:4435/api/v2/storage","urlObject":{"protocol":"https","port":"4435","path":["api","v2","storage"],"host":["shadline.com"],"query":[],"variable":[]}},"response":[],"_postman_id":"8466e129-4a35-41f6-8044-530a044bcb19"},{"name":"list folders and files","event":[{"listen":"prerequest","script":{"id":"564464cd-d0aa-44cd-a45f-cfc3432c5989","exec":["// TO MONITOR: https://github.com/postmanlabs/postman-app-support/issues/4193#issuecomment-626699439 (#697)\r","\r","const echoPostRequest = {\r","  url: pm.collectionVariables.get(\"protocol\") + \"://\" + pm.collectionVariables.get(\"host\") + \":\" + pm.collectionVariables.get(\"port\") + \"/api/v2/authenticate\",\r","  method: 'POST',\r","  header: {\r","    'Content-Type': 'application/json',\r","    'Accept': '*/*',\r","    'Connection': 'keep-alive',\r","    'x-api-key': pm.collectionVariables.get(\"x-api-key\"),\r","    'Content-Type': 'application/json; charset=utf-8'\r","  }\r","};\r","\r","if(pm.collectionVariables.get(\"throughGw\") == \"true\") {\r","    pm.sendRequest(echoPostRequest, function (err, res) {\r","    console.log(err ? err : res.json());\r","    if(err === null) {\r","      console.info('Refreshing the token')\r","      var responseJson = res.json();\r","      pm.collectionVariables.set('authToken', responseJson.data.token)\r","    }\r","  });\r","}\r",""],"type":"text/javascript"}},{"listen":"test","script":{"id":"f6c71868-6cb9-4ac0-b1ee-cab0da68bb38","exec":["const response = (pm.response.json()).data;","const { rows, total } = response;","const expectedStatusCode = 200;","const expectedTotal = 0;","","pm.test(`status code is ${expectedStatusCode}`, () => {","    pm.response.to.have.status(expectedStatusCode);","","    // At this point there root should be empty","","    pm.test(\"rows is empty\", () => {","        pm.expect(rows.length).equal(expectedTotal);","    });","","    pm.test('total is correct', () => {","        pm.expect(total).equal(expectedTotal);","    });","    ","    postman.setNextRequest('get stats');","});",""],"type":"text/javascript"}}],"id":"12e05cfc-e1fe-4545-8e74-1ee6e2c3844a","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","type":"text","value":"Bearer (Automatically filled)"},{"key":"x-api-key","type":"text","value":"(Fill with value in README.md)"},{"key":"x-user-key","type":"text","value":"(Fill with value in README.md)"}],"url":"https://shadline.com:4435/api/v2/storage/","urlObject":{"protocol":"https","port":"4435","path":["api","v2","storage",""],"host":["shadline.com"],"query":[],"variable":[]}},"response":[],"_postman_id":"12e05cfc-e1fe-4545-8e74-1ee6e2c3844a"},{"name":"delete multiple folders","event":[{"listen":"prerequest","script":{"id":"df7c6cdb-d9a0-46ff-b9ba-cfbfd2800c0b","exec":["// TO MONITOR: https://github.com/postmanlabs/postman-app-support/issues/4193#issuecomment-626699439 (#697)\r","\r","const echoPostRequest = {\r","  url: pm.collectionVariables.get(\"protocol\") + \"://\" + pm.collectionVariables.get(\"host\") + \":\" + pm.collectionVariables.get(\"port\") + \"/api/v2/authenticate\",\r","  method: 'POST',\r","  header: {\r","    'Content-Type': 'application/json',\r","    'Accept': '*/*',\r","    'Connection': 'keep-alive',\r","    'x-api-key': pm.collectionVariables.get(\"x-api-key\"),\r","    'Content-Type': 'application/json; charset=utf-8'\r","  }\r","};\r","\r","if(pm.collectionVariables.get(\"throughGw\") == \"true\") {\r","    pm.sendRequest(echoPostRequest, function (err, res) {\r","    console.log(err ? err : res.json());\r","    if(err === null) {\r","      console.info('Refreshing the token')\r","      var responseJson = res.json();\r","      pm.collectionVariables.set('authToken', responseJson.data.token)\r","    }\r","  });\r","}\r",""],"type":"text/javascript"}}],"id":"db30808c-61ce-4528-83e4-803d17d8d615","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[{"key":"Authorization","type":"text","value":"Bearer (Automatically filled)"},{"key":"x-api-key","type":"text","value":"(Fill with value in README.md)"},{"key":"x-user-key","type":"text","value":"(Fill with value in README.md)"},{"key":"Content-Type","name":"Content-Type","type":"text","value":"application/json"}],"body":{"mode":"raw","raw":"{\n\t\"localPassword\": \"(Automatically filled when authenticate request is call)\",\n\t\"references\": [\"(Last folder created id)\"]\n}"},"url":"https://shadline.com:4435/api/v2/storage","urlObject":{"protocol":"https","port":"4435","path":["api","v2","storage"],"host":["shadline.com"],"query":[],"variable":[]}},"response":[],"_postman_id":"db30808c-61ce-4528-83e4-803d17d8d615"}],"id":"68f353a0-a416-4c65-a47d-ac81deb68815","_postman_id":"68f353a0-a416-4c65-a47d-ac81deb68815","description":""},{"name":"user","item":[{"name":"get user","event":[{"listen":"prerequest","script":{"id":"92c0e5a9-ea76-475a-90b2-3104875995a1","exec":["// TO MONITOR: https://github.com/postmanlabs/postman-app-support/issues/4193#issuecomment-626699439 (#697)\r","\r","const echoPostRequest = {\r","  url: pm.collectionVariables.get(\"protocol\") + \"://\" + pm.collectionVariables.get(\"host\") + \":\" + pm.collectionVariables.get(\"port\") + \"/api/v2/authenticate\",\r","  method: 'POST',\r","  header: {\r","    'Content-Type': 'application/json',\r","    'Accept': '*/*',\r","    'Connection': 'keep-alive',\r","    'x-api-key': pm.collectionVariables.get(\"x-api-key\"),\r","    'Content-Type': 'application/json; charset=utf-8'\r","  }\r","};\r","\r","if(pm.collectionVariables.get(\"throughGw\") == \"true\") {\r","    pm.sendRequest(echoPostRequest, function (err, res) {\r","    console.log(err ? err : res.json());\r","    if(err === null) {\r","      console.info('Refreshing the token')\r","      var responseJson = res.json();\r","      pm.collectionVariables.set('authToken', responseJson.data.token)\r","    }\r","  });\r","}\r",""],"type":"text/javascript"}},{"listen":"test","script":{"id":"c25cd3cb-51bb-4659-89db-c8f72b8f0844","exec":["pm.test(\"get /get user is ok\", function () {","    pm.response.to.have.status(200);","});"],"type":"text/javascript"}}],"id":"55b73c55-1bbb-45cc-9940-523b192b654c","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","value":"Bearer (Automatically filled)","type":"text"},{"key":"x-api-key","value":"(Fill with value in README.md)","type":"text"},{"key":"x-user-key","type":"text","value":"(Fill with value in README.md)"}],"url":"https://shadline.com:4435/api/v2/user","urlObject":{"protocol":"https","port":"4435","path":["api","v2","user"],"host":["shadline.com"],"query":[],"variable":[]}},"response":[],"_postman_id":"55b73c55-1bbb-45cc-9940-523b192b654c"},{"name":"get user details","event":[{"listen":"prerequest","script":{"id":"241ef7fb-d632-4ee4-ac83-53c69864857d","exec":["// TO MONITOR: https://github.com/postmanlabs/postman-app-support/issues/4193#issuecomment-626699439 (#697)\r","\r","const echoPostRequest = {\r","  url: pm.collectionVariables.get(\"protocol\") + \"://\" + pm.collectionVariables.get(\"host\") + \":\" + pm.collectionVariables.get(\"port\") + \"/api/v2/authenticate\",\r","  method: 'POST',\r","  header: {\r","    'Content-Type': 'application/json',\r","    'Accept': '*/*',\r","    'Connection': 'keep-alive',\r","    'x-api-key': pm.collectionVariables.get(\"x-api-key\"),\r","    'Content-Type': 'application/json; charset=utf-8'\r","  }\r","};\r","\r","if(pm.collectionVariables.get(\"throughGw\") == \"true\") {\r","    pm.sendRequest(echoPostRequest, function (err, res) {\r","    console.log(err ? err : res.json());\r","    if(err === null) {\r","      console.info('Refreshing the token')\r","      var responseJson = res.json();\r","      pm.collectionVariables.set('authToken', responseJson.data.token)\r","    }\r","  });\r","}\r",""],"type":"text/javascript"}}],"id":"15417418-dc01-4dc3-8305-675f9ef5852a","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","type":"text","value":"Bearer (Automatically filled)"},{"key":"x-api-key","value":"(Fill with value in README.md)","type":"text"},{"key":"x-user-key","type":"text","value":"(Fill with value in README.md)"}],"body":{"mode":"urlencoded","urlencoded":[{"key":"origin","value":"external","type":"text"}]},"url":"https://shadline.com:4435/api/v2/user/details","urlObject":{"protocol":"https","port":"4435","path":["api","v2","user","details"],"host":["shadline.com"],"query":[],"variable":[]}},"response":[],"_postman_id":"15417418-dc01-4dc3-8305-675f9ef5852a"},{"name":"get stats","event":[{"listen":"prerequest","script":{"id":"1b5a4986-9541-4eeb-8066-8fd9e93eef34","exec":["// TO MONITOR: https://github.com/postmanlabs/postman-app-support/issues/4193#issuecomment-626699439 (#697)\r","\r","const echoPostRequest = {\r","  url: pm.collectionVariables.get(\"protocol\") + \"://\" + pm.collectionVariables.get(\"host\") + \":\" + pm.collectionVariables.get(\"port\") + \"/api/v2/authenticate\",\r","  method: 'POST',\r","  header: {\r","    'Content-Type': 'application/json',\r","    'Accept': '*/*',\r","    'Connection': 'keep-alive',\r","    'x-api-key': pm.collectionVariables.get(\"x-api-key\"),\r","    'Content-Type': 'application/json; charset=utf-8'\r","  }\r","};\r","\r","if(pm.collectionVariables.get(\"throughGw\") == \"true\") {\r","    pm.sendRequest(echoPostRequest, function (err, res) {\r","    console.log(err ? err : res.json());\r","    if(err === null) {\r","      console.info('Refreshing the token')\r","      var responseJson = res.json();\r","      pm.collectionVariables.set('authToken', responseJson.data.token)\r","    }\r","  });\r","}\r",""],"type":"text/javascript"}},{"listen":"test","script":{"id":"92c1a21f-2cb2-47c5-a515-8c687a997cb8","exec":["const response = (pm.response.json()).data;","const { user_stats } = response;","const { storage } = user_stats;","const { left, used, freeSize, usedSize, file_uploaded, file_downloaded, file_downloaded_web, file_deleted, file_deleted_web, file_count } = storage;","","const expectedStatusCode = 200;","const expectedLeftSpace = \"100.00\";","const expectedUsedSpace = \"0.00\";","","const ZERO = 0;","","pm.test(`status code is ${expectedStatusCode}`, () => {","    pm.response.to.have.status(expectedStatusCode);","","    pm.test(\"left percent is correct\", () => {","        pm.expect(left).equal(expectedLeftSpace);","    });","","    pm.test('used percent is correct', () => {","        pm.expect(used).equal(expectedUsedSpace);","    });","","    pm.test(\"free size is correct\", () => {","        pm.expect(freeSize).greaterThan(ZERO);","    });","","    pm.test('used size is correct', () => {","        pm.expect(usedSize).equal(ZERO);","    });","","    // For the following tests we can't test absolute values since we can't be sure that the tests will be run with a new user each time.","    pm.test('file uploaded count is correct', () => {","        pm.expect(file_uploaded).greaterThan(ZERO);","    });","","    pm.test('file downloaded count is correct', () => {","        pm.expect(file_downloaded).greaterThan(ZERO);","    });","","    pm.test('file deleted count is correct', () => {","        pm.expect(file_deleted).greaterThan(ZERO);","    });","","    pm.test('file count is correct', () => {","        pm.expect(file_count).equal(ZERO);","    });","});",""],"type":"text/javascript"}}],"id":"3d3d2e16-f338-4677-b632-6788afefaf05","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","value":"Bearer (Automatically filled)","type":"text"},{"key":"x-api-key","value":"(Fill with value in README.md)","type":"text"},{"key":"x-user-key","type":"text","value":"(Fill with value in README.md)"}],"url":"https://shadline.com:4435/api/v2/users/stats","urlObject":{"protocol":"https","port":"4435","path":["api","v2","users","stats"],"host":["shadline.com"],"query":[],"variable":[]}},"response":[],"_postman_id":"3d3d2e16-f338-4677-b632-6788afefaf05"},{"name":"create user","event":[{"listen":"prerequest","script":{"id":"cb5c4fa8-924b-46a5-9d68-2236fa7fa624","exec":["// TO MONITOR: https://github.com/postmanlabs/postman-app-support/issues/4193#issuecomment-626699439 (#697)\r","\r","const echoPostRequest = {\r","  url: pm.collectionVariables.get(\"protocol\") + \"://\" + pm.collectionVariables.get(\"host\") + \":\" + pm.collectionVariables.get(\"port\") + \"/api/v2/authenticate\",\r","  method: 'POST',\r","  header: {\r","    'Content-Type': 'application/json',\r","    'Accept': '*/*',\r","    'Connection': 'keep-alive',\r","    'x-api-key': pm.collectionVariables.get(\"x-api-key\"),\r","    'Content-Type': 'application/json; charset=utf-8'\r","  }\r","};\r","\r","if(pm.collectionVariables.get(\"through_gw\") == \"true\") {\r","    pm.sendRequest(echoPostRequest, function (err, res) {\r","    console.log(err ? err : res.json());\r","    if(err === null) {\r","      console.info('Refreshing the token')\r","      var responseJson = res.json();\r","      pm.collectionVariables.set('authToken', responseJson.data.token)\r","    }\r","  });\r","}\r",""],"type":"text/javascript"}},{"listen":"test","script":{"id":"9051cca2-7c7c-4cb6-a19c-68fc85241996","exec":["pm.test(\"post /create user is ok\", function () {","    pm.response.to.have.status(200);","    var jsonData = JSON.parse(responseBody)","    var xUserKey = jsonData.data.reference","    pm.collectionVariables.set('x-user-key',xUserKey)","});"],"type":"text/javascript"}}],"id":"3ca78964-a15f-4d4f-a180-b75b0655bf46","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Authorization","value":"Bearer (Automatically filled)","type":"text"},{"key":"x-api-key","value":"(Fill with value in README.md)","type":"text"},{"key":"x-technical-key","type":"text","value":""}],"url":"https://shadline.com:4435/api/v2/user","urlObject":{"protocol":"https","port":"4435","path":["api","v2","user"],"host":["shadline.com"],"query":[],"variable":[]}},"response":[],"_postman_id":"3ca78964-a15f-4d4f-a180-b75b0655bf46"}],"id":"247f2841-7722-4b09-9f40-e72cbbab6209","_postman_id":"247f2841-7722-4b09-9f40-e72cbbab6209","description":""}],"id":"9e47f5ca-ad8a-42a7-871a-6f70aa13ac03","_postman_id":"9e47f5ca-ad8a-42a7-871a-6f70aa13ac03","description":""}],"event":[{"listen":"prerequest","script":{"id":"4c19edcf-0f6e-414f-874f-a4f0dc2665c3","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"0477e43a-c4ff-465a-890e-01c4879244df","type":"text/javascript","exec":[""]}}],"variable":[{"key":"protocol","value":"https"},{"key":"host","value":"shadline.com"},{"key":"port","value":"4435"},{"key":"x-api-key","value":"(Fill with value in README.md)"},{"key":"x-user-key","value":"(Fill with value in README.md)"},{"key":"hpassword","value":"(Fill an encrypted password)"},{"key":"authToken","value":"(Automatically filled)"},{"key":"fileUuid","value":"(Last file uploaded id)"},{"key":"localPassword","value":"(Automatically filled when authenticate request is call)"},{"key":"throughGw","value":"true"},{"key":"folderUuid","value":"(Last folder created id)"},{"key":"folderName","value":"folderName"},{"key":"folderUpdatedName","value":"folderUpdatedName"},{"key":"fileName","value":"fileName.test"},{"key":"fileUpdatedName","value":"fileUpdatedName.test"},{"key":"fileExpireAt","value":"2030-11-02T10:00:00"},{"key":"x-technical-key","value":""}]}