akamai-edgegrid 3.2.0 → 3.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ {"/Users/miwojci/dev/akamaiopen-edgegrid-node/src/api.js":{"path":"/Users/miwojci/dev/akamaiopen-edgegrid-node/src/api.js","statementMap":{"0":{"start":{"line":15,"column":14},"end":{"line":15,"column":30}},"1":{"start":{"line":16,"column":11},"end":{"line":16,"column":28}},"2":{"start":{"line":17,"column":13},"end":{"line":17,"column":32}},"3":{"start":{"line":18,"column":14},"end":{"line":18,"column":34}},"4":{"start":{"line":19,"column":13},"end":{"line":19,"column":32}},"5":{"start":{"line":21,"column":17},"end":{"line":39,"column":1}},"6":{"start":{"line":23,"column":4},"end":{"line":28,"column":5}},"7":{"start":{"line":24,"column":25},"end":{"line":24,"column":37}},"8":{"start":{"line":25,"column":8},"end":{"line":25,"column":43}},"9":{"start":{"line":27,"column":8},"end":{"line":27,"column":84}},"10":{"start":{"line":29,"column":4},"end":{"line":38,"column":5}},"11":{"start":{"line":30,"column":8},"end":{"line":33,"column":11}},"12":{"start":{"line":31,"column":12},"end":{"line":31,"column":53}},"13":{"start":{"line":32,"column":12},"end":{"line":32,"column":27}},"14":{"start":{"line":34,"column":8},"end":{"line":37,"column":11}},"15":{"start":{"line":35,"column":12},"end":{"line":35,"column":47}},"16":{"start":{"line":36,"column":12},"end":{"line":36,"column":28}},"17":{"start":{"line":50,"column":0},"end":{"line":84,"column":2}},"18":{"start":{"line":51,"column":4},"end":{"line":58,"column":7}},"19":{"start":{"line":60,"column":4},"end":{"line":60,"column":53}},"20":{"start":{"line":62,"column":20},"end":{"line":62,"column":104}},"21":{"start":{"line":65,"column":4},"end":{"line":69,"column":5}},"22":{"start":{"line":66,"column":8},"end":{"line":68,"column":9}},"23":{"start":{"line":67,"column":12},"end":{"line":67,"column":48}},"24":{"start":{"line":71,"column":4},"end":{"line":71,"column":24}},"25":{"start":{"line":73,"column":4},"end":{"line":79,"column":6}},"26":{"start":{"line":80,"column":4},"end":{"line":82,"column":5}},"27":{"start":{"line":81,"column":8},"end":{"line":81,"column":53}},"28":{"start":{"line":83,"column":4},"end":{"line":83,"column":16}},"29":{"start":{"line":92,"column":0},"end":{"line":105,"column":2}},"30":{"start":{"line":93,"column":4},"end":{"line":102,"column":7}},"31":{"start":{"line":94,"column":8},"end":{"line":94,"column":64}},"32":{"start":{"line":97,"column":8},"end":{"line":100,"column":9}},"33":{"start":{"line":98,"column":12},"end":{"line":98,"column":59}},"34":{"start":{"line":99,"column":12},"end":{"line":99,"column":19}},"35":{"start":{"line":101,"column":8},"end":{"line":101,"column":24}},"36":{"start":{"line":104,"column":4},"end":{"line":104,"column":16}},"37":{"start":{"line":107,"column":0},"end":{"line":116,"column":2}},"38":{"start":{"line":108,"column":22},"end":{"line":108,"column":55}},"39":{"start":{"line":110,"column":4},"end":{"line":110,"column":46}},"40":{"start":{"line":111,"column":4},"end":{"line":111,"column":33}},"41":{"start":{"line":112,"column":4},"end":{"line":112,"column":62}},"42":{"start":{"line":114,"column":4},"end":{"line":114,"column":28}},"43":{"start":{"line":115,"column":4},"end":{"line":115,"column":24}},"44":{"start":{"line":126,"column":0},"end":{"line":137,"column":2}},"45":{"start":{"line":127,"column":4},"end":{"line":129,"column":5}},"46":{"start":{"line":128,"column":8},"end":{"line":128,"column":59}},"47":{"start":{"line":131,"column":4},"end":{"line":136,"column":6}},"48":{"start":{"line":140,"column":21},"end":{"line":142,"column":5}},"49":{"start":{"line":143,"column":16},"end":{"line":143,"column":20}},"50":{"start":{"line":145,"column":4},"end":{"line":150,"column":7}},"51":{"start":{"line":146,"column":8},"end":{"line":149,"column":9}},"52":{"start":{"line":147,"column":12},"end":{"line":147,"column":46}},"53":{"start":{"line":148,"column":12},"end":{"line":148,"column":26}},"54":{"start":{"line":152,"column":4},"end":{"line":152,"column":17}},"55":{"start":{"line":161,"column":0},"end":{"line":163,"column":2}},"56":{"start":{"line":162,"column":4},"end":{"line":162,"column":48}},"57":{"start":{"line":165,"column":0},"end":{"line":165,"column":26}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":21,"column":17},"end":{"line":21,"column":18}},"loc":{"start":{"line":21,"column":83},"end":{"line":39,"column":1}},"line":21},"1":{"name":"(anonymous_1)","decl":{"start":{"line":30,"column":39},"end":{"line":30,"column":40}},"loc":{"start":{"line":30,"column":50},"end":{"line":33,"column":9}},"line":30},"2":{"name":"(anonymous_2)","decl":{"start":{"line":34,"column":40},"end":{"line":34,"column":41}},"loc":{"start":{"line":34,"column":52},"end":{"line":37,"column":9}},"line":34},"3":{"name":"(anonymous_3)","decl":{"start":{"line":50,"column":26},"end":{"line":50,"column":27}},"loc":{"start":{"line":50,"column":41},"end":{"line":84,"column":1}},"line":50},"4":{"name":"(anonymous_4)","decl":{"start":{"line":92,"column":26},"end":{"line":92,"column":27}},"loc":{"start":{"line":92,"column":46},"end":{"line":105,"column":1}},"line":92},"5":{"name":"(anonymous_5)","decl":{"start":{"line":93,"column":29},"end":{"line":93,"column":30}},"loc":{"start":{"line":93,"column":41},"end":{"line":95,"column":5}},"line":93},"6":{"name":"(anonymous_6)","decl":{"start":{"line":95,"column":13},"end":{"line":95,"column":14}},"loc":{"start":{"line":95,"column":22},"end":{"line":102,"column":5}},"line":95},"7":{"name":"(anonymous_7)","decl":{"start":{"line":107,"column":37},"end":{"line":107,"column":38}},"loc":{"start":{"line":107,"column":63},"end":{"line":116,"column":1}},"line":107},"8":{"name":"(anonymous_8)","decl":{"start":{"line":126,"column":43},"end":{"line":126,"column":44}},"loc":{"start":{"line":126,"column":102},"end":{"line":137,"column":1}},"line":126},"9":{"name":"validatedArgs","decl":{"start":{"line":139,"column":9},"end":{"line":139,"column":22}},"loc":{"start":{"line":139,"column":29},"end":{"line":153,"column":1}},"line":139},"10":{"name":"(anonymous_10)","decl":{"start":{"line":145,"column":21},"end":{"line":145,"column":22}},"loc":{"start":{"line":145,"column":39},"end":{"line":150,"column":5}},"line":145},"11":{"name":"(anonymous_11)","decl":{"start":{"line":161,"column":39},"end":{"line":161,"column":40}},"loc":{"start":{"line":161,"column":54},"end":{"line":163,"column":1}},"line":161}},"branchMap":{"0":{"loc":{"start":{"line":23,"column":4},"end":{"line":28,"column":5}},"type":"if","locations":[{"start":{"line":23,"column":4},"end":{"line":28,"column":5}},{"start":{"line":23,"column":4},"end":{"line":28,"column":5}}],"line":23},"1":{"loc":{"start":{"line":29,"column":4},"end":{"line":38,"column":5}},"type":"if","locations":[{"start":{"line":29,"column":4},"end":{"line":38,"column":5}},{"start":{"line":29,"column":4},"end":{"line":38,"column":5}}],"line":29},"2":{"loc":{"start":{"line":29,"column":8},"end":{"line":29,"column":99}},"type":"binary-expr","locations":[{"start":{"line":29,"column":8},"end":{"line":29,"column":30}},{"start":{"line":29,"column":34},"end":{"line":29,"column":39}},{"start":{"line":29,"column":44},"end":{"line":29,"column":76}},{"start":{"line":29,"column":80},"end":{"line":29,"column":98}}],"line":29},"3":{"loc":{"start":{"line":62,"column":20},"end":{"line":62,"column":104}},"type":"binary-expr","locations":[{"start":{"line":62,"column":20},"end":{"line":62,"column":50}},{"start":{"line":62,"column":54},"end":{"line":62,"column":104}}],"line":62},"4":{"loc":{"start":{"line":65,"column":4},"end":{"line":69,"column":5}},"type":"if","locations":[{"start":{"line":65,"column":4},"end":{"line":69,"column":5}},{"start":{"line":65,"column":4},"end":{"line":69,"column":5}}],"line":65},"5":{"loc":{"start":{"line":66,"column":8},"end":{"line":68,"column":9}},"type":"if","locations":[{"start":{"line":66,"column":8},"end":{"line":68,"column":9}},{"start":{"line":66,"column":8},"end":{"line":68,"column":9}}],"line":66},"6":{"loc":{"start":{"line":66,"column":12},"end":{"line":66,"column":55}},"type":"binary-expr","locations":[{"start":{"line":66,"column":12},"end":{"line":66,"column":41}},{"start":{"line":66,"column":45},"end":{"line":66,"column":55}}],"line":66},"7":{"loc":{"start":{"line":80,"column":4},"end":{"line":82,"column":5}},"type":"if","locations":[{"start":{"line":80,"column":4},"end":{"line":82,"column":5}},{"start":{"line":80,"column":4},"end":{"line":82,"column":5}}],"line":80},"8":{"loc":{"start":{"line":97,"column":8},"end":{"line":100,"column":9}},"type":"if","locations":[{"start":{"line":97,"column":8},"end":{"line":100,"column":9}},{"start":{"line":97,"column":8},"end":{"line":100,"column":9}}],"line":97},"9":{"loc":{"start":{"line":97,"column":12},"end":{"line":97,"column":71}},"type":"binary-expr","locations":[{"start":{"line":97,"column":12},"end":{"line":97,"column":26}},{"start":{"line":97,"column":30},"end":{"line":97,"column":71}}],"line":97},"10":{"loc":{"start":{"line":127,"column":4},"end":{"line":129,"column":5}},"type":"if","locations":[{"start":{"line":127,"column":4},"end":{"line":129,"column":5}},{"start":{"line":127,"column":4},"end":{"line":129,"column":5}}],"line":127},"11":{"loc":{"start":{"line":135,"column":14},"end":{"line":135,"column":70}},"type":"cond-expr","locations":[{"start":{"line":135,"column":46},"end":{"line":135,"column":50}},{"start":{"line":135,"column":53},"end":{"line":135,"column":70}}],"line":135},"12":{"loc":{"start":{"line":146,"column":8},"end":{"line":149,"column":9}},"type":"if","locations":[{"start":{"line":146,"column":8},"end":{"line":149,"column":9}},{"start":{"line":146,"column":8},"end":{"line":149,"column":9}}],"line":146}},"s":{"0":1,"1":1,"2":1,"3":1,"4":1,"5":1,"6":60,"7":16,"8":16,"9":44,"10":58,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":1,"18":28,"19":28,"20":28,"21":28,"22":6,"23":6,"24":28,"25":28,"26":28,"27":4,"28":28,"29":1,"30":7,"31":3,"32":4,"33":2,"34":2,"35":2,"36":7,"37":1,"38":2,"39":2,"40":2,"41":2,"42":2,"43":2,"44":1,"45":44,"46":1,"47":43,"48":44,"49":44,"50":44,"51":176,"52":4,"53":4,"54":44,"55":1,"56":16,"57":1},"f":{"0":60,"1":0,"2":0,"3":28,"4":7,"5":3,"6":4,"7":2,"8":44,"9":44,"10":176,"11":16},"b":{"0":[16,44],"1":[0,58],"2":[58,58,58,15],"3":[28,0],"4":[6,22],"5":[6,0],"6":[6,6],"7":[4,24],"8":[2,2],"9":[4,2],"10":[1,43],"11":[1,42],"12":[4,172]},"_coverageSchema":"1a1c01bbd47fc00a2c39e90264f33305004495a9","hash":"6c7d51344732614e009e477ba419a636f768de3b","contentHash":"8b4ab75e13d7a6c9578bfe5f44c4a3017a78bc94ddc8f95be6ded3ea0638138e"},"/Users/miwojci/dev/akamaiopen-edgegrid-node/src/auth.js":{"path":"/Users/miwojci/dev/akamaiopen-edgegrid-node/src/auth.js","statementMap":{"0":{"start":{"line":15,"column":13},"end":{"line":15,"column":28}},"1":{"start":{"line":16,"column":14},"end":{"line":16,"column":34}},"2":{"start":{"line":17,"column":13},"end":{"line":17,"column":32}},"3":{"start":{"line":18,"column":10},"end":{"line":18,"column":24}},"4":{"start":{"line":21,"column":26},"end":{"line":26,"column":5}},"5":{"start":{"line":27,"column":22},"end":{"line":27,"column":24}},"6":{"start":{"line":32,"column":4},"end":{"line":34,"column":5}},"7":{"start":{"line":33,"column":8},"end":{"line":33,"column":60}},"8":{"start":{"line":36,"column":4},"end":{"line":36,"column":50}},"9":{"start":{"line":38,"column":4},"end":{"line":38,"column":71}},"10":{"start":{"line":40,"column":4},"end":{"line":40,"column":126}},"11":{"start":{"line":42,"column":4},"end":{"line":42,"column":75}},"12":{"start":{"line":44,"column":4},"end":{"line":44,"column":28}},"13":{"start":{"line":48,"column":19},"end":{"line":48,"column":38}},"14":{"start":{"line":49,"column":4},"end":{"line":55,"column":5}},"15":{"start":{"line":50,"column":32},"end":{"line":50,"column":57}},"16":{"start":{"line":51,"column":8},"end":{"line":53,"column":9}},"17":{"start":{"line":52,"column":12},"end":{"line":52,"column":61}},"18":{"start":{"line":54,"column":8},"end":{"line":54,"column":51}},"19":{"start":{"line":57,"column":4},"end":{"line":57,"column":30}},"20":{"start":{"line":60,"column":0},"end":{"line":75,"column":2}},"21":{"start":{"line":62,"column":8},"end":{"line":62,"column":36}},"22":{"start":{"line":63,"column":8},"end":{"line":63,"column":33}},"23":{"start":{"line":64,"column":8},"end":{"line":64,"column":59}},"24":{"start":{"line":66,"column":8},"end":{"line":68,"column":9}},"25":{"start":{"line":67,"column":12},"end":{"line":67,"column":33}},"26":{"start":{"line":70,"column":8},"end":{"line":70,"column":62}},"27":{"start":{"line":71,"column":8},"end":{"line":71,"column":130}},"28":{"start":{"line":73,"column":8},"end":{"line":73,"column":23}}},"fnMap":{"0":{"name":"makeAuthHeader","decl":{"start":{"line":20,"column":9},"end":{"line":20,"column":23}},"loc":{"start":{"line":20,"column":100},"end":{"line":45,"column":1}},"line":20},"1":{"name":"makeURL","decl":{"start":{"line":47,"column":9},"end":{"line":47,"column":16}},"loc":{"start":{"line":47,"column":45},"end":{"line":58,"column":1}},"line":47},"2":{"name":"(anonymous_2)","decl":{"start":{"line":61,"column":18},"end":{"line":61,"column":19}},"loc":{"start":{"line":61,"column":109},"end":{"line":74,"column":5}},"line":61}},"branchMap":{"0":{"loc":{"start":{"line":49,"column":4},"end":{"line":55,"column":5}},"type":"if","locations":[{"start":{"line":49,"column":4},"end":{"line":55,"column":5}},{"start":{"line":49,"column":4},"end":{"line":55,"column":5}}],"line":49},"1":{"loc":{"start":{"line":62,"column":18},"end":{"line":62,"column":35}},"type":"binary-expr","locations":[{"start":{"line":62,"column":18},"end":{"line":62,"column":25}},{"start":{"line":62,"column":29},"end":{"line":62,"column":35}}],"line":62},"2":{"loc":{"start":{"line":63,"column":15},"end":{"line":63,"column":32}},"type":"binary-expr","locations":[{"start":{"line":63,"column":15},"end":{"line":63,"column":19}},{"start":{"line":63,"column":23},"end":{"line":63,"column":32}}],"line":63},"3":{"loc":{"start":{"line":64,"column":20},"end":{"line":64,"column":58}},"type":"binary-expr","locations":[{"start":{"line":64,"column":20},"end":{"line":64,"column":29}},{"start":{"line":64,"column":33},"end":{"line":64,"column":58}}],"line":64},"4":{"loc":{"start":{"line":66,"column":8},"end":{"line":68,"column":9}},"type":"if","locations":[{"start":{"line":66,"column":8},"end":{"line":68,"column":9}},{"start":{"line":66,"column":8},"end":{"line":68,"column":9}}],"line":66}},"s":{"0":1,"1":1,"2":1,"3":1,"4":28,"5":28,"6":28,"7":112,"8":28,"9":28,"10":28,"11":28,"12":28,"13":28,"14":28,"15":0,"16":0,"17":0,"18":0,"19":28,"20":1,"21":28,"22":28,"23":28,"24":28,"25":0,"26":28,"27":28,"28":28},"f":{"0":28,"1":28,"2":28},"b":{"0":[0,28],"1":[28,28],"2":[28,28],"3":[28,28],"4":[0,28]},"_coverageSchema":"1a1c01bbd47fc00a2c39e90264f33305004495a9","hash":"396962a52e684247c635588879e8bba5ed0e7c0c","contentHash":"eabb03efa1f55905ee2a4f76abc411117d8c25e9df6961d6f0451725539150ea"},"/Users/miwojci/dev/akamaiopen-edgegrid-node/src/helpers.js":{"path":"/Users/miwojci/dev/akamaiopen-edgegrid-node/src/helpers.js","statementMap":{"0":{"start":{"line":15,"column":15},"end":{"line":15,"column":32}},"1":{"start":{"line":16,"column":13},"end":{"line":16,"column":32}},"2":{"start":{"line":17,"column":11},"end":{"line":17,"column":26}},"3":{"start":{"line":18,"column":9},"end":{"line":18,"column":22}},"4":{"start":{"line":21,"column":4},"end":{"line":21,"column":43}},"5":{"start":{"line":24,"column":0},"end":{"line":198,"column":2}},"6":{"start":{"line":31,"column":21},"end":{"line":31,"column":41}},"7":{"start":{"line":33,"column":8},"end":{"line":41,"column":20}},"8":{"start":{"line":45,"column":26},"end":{"line":45,"column":28}},"9":{"start":{"line":46,"column":27},"end":{"line":46,"column":45}},"10":{"start":{"line":47,"column":24},"end":{"line":47,"column":116}},"11":{"start":{"line":49,"column":8},"end":{"line":64,"column":9}},"12":{"start":{"line":50,"column":30},"end":{"line":50,"column":32}},"13":{"start":{"line":53,"column":12},"end":{"line":53,"column":82}},"14":{"start":{"line":55,"column":12},"end":{"line":57,"column":13}},"15":{"start":{"line":56,"column":16},"end":{"line":56,"column":103}},"16":{"start":{"line":60,"column":12},"end":{"line":60,"column":57}},"17":{"start":{"line":62,"column":12},"end":{"line":62,"column":39}},"18":{"start":{"line":63,"column":12},"end":{"line":63,"column":40}},"19":{"start":{"line":66,"column":8},"end":{"line":66,"column":56}},"20":{"start":{"line":67,"column":8},"end":{"line":67,"column":66}},"21":{"start":{"line":69,"column":8},"end":{"line":87,"column":9}},"22":{"start":{"line":71,"column":12},"end":{"line":71,"column":69}},"23":{"start":{"line":74,"column":12},"end":{"line":81,"column":13}},"24":{"start":{"line":75,"column":16},"end":{"line":75,"column":107}},"25":{"start":{"line":76,"column":16},"end":{"line":79,"column":70}},"26":{"start":{"line":77,"column":20},"end":{"line":77,"column":66}},"27":{"start":{"line":79,"column":20},"end":{"line":79,"column":70}},"28":{"start":{"line":80,"column":16},"end":{"line":80,"column":82}},"29":{"start":{"line":83,"column":12},"end":{"line":83,"column":56}},"30":{"start":{"line":85,"column":12},"end":{"line":85,"column":58}},"31":{"start":{"line":86,"column":12},"end":{"line":86,"column":67}},"32":{"start":{"line":89,"column":8},"end":{"line":89,"column":27}},"33":{"start":{"line":93,"column":26},"end":{"line":93,"column":46}},"34":{"start":{"line":94,"column":25},"end":{"line":102,"column":13}},"35":{"start":{"line":104,"column":30},"end":{"line":104,"column":62}},"36":{"start":{"line":106,"column":8},"end":{"line":106,"column":64}},"37":{"start":{"line":108,"column":8},"end":{"line":108,"column":29}},"38":{"start":{"line":114,"column":8},"end":{"line":118,"column":9}},"39":{"start":{"line":115,"column":12},"end":{"line":117,"column":13}},"40":{"start":{"line":116,"column":16},"end":{"line":116,"column":32}},"41":{"start":{"line":120,"column":8},"end":{"line":120,"column":17}},"42":{"start":{"line":124,"column":8},"end":{"line":126,"column":9}},"43":{"start":{"line":125,"column":12},"end":{"line":125,"column":57}},"44":{"start":{"line":128,"column":25},"end":{"line":128,"column":48}},"45":{"start":{"line":129,"column":8},"end":{"line":131,"column":9}},"46":{"start":{"line":130,"column":12},"end":{"line":130,"column":78}},"47":{"start":{"line":132,"column":8},"end":{"line":134,"column":9}},"48":{"start":{"line":133,"column":12},"end":{"line":133,"column":123}},"49":{"start":{"line":136,"column":8},"end":{"line":136,"column":46}},"50":{"start":{"line":136,"column":44},"end":{"line":136,"column":45}},"51":{"start":{"line":137,"column":8},"end":{"line":139,"column":9}},"52":{"start":{"line":138,"column":12},"end":{"line":138,"column":56}},"53":{"start":{"line":141,"column":8},"end":{"line":141,"column":23}},"54":{"start":{"line":145,"column":8},"end":{"line":147,"column":37}},"55":{"start":{"line":151,"column":23},"end":{"line":151,"column":63}},"56":{"start":{"line":153,"column":8},"end":{"line":153,"column":39}},"57":{"start":{"line":157,"column":24},"end":{"line":157,"column":56}},"58":{"start":{"line":159,"column":8},"end":{"line":159,"column":29}},"59":{"start":{"line":161,"column":8},"end":{"line":161,"column":40}},"60":{"start":{"line":170,"column":33},"end":{"line":170,"column":35}},"61":{"start":{"line":173,"column":8},"end":{"line":175,"column":9}},"62":{"start":{"line":174,"column":12},"end":{"line":174,"column":102}},"63":{"start":{"line":177,"column":8},"end":{"line":177,"column":43}},"64":{"start":{"line":181,"column":20},"end":{"line":181,"column":66}},"65":{"start":{"line":183,"column":8},"end":{"line":183,"column":50}},"66":{"start":{"line":185,"column":8},"end":{"line":185,"column":19}},"67":{"start":{"line":189,"column":8},"end":{"line":189,"column":126}},"68":{"start":{"line":193,"column":8},"end":{"line":195,"column":9}},"69":{"start":{"line":194,"column":12},"end":{"line":194,"column":62}},"70":{"start":{"line":196,"column":8},"end":{"line":196,"column":24}}},"fnMap":{"0":{"name":"twoDigitNumberPad","decl":{"start":{"line":20,"column":9},"end":{"line":20,"column":26}},"loc":{"start":{"line":20,"column":35},"end":{"line":22,"column":1}},"line":20},"1":{"name":"(anonymous_1)","decl":{"start":{"line":30,"column":21},"end":{"line":30,"column":22}},"loc":{"start":{"line":30,"column":33},"end":{"line":42,"column":5}},"line":30},"2":{"name":"(anonymous_2)","decl":{"start":{"line":44,"column":17},"end":{"line":44,"column":18}},"loc":{"start":{"line":44,"column":45},"end":{"line":90,"column":5}},"line":44},"3":{"name":"(anonymous_3)","decl":{"start":{"line":92,"column":16},"end":{"line":92,"column":17}},"loc":{"start":{"line":92,"column":56},"end":{"line":109,"column":5}},"line":92},"4":{"name":"(anonymous_4)","decl":{"start":{"line":111,"column":13},"end":{"line":111,"column":14}},"loc":{"start":{"line":111,"column":29},"end":{"line":121,"column":5}},"line":111},"5":{"name":"(anonymous_5)","decl":{"start":{"line":123,"column":19},"end":{"line":123,"column":20}},"loc":{"start":{"line":123,"column":38},"end":{"line":142,"column":5}},"line":123},"6":{"name":"(anonymous_6)","decl":{"start":{"line":136,"column":39},"end":{"line":136,"column":40}},"loc":{"start":{"line":136,"column":44},"end":{"line":136,"column":45}},"line":136},"7":{"name":"(anonymous_7)","decl":{"start":{"line":144,"column":16},"end":{"line":144,"column":17}},"loc":{"start":{"line":144,"column":38},"end":{"line":148,"column":5}},"line":144},"8":{"name":"(anonymous_8)","decl":{"start":{"line":150,"column":18},"end":{"line":150,"column":19}},"loc":{"start":{"line":150,"column":34},"end":{"line":154,"column":5}},"line":150},"9":{"name":"(anonymous_9)","decl":{"start":{"line":156,"column":22},"end":{"line":156,"column":23}},"loc":{"start":{"line":156,"column":43},"end":{"line":162,"column":5}},"line":156},"10":{"name":"(anonymous_10)","decl":{"start":{"line":169,"column":25},"end":{"line":169,"column":26}},"loc":{"start":{"line":169,"column":44},"end":{"line":178,"column":5}},"line":169},"11":{"name":"(anonymous_11)","decl":{"start":{"line":180,"column":16},"end":{"line":180,"column":17}},"loc":{"start":{"line":180,"column":51},"end":{"line":186,"column":5}},"line":180},"12":{"name":"(anonymous_12)","decl":{"start":{"line":188,"column":17},"end":{"line":188,"column":18}},"loc":{"start":{"line":188,"column":82},"end":{"line":190,"column":5}},"line":188},"13":{"name":"(anonymous_13)","decl":{"start":{"line":192,"column":17},"end":{"line":192,"column":18}},"loc":{"start":{"line":192,"column":37},"end":{"line":197,"column":5}},"line":192}},"branchMap":{"0":{"loc":{"start":{"line":46,"column":27},"end":{"line":46,"column":45}},"type":"binary-expr","locations":[{"start":{"line":46,"column":27},"end":{"line":46,"column":39}},{"start":{"line":46,"column":43},"end":{"line":46,"column":45}}],"line":46},"1":{"loc":{"start":{"line":47,"column":24},"end":{"line":47,"column":116}},"type":"binary-expr","locations":[{"start":{"line":47,"column":24},"end":{"line":47,"column":58}},{"start":{"line":47,"column":62},"end":{"line":47,"column":116}}],"line":47},"2":{"loc":{"start":{"line":49,"column":8},"end":{"line":64,"column":9}},"type":"if","locations":[{"start":{"line":49,"column":8},"end":{"line":64,"column":9}},{"start":{"line":49,"column":8},"end":{"line":64,"column":9}}],"line":49},"3":{"loc":{"start":{"line":49,"column":12},"end":{"line":49,"column":58}},"type":"binary-expr","locations":[{"start":{"line":49,"column":12},"end":{"line":49,"column":44}},{"start":{"line":49,"column":48},"end":{"line":49,"column":58}}],"line":49},"4":{"loc":{"start":{"line":69,"column":8},"end":{"line":87,"column":9}},"type":"if","locations":[{"start":{"line":69,"column":8},"end":{"line":87,"column":9}},{"start":{"line":69,"column":8},"end":{"line":87,"column":9}}],"line":69},"5":{"loc":{"start":{"line":69,"column":12},"end":{"line":69,"column":64}},"type":"binary-expr","locations":[{"start":{"line":69,"column":12},"end":{"line":69,"column":37}},{"start":{"line":69,"column":41},"end":{"line":69,"column":64}}],"line":69},"6":{"loc":{"start":{"line":74,"column":12},"end":{"line":81,"column":13}},"type":"if","locations":[{"start":{"line":74,"column":12},"end":{"line":81,"column":13}},{"start":{"line":74,"column":12},"end":{"line":81,"column":13}}],"line":74},"7":{"loc":{"start":{"line":76,"column":16},"end":{"line":79,"column":70}},"type":"if","locations":[{"start":{"line":76,"column":16},"end":{"line":79,"column":70}},{"start":{"line":76,"column":16},"end":{"line":79,"column":70}}],"line":76},"8":{"loc":{"start":{"line":115,"column":12},"end":{"line":117,"column":13}},"type":"if","locations":[{"start":{"line":115,"column":12},"end":{"line":117,"column":13}},{"start":{"line":115,"column":12},"end":{"line":117,"column":13}}],"line":115},"9":{"loc":{"start":{"line":124,"column":8},"end":{"line":126,"column":9}},"type":"if","locations":[{"start":{"line":124,"column":8},"end":{"line":126,"column":9}},{"start":{"line":124,"column":8},"end":{"line":126,"column":9}}],"line":124},"10":{"loc":{"start":{"line":129,"column":8},"end":{"line":131,"column":9}},"type":"if","locations":[{"start":{"line":129,"column":8},"end":{"line":131,"column":9}},{"start":{"line":129,"column":8},"end":{"line":131,"column":9}}],"line":129},"11":{"loc":{"start":{"line":129,"column":12},"end":{"line":129,"column":74}},"type":"binary-expr","locations":[{"start":{"line":129,"column":12},"end":{"line":129,"column":37}},{"start":{"line":129,"column":41},"end":{"line":129,"column":74}}],"line":129},"12":{"loc":{"start":{"line":132,"column":8},"end":{"line":134,"column":9}},"type":"if","locations":[{"start":{"line":132,"column":8},"end":{"line":134,"column":9}},{"start":{"line":132,"column":8},"end":{"line":134,"column":9}}],"line":132},"13":{"loc":{"start":{"line":132,"column":12},"end":{"line":132,"column":90}},"type":"binary-expr","locations":[{"start":{"line":132,"column":12},"end":{"line":132,"column":45}},{"start":{"line":132,"column":49},"end":{"line":132,"column":90}}],"line":132},"14":{"loc":{"start":{"line":137,"column":8},"end":{"line":139,"column":9}},"type":"if","locations":[{"start":{"line":137,"column":8},"end":{"line":139,"column":9}},{"start":{"line":137,"column":8},"end":{"line":139,"column":9}}],"line":137},"15":{"loc":{"start":{"line":193,"column":8},"end":{"line":195,"column":9}},"type":"if","locations":[{"start":{"line":193,"column":8},"end":{"line":195,"column":9}},{"start":{"line":193,"column":8},"end":{"line":195,"column":9}}],"line":193}},"s":{"0":1,"1":1,"2":1,"3":1,"4":140,"5":1,"6":28,"7":28,"8":28,"9":28,"10":28,"11":28,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":28,"20":28,"21":28,"22":6,"23":6,"24":0,"25":0,"26":0,"27":0,"28":0,"29":6,"30":6,"31":6,"32":28,"33":28,"34":28,"35":28,"36":28,"37":28,"38":28,"39":168,"40":132,"41":28,"42":28,"43":26,"44":28,"45":28,"46":3,"47":28,"48":3,"49":28,"50":34,"51":28,"52":10,"53":28,"54":2,"55":6,"56":6,"57":56,"58":56,"59":56,"60":28,"61":28,"62":0,"63":28,"64":28,"65":28,"66":28,"67":28,"68":14,"69":0,"70":14},"f":{"0":140,"1":28,"2":28,"3":28,"4":28,"5":28,"6":34,"7":2,"8":6,"9":56,"10":28,"11":28,"12":28,"13":14},"b":{"0":[28,22],"1":[28,0],"2":[0,28],"3":[28,0],"4":[6,22],"5":[28,7],"6":[0,6],"7":[0,0],"8":[132,36],"9":[26,2],"10":[3,25],"11":[28,3],"12":[3,25],"13":[28,3],"14":[10,18],"15":[0,14]},"_coverageSchema":"1a1c01bbd47fc00a2c39e90264f33305004495a9","hash":"a797e6f323ef38b76fe517e81cb2db2b4c341228","contentHash":"3231affb048fc338e4df310580556ac7c989d28bfffdfbfaa531943ef6a99e95"},"/Users/miwojci/dev/akamaiopen-edgegrid-node/src/logger.js":{"path":"/Users/miwojci/dev/akamaiopen-edgegrid-node/src/logger.js","statementMap":{"0":{"start":{"line":15,"column":15},"end":{"line":15,"column":32}},"1":{"start":{"line":16,"column":13},"end":{"line":16,"column":31}},"2":{"start":{"line":18,"column":0},"end":{"line":20,"column":1}},"3":{"start":{"line":19,"column":2},"end":{"line":19,"column":37}},"4":{"start":{"line":22,"column":0},"end":{"line":24,"column":1}},"5":{"start":{"line":23,"column":2},"end":{"line":23,"column":35}},"6":{"start":{"line":26,"column":0},"end":{"line":26,"column":24}}},"fnMap":{},"branchMap":{"0":{"loc":{"start":{"line":18,"column":0},"end":{"line":20,"column":1}},"type":"if","locations":[{"start":{"line":18,"column":0},"end":{"line":20,"column":1}},{"start":{"line":18,"column":0},"end":{"line":20,"column":1}}],"line":18},"1":{"loc":{"start":{"line":22,"column":0},"end":{"line":24,"column":1}},"type":"if","locations":[{"start":{"line":22,"column":0},"end":{"line":24,"column":1}},{"start":{"line":22,"column":0},"end":{"line":24,"column":1}}],"line":22}},"s":{"0":1,"1":1,"2":1,"3":1,"4":1,"5":0,"6":1},"f":{},"b":{"0":[1,0],"1":[0,1]},"_coverageSchema":"1a1c01bbd47fc00a2c39e90264f33305004495a9","hash":"7c33222d8ba550fc4985fc73c9ee3a512195ef69","contentHash":"fcb09c0be6fa75e606a98a12ff740ee4a107c1f0efa94ff3239e267bc451440a"},"/Users/miwojci/dev/akamaiopen-edgegrid-node/src/edgerc.js":{"path":"/Users/miwojci/dev/akamaiopen-edgegrid-node/src/edgerc.js","statementMap":{"0":{"start":{"line":15,"column":11},"end":{"line":15,"column":24}},"1":{"start":{"line":16,"column":13},"end":{"line":16,"column":32}},"2":{"start":{"line":17,"column":14},"end":{"line":17,"column":34}},"3":{"start":{"line":20,"column":18},"end":{"line":20,"column":31}},"4":{"start":{"line":21,"column":18},"end":{"line":21,"column":20}},"5":{"start":{"line":23,"column":4},"end":{"line":38,"column":7}},"6":{"start":{"line":24,"column":26},"end":{"line":24,"column":43}},"7":{"start":{"line":25,"column":22},"end":{"line":25,"column":72}},"8":{"start":{"line":27,"column":8},"end":{"line":36,"column":9}},"9":{"start":{"line":29,"column":12},"end":{"line":35,"column":15}},"10":{"start":{"line":30,"column":32},"end":{"line":30,"column":58}},"11":{"start":{"line":31,"column":16},"end":{"line":33,"column":17}},"12":{"start":{"line":32,"column":20},"end":{"line":32,"column":39}},"13":{"start":{"line":34,"column":16},"end":{"line":34,"column":31}},"14":{"start":{"line":37,"column":8},"end":{"line":37,"column":23}},"15":{"start":{"line":39,"column":4},"end":{"line":39,"column":19}},"16":{"start":{"line":44,"column":4},"end":{"line":56,"column":5}},"17":{"start":{"line":46,"column":27},"end":{"line":46,"column":29}},"18":{"start":{"line":48,"column":12},"end":{"line":48,"column":69}},"19":{"start":{"line":49,"column":8},"end":{"line":53,"column":11}},"20":{"start":{"line":50,"column":12},"end":{"line":52,"column":13}},"21":{"start":{"line":51,"column":16},"end":{"line":51,"column":54}},"22":{"start":{"line":54,"column":8},"end":{"line":54,"column":75}},"23":{"start":{"line":55,"column":8},"end":{"line":55,"column":18}},"24":{"start":{"line":58,"column":4},"end":{"line":60,"column":5}},"25":{"start":{"line":59,"column":8},"end":{"line":59,"column":22}},"26":{"start":{"line":62,"column":4},"end":{"line":62,"column":43}},"27":{"start":{"line":64,"column":4},"end":{"line":64,"column":18}},"28":{"start":{"line":68,"column":19},"end":{"line":68,"column":21}},"29":{"start":{"line":75,"column":4},"end":{"line":95,"column":7}},"30":{"start":{"line":76,"column":8},"end":{"line":76,"column":31}},"31":{"start":{"line":77,"column":8},"end":{"line":77,"column":46}},"32":{"start":{"line":78,"column":8},"end":{"line":78,"column":36}},"33":{"start":{"line":79,"column":8},"end":{"line":94,"column":9}},"34":{"start":{"line":80,"column":12},"end":{"line":80,"column":42}},"35":{"start":{"line":81,"column":12},"end":{"line":81,"column":46}},"36":{"start":{"line":83,"column":12},"end":{"line":83,"column":86}},"37":{"start":{"line":84,"column":12},"end":{"line":87,"column":13}},"38":{"start":{"line":86,"column":16},"end":{"line":86,"column":70}},"39":{"start":{"line":89,"column":12},"end":{"line":91,"column":13}},"40":{"start":{"line":90,"column":16},"end":{"line":90,"column":76}},"41":{"start":{"line":93,"column":12},"end":{"line":93,"column":45}},"42":{"start":{"line":97,"column":4},"end":{"line":97,"column":35}},"43":{"start":{"line":101,"column":25},"end":{"line":101,"column":82}},"44":{"start":{"line":102,"column":17},"end":{"line":102,"column":104}},"45":{"start":{"line":103,"column":20},"end":{"line":103,"column":22}},"46":{"start":{"line":106,"column":4},"end":{"line":113,"column":5}},"47":{"start":{"line":107,"column":24},"end":{"line":107,"column":36}},"48":{"start":{"line":108,"column":8},"end":{"line":111,"column":9}},"49":{"start":{"line":109,"column":12},"end":{"line":109,"column":69}},"50":{"start":{"line":110,"column":12},"end":{"line":110,"column":21}},"51":{"start":{"line":112,"column":8},"end":{"line":112,"column":65}},"52":{"start":{"line":114,"column":4},"end":{"line":116,"column":5}},"53":{"start":{"line":115,"column":8},"end":{"line":115,"column":18}},"54":{"start":{"line":117,"column":4},"end":{"line":117,"column":66}},"55":{"start":{"line":118,"column":4},"end":{"line":118,"column":38}},"56":{"start":{"line":121,"column":0},"end":{"line":139,"column":2}},"57":{"start":{"line":122,"column":24},"end":{"line":122,"column":41}},"58":{"start":{"line":123,"column":18},"end":{"line":123,"column":38}},"59":{"start":{"line":124,"column":4},"end":{"line":126,"column":5}},"60":{"start":{"line":125,"column":8},"end":{"line":125,"column":23}},"61":{"start":{"line":127,"column":4},"end":{"line":129,"column":5}},"62":{"start":{"line":128,"column":8},"end":{"line":128,"column":123}},"63":{"start":{"line":130,"column":4},"end":{"line":130,"column":37}},"64":{"start":{"line":131,"column":19},"end":{"line":131,"column":63}},"65":{"start":{"line":132,"column":19},"end":{"line":132,"column":50}},"66":{"start":{"line":134,"column":4},"end":{"line":136,"column":5}},"67":{"start":{"line":135,"column":8},"end":{"line":135,"column":119}},"68":{"start":{"line":138,"column":4},"end":{"line":138,"column":30}}},"fnMap":{"0":{"name":"getSection","decl":{"start":{"line":19,"column":9},"end":{"line":19,"column":19}},"loc":{"start":{"line":19,"column":40},"end":{"line":40,"column":1}},"line":19},"1":{"name":"(anonymous_1)","decl":{"start":{"line":23,"column":15},"end":{"line":23,"column":16}},"loc":{"start":{"line":23,"column":34},"end":{"line":38,"column":5}},"line":23},"2":{"name":"(anonymous_2)","decl":{"start":{"line":29,"column":50},"end":{"line":29,"column":51}},"loc":{"start":{"line":29,"column":66},"end":{"line":35,"column":13}},"line":29},"3":{"name":"validatedConfig","decl":{"start":{"line":42,"column":9},"end":{"line":42,"column":24}},"loc":{"start":{"line":42,"column":33},"end":{"line":65,"column":1}},"line":42},"4":{"name":"(anonymous_4)","decl":{"start":{"line":49,"column":23},"end":{"line":49,"column":24}},"loc":{"start":{"line":49,"column":40},"end":{"line":53,"column":9}},"line":49},"5":{"name":"buildObj","decl":{"start":{"line":67,"column":9},"end":{"line":67,"column":17}},"loc":{"start":{"line":67,"column":27},"end":{"line":98,"column":1}},"line":67},"6":{"name":"(anonymous_6)","decl":{"start":{"line":75,"column":20},"end":{"line":75,"column":21}},"loc":{"start":{"line":75,"column":38},"end":{"line":95,"column":5}},"line":75},"7":{"name":"readEnv","decl":{"start":{"line":100,"column":9},"end":{"line":100,"column":16}},"loc":{"start":{"line":100,"column":26},"end":{"line":119,"column":1}},"line":100},"8":{"name":"(anonymous_8)","decl":{"start":{"line":121,"column":17},"end":{"line":121,"column":18}},"loc":{"start":{"line":121,"column":39},"end":{"line":139,"column":1}},"line":121}},"branchMap":{"0":{"loc":{"start":{"line":25,"column":22},"end":{"line":25,"column":72}},"type":"binary-expr","locations":[{"start":{"line":25,"column":22},"end":{"line":25,"column":40}},{"start":{"line":25,"column":44},"end":{"line":25,"column":72}}],"line":25},"1":{"loc":{"start":{"line":27,"column":8},"end":{"line":36,"column":9}},"type":"if","locations":[{"start":{"line":27,"column":8},"end":{"line":36,"column":9}},{"start":{"line":27,"column":8},"end":{"line":36,"column":9}}],"line":27},"2":{"loc":{"start":{"line":31,"column":16},"end":{"line":33,"column":17}},"type":"if","locations":[{"start":{"line":31,"column":16},"end":{"line":33,"column":17}},{"start":{"line":31,"column":16},"end":{"line":33,"column":17}}],"line":31},"3":{"loc":{"start":{"line":44,"column":4},"end":{"line":56,"column":5}},"type":"if","locations":[{"start":{"line":44,"column":4},"end":{"line":56,"column":5}},{"start":{"line":44,"column":4},"end":{"line":56,"column":5}}],"line":44},"4":{"loc":{"start":{"line":44,"column":10},"end":{"line":45,"column":51}},"type":"binary-expr","locations":[{"start":{"line":44,"column":10},"end":{"line":44,"column":21}},{"start":{"line":44,"column":25},"end":{"line":44,"column":44}},{"start":{"line":45,"column":8},"end":{"line":45,"column":28}},{"start":{"line":45,"column":32},"end":{"line":45,"column":51}}],"line":44},"5":{"loc":{"start":{"line":50,"column":12},"end":{"line":52,"column":13}},"type":"if","locations":[{"start":{"line":50,"column":12},"end":{"line":52,"column":13}},{"start":{"line":50,"column":12},"end":{"line":52,"column":13}}],"line":50},"6":{"loc":{"start":{"line":58,"column":4},"end":{"line":60,"column":5}},"type":"if","locations":[{"start":{"line":58,"column":4},"end":{"line":60,"column":5}},{"start":{"line":58,"column":4},"end":{"line":60,"column":5}}],"line":58},"7":{"loc":{"start":{"line":79,"column":8},"end":{"line":94,"column":9}},"type":"if","locations":[{"start":{"line":79,"column":8},"end":{"line":94,"column":9}},{"start":{"line":79,"column":8},"end":{"line":94,"column":9}}],"line":79},"8":{"loc":{"start":{"line":79,"column":12},"end":{"line":79,"column":36}},"type":"binary-expr","locations":[{"start":{"line":79,"column":12},"end":{"line":79,"column":22}},{"start":{"line":79,"column":26},"end":{"line":79,"column":36}}],"line":79},"9":{"loc":{"start":{"line":84,"column":12},"end":{"line":87,"column":13}},"type":"if","locations":[{"start":{"line":84,"column":12},"end":{"line":87,"column":13}},{"start":{"line":84,"column":12},"end":{"line":87,"column":13}}],"line":84},"10":{"loc":{"start":{"line":89,"column":12},"end":{"line":91,"column":13}},"type":"if","locations":[{"start":{"line":89,"column":12},"end":{"line":91,"column":13}},{"start":{"line":89,"column":12},"end":{"line":91,"column":13}}],"line":89},"11":{"loc":{"start":{"line":102,"column":17},"end":{"line":102,"column":104}},"type":"cond-expr","locations":[{"start":{"line":102,"column":53},"end":{"line":102,"column":62}},{"start":{"line":102,"column":65},"end":{"line":102,"column":104}}],"line":102},"12":{"loc":{"start":{"line":102,"column":17},"end":{"line":102,"column":50}},"type":"binary-expr","locations":[{"start":{"line":102,"column":17},"end":{"line":102,"column":25}},{"start":{"line":102,"column":29},"end":{"line":102,"column":50}}],"line":102},"13":{"loc":{"start":{"line":108,"column":8},"end":{"line":111,"column":9}},"type":"if","locations":[{"start":{"line":108,"column":8},"end":{"line":111,"column":9}},{"start":{"line":108,"column":8},"end":{"line":111,"column":9}}],"line":108},"14":{"loc":{"start":{"line":114,"column":4},"end":{"line":116,"column":5}},"type":"if","locations":[{"start":{"line":114,"column":4},"end":{"line":116,"column":5}},{"start":{"line":114,"column":4},"end":{"line":116,"column":5}}],"line":114},"15":{"loc":{"start":{"line":122,"column":24},"end":{"line":122,"column":41}},"type":"binary-expr","locations":[{"start":{"line":122,"column":24},"end":{"line":122,"column":28}},{"start":{"line":122,"column":32},"end":{"line":122,"column":41}}],"line":122},"16":{"loc":{"start":{"line":124,"column":4},"end":{"line":126,"column":5}},"type":"if","locations":[{"start":{"line":124,"column":4},"end":{"line":126,"column":5}},{"start":{"line":124,"column":4},"end":{"line":126,"column":5}}],"line":124},"17":{"loc":{"start":{"line":127,"column":4},"end":{"line":129,"column":5}},"type":"if","locations":[{"start":{"line":127,"column":4},"end":{"line":129,"column":5}},{"start":{"line":127,"column":4},"end":{"line":129,"column":5}}],"line":127},"18":{"loc":{"start":{"line":134,"column":4},"end":{"line":136,"column":5}},"type":"if","locations":[{"start":{"line":134,"column":4},"end":{"line":136,"column":5}},{"start":{"line":134,"column":4},"end":{"line":136,"column":5}}],"line":134}},"s":{"0":1,"1":1,"2":1,"3":14,"4":14,"5":14,"6":84,"7":84,"8":84,"9":14,"10":98,"11":98,"12":84,"13":98,"14":84,"15":14,"16":15,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":15,"25":1,"26":14,"27":14,"28":14,"29":14,"30":84,"31":84,"32":84,"33":84,"34":70,"35":70,"36":70,"37":70,"38":66,"39":70,"40":0,"41":70,"42":14,"43":16,"44":16,"45":16,"46":16,"47":64,"48":64,"49":60,"50":60,"51":4,"52":16,"53":15,"54":1,"55":1,"56":1,"57":16,"58":16,"59":16,"60":1,"61":15,"62":1,"63":14,"64":14,"65":14,"66":14,"67":0,"68":14},"f":{"0":14,"1":84,"2":98,"3":15,"4":0,"5":14,"6":84,"7":16,"8":16},"b":{"0":[84,24],"1":[14,70],"2":[84,14],"3":[0,15],"4":[15,15,15,15],"5":[0,0],"6":[1,14],"7":[70,14],"8":[84,70],"9":[66,4],"10":[0,70],"11":[6,10],"12":[16,16],"13":[60,4],"14":[15,1],"15":[16,6],"16":[1,15],"17":[1,14],"18":[0,14]},"_coverageSchema":"1a1c01bbd47fc00a2c39e90264f33305004495a9","hash":"fb51a993ea5a57c4ffb6d96b367f67c61ffc7ab6","contentHash":"506568ca281bd94a5da3db6f553e5bd718bc4c89b856af7b04e5c14d96f807a8"}}
@@ -0,0 +1 @@
1
+ {"parent":null,"pid":90878,"argv":["/usr/local/bin/node","/Users/miwojci/dev/akamaiopen-edgegrid-node/node_modules/mocha/bin/mocha.js","--ui","bdd","--reporter","/Applications/IntelliJ IDEA.app/Contents/plugins/nodeJS/js/mocha-intellij/lib/mochaIntellijReporter.js","/Users/miwojci/dev/akamaiopen-edgegrid-node/test/src/api_test.js"],"execArgv":[],"cwd":"/Users/miwojci/dev/akamaiopen-edgegrid-node","time":1671540219120,"ppid":90877,"coverageFilename":"/Users/miwojci/dev/akamaiopen-edgegrid-node/.nyc_output/21066c93-d856-4f8f-b120-7ff48eab0690.json","externalId":"","uuid":"21066c93-d856-4f8f-b120-7ff48eab0690","files":["/Users/miwojci/dev/akamaiopen-edgegrid-node/src/api.js","/Users/miwojci/dev/akamaiopen-edgegrid-node/src/auth.js","/Users/miwojci/dev/akamaiopen-edgegrid-node/src/helpers.js","/Users/miwojci/dev/akamaiopen-edgegrid-node/src/logger.js","/Users/miwojci/dev/akamaiopen-edgegrid-node/src/edgerc.js"]}
@@ -0,0 +1 @@
1
+ {"processes":{"21066c93-d856-4f8f-b120-7ff48eab0690":{"parent":null,"children":[]}},"files":{"/Users/miwojci/dev/akamaiopen-edgegrid-node/src/api.js":["21066c93-d856-4f8f-b120-7ff48eab0690"],"/Users/miwojci/dev/akamaiopen-edgegrid-node/src/auth.js":["21066c93-d856-4f8f-b120-7ff48eab0690"],"/Users/miwojci/dev/akamaiopen-edgegrid-node/src/helpers.js":["21066c93-d856-4f8f-b120-7ff48eab0690"],"/Users/miwojci/dev/akamaiopen-edgegrid-node/src/logger.js":["21066c93-d856-4f8f-b120-7ff48eab0690"],"/Users/miwojci/dev/akamaiopen-edgegrid-node/src/edgerc.js":["21066c93-d856-4f8f-b120-7ff48eab0690"]},"externalIds":{}}
package/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # RELEASE NOTES
2
2
 
3
+ ## 3.4.0 (Jan 26, 2023)
4
+
5
+ #### IMPROVEMENTS:
6
+ * Reads 'max_body' (alias 'max-body') field from `.edgerc` config file with default value of `131072` ([PR#1](https://github.com/akamai/AkamaiOPEN-edgegrid-node/pull/1))
7
+ * Add default Accept header (related to [PR#43](https://github.com/akamai/AkamaiOPEN-edgegrid-node/pull/43)
8
+ and [I#33](https://github.com/akamai/AkamaiOPEN-edgegrid-node/issues/33))
9
+ * Add README section explaining how to use proxy (related to [PR#35](https://github.com/akamai/AkamaiOPEN-edgegrid-node/pull/35)
10
+ and [I#59](https://github.com/akamai/AkamaiOPEN-edgegrid-node/issues/59))
11
+ * Add README section explaining how to change request encoding (related to [PR#58](https://github.com/akamai/AkamaiOPEN-edgegrid-node/pull/58))
12
+ * Update various dependencies
13
+
14
+ ## 3.3.0 (Nov 08, 2022)
15
+
16
+ #### IMPROVEMENTS:
17
+ * Update various dependencies
18
+
19
+ #### BUG FIXES
20
+ * Fix adding `User-Agent` header to the request
21
+
3
22
  ## 3.2.0 (Apr 26, 2022)
4
23
 
5
24
  #### IMPROVEMENTS:
package/README.md CHANGED
@@ -150,6 +150,62 @@ eg.auth({
150
150
  // https://akaa-baseurl-xxxxxxxxxxx-xxxxxxxxxxxxx.luna.akamaiapis.net/papi/v1/cpcodes?contractId=ctr_1234&groupId=grp_1234
151
151
  ```
152
152
 
153
+ ### Encoding
154
+
155
+ When interacting with binary data, such as during retrieval of PDF invoices, `responseType` should be specified as `arraybuffer` during the `auth` method call. Omission of `responseType` will cause an unreadable or blank response.
156
+
157
+ ```javascript
158
+ const fs = require('fs');
159
+
160
+ eg.auth({
161
+ path : `/invoicing-api/v2/contracts/${contractId}/invoices/${invoiceNumber}/files/${fileName}`,
162
+ method: 'GET',
163
+ responseType: 'arraybuffer', // Important
164
+ }).send((err, response) => {
165
+ if (err) {
166
+ return console.log(err);
167
+ }
168
+ fs.writeFile(`./${fileName}`, response.data, 'binary', (err) => {
169
+ if (err){
170
+ return console.log(err);
171
+ }
172
+ console.log('File was saved!');
173
+ });
174
+ });
175
+ ```
176
+
177
+ ### Proxy
178
+ To use edgegrid with proxy, you can configure it with `proxy` field:
179
+
180
+ ```javascript
181
+ eg.auth({
182
+ path : `/papi/v1/cpcodes`,
183
+ method: 'GET',
184
+ proxy: {
185
+ host: 'my.proxy.com',
186
+ protocol: "https",
187
+ port: 3128,
188
+ auth: {
189
+ username: 'my-user',
190
+ password: 'my-password'
191
+ }
192
+ }
193
+ }).send((err, response) => {
194
+ if (err) {
195
+ return console.log(err);
196
+ }
197
+ console.log('Success!');
198
+ // Do something with response
199
+ });
200
+ ```
201
+
202
+ or use environment variable:
203
+
204
+ ```shell
205
+ $ export https_proxy=https://username:password@host:port
206
+ $ node myapp.js
207
+ ```
208
+
153
209
  ### Debug
154
210
 
155
211
  With EdgeGrid you can enable debugging either as part of the EdgeGrid instantiation object
package/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "akamai-edgegrid",
3
- "version": "3.2.0",
3
+ "version": "3.4.0",
4
4
  "description": "Authentication handler for the Akamai OPEN EdgeGrid Authentication scheme in Node.js",
5
5
  "main": "index.js",
6
6
  "scripts": {
7
- "test": "EDGEGRID_ENV=test ./node_modules/.bin/mocha $(find test -name '*.js')"
7
+ "test": "EDGEGRID_ENV=test ./node_modules/.bin/mocha $(find test -name '*.js')",
8
+ "ci": "EDGEGRID_ENV=test MOCHA_FILE=./test/tests.xml nyc --reporter cobertura --report-dir test/coverage/ ./node_modules/.bin/mocha --reporter mocha-junit-reporter --reporter-options jenkinsMode=true --reporter-options antMode=true $(find test -name '*.js')"
8
9
  },
9
10
  "repository": {
10
11
  "type": "git",
@@ -24,13 +25,15 @@
24
25
  ],
25
26
  "license": "Apache-2.0",
26
27
  "dependencies": {
27
- "axios": "^0.26.0",
28
+ "axios": "^1.1.2",
28
29
  "log4js": "^6.4.0",
29
- "uuid": "^8.3.2"
30
+ "uuid": "^9.0.0"
30
31
  },
31
32
  "devDependencies": {
32
- "mocha": "^9.1.3",
33
+ "mocha": "^10.0.0",
34
+ "mocha-junit-reporter": "^2.1.0",
33
35
  "nock": "^13.2.2",
34
- "tsd": "^0.20.0"
36
+ "nyc": "^15.1.0",
37
+ "tsd": "^0.25.0"
35
38
  }
36
39
  }
package/src/api.js CHANGED
@@ -48,25 +48,19 @@ const EdgeGrid = function (client_token, client_secret, access_token, host, debu
48
48
  * @return EdgeGrid object (self)
49
49
  */
50
50
  EdgeGrid.prototype.auth = function (req) {
51
- let headers = {
52
- 'Content-Type': "application/json"
53
- };
54
- if (process.env['AKAMAI_CLI'] && process.env['AKAMAI_CLI_VERSION']) {
55
- headers['User-Agent'] = (headers['User-Agent'] ? headers['User-Agent'] + " " : "") + `AkamaiCLI/${process.env['AKAMAI_CLI_VERSION']}`;
56
- }
57
- if (process.env['AKAMAI_CLI_COMMAND'] && process.env['AKAMAI_CLI_COMMAND_VERSION']) {
58
- headers['User-Agent'] = (headers['User-Agent'] ? headers['User-Agent'] + " " : "") + `AkamaiCLI-${process.env['AKAMAI_CLI_COMMAND']}/${process.env['AKAMAI_CLI_COMMAND_VERSION']}`;
59
- }
60
51
  req = helpers.extend(req, {
61
52
  baseURL: this.config.host,
62
53
  url: req.path,
63
54
  method: 'GET',
64
- headers: headers,
55
+ headers: {},
65
56
  maxRedirects: 0,
66
57
  body: ''
67
58
  });
68
59
 
69
- let isTarball = req.body instanceof Uint8Array && req.headers['Content-Type'] === 'application/gzip';
60
+ req.headers = helpers.extendHeaders(req.headers);
61
+
62
+ let isTarball = req.body instanceof Uint8Array &&
63
+ (req.headers['Content-Type'] === 'application/gzip' || req.headers['Content-Type'] === 'application/tar+gzip');
70
64
 
71
65
  // Convert body object to properly formatted string
72
66
  if (req.body) {
@@ -84,7 +78,7 @@ EdgeGrid.prototype.auth = function (req) {
84
78
  this.config.access_token,
85
79
  this.config.host
86
80
  );
87
- if (req.headers['Accept'] === 'application/gzip') {
81
+ if (req.headers['Accept'] === 'application/gzip' || req.headers['Accept'] === 'application/tar+gzip') {
88
82
  this.request["responseType"] = 'arraybuffer';
89
83
  }
90
84
  return this;
package/src/auth.js CHANGED
@@ -59,7 +59,6 @@ function makeURL(host, path, queryStringObj) {
59
59
 
60
60
  module.exports = {
61
61
  generateAuth: function (request, clientToken, clientSecret, accessToken, host, maxBody, guid, timestamp) {
62
- maxBody = maxBody || 131072;
63
62
  guid = guid || uuid.v4();
64
63
  timestamp = timestamp || helpers.createTimestamp();
65
64
 
package/src/edgerc.js CHANGED
@@ -41,6 +41,8 @@ function getSection(lines, sectionName) {
41
41
 
42
42
  function validatedConfig(config) {
43
43
 
44
+ config.max_body = config.max_body || 131072
45
+
44
46
  if (!(config.host && config.access_token &&
45
47
  config.client_secret && config.client_token)) {
46
48
  let errorMessage = "";
@@ -78,6 +80,9 @@ function buildObj(configs) {
78
80
  index = config.indexOf('=');
79
81
  if (index > -1 && !isComment) {
80
82
  key = config.substr(0, index);
83
+ if (key.startsWith("max-body")) {
84
+ key = key.replace('-', '_')
85
+ }
81
86
  val = config.substring(index + 1);
82
87
  // remove inline comments
83
88
  parsedValue = val.replace(/^\s*(['"])((?:\\\1|.)*?)\1\s*(?:;.*)?$/, "$2");
package/src/helpers.js CHANGED
@@ -120,6 +120,30 @@ module.exports = {
120
120
  return a;
121
121
  },
122
122
 
123
+ extendHeaders: function (headers) {
124
+ if (!headers.hasOwnProperty('Content-Type')) {
125
+ headers['Content-Type'] = "application/json";
126
+ }
127
+ if (!headers.hasOwnProperty('Accept')) {
128
+ headers['Accept'] = "application/json";
129
+ }
130
+
131
+ let userAgents = [headers['User-Agent']];
132
+ if (process.env['AKAMAI_CLI'] && process.env['AKAMAI_CLI_VERSION']) {
133
+ userAgents.push(`AkamaiCLI/${process.env['AKAMAI_CLI_VERSION']}`);
134
+ }
135
+ if (process.env['AKAMAI_CLI_COMMAND'] && process.env['AKAMAI_CLI_COMMAND_VERSION']) {
136
+ userAgents.push(`AkamaiCLI-${process.env['AKAMAI_CLI_COMMAND']}/${process.env['AKAMAI_CLI_COMMAND_VERSION']}`);
137
+ }
138
+
139
+ userAgents = userAgents.filter(v => v)
140
+ if (userAgents.length > 0) {
141
+ headers['User-Agent'] = userAgents.join(' ')
142
+ }
143
+
144
+ return headers;
145
+ },
146
+
123
147
  isRedirect: function (statusCode) {
124
148
  return [
125
149
  300, 301, 302, 303, 307
@@ -23,7 +23,8 @@ describe('Api', function () {
23
23
  'clientToken',
24
24
  'clientSecret',
25
25
  'accessToken',
26
- 'base.com'
26
+ 'base.com',
27
+ false,
27
28
  );
28
29
  });
29
30
 
@@ -89,7 +90,98 @@ describe('Api', function () {
89
90
  assert.strictEqual(this.api.config.host, 'https://sectionexample.luna.akamaiapis.net');
90
91
  });
91
92
 
92
- describe('when it is instantiated with an object that does not specfy a section', function () {
93
+ it('reports the max-body from the edgerc associated with the specified section', function() {
94
+ assert.equal(this.api.config.max_body, 131072);
95
+ });
96
+
97
+ describe('when it is instantiated with an object with custom `max-body` value', function () {
98
+ beforeEach(function () {
99
+ this.api = new Api({
100
+ path: path.resolve(__dirname, '../test_edgerc'),
101
+ section: 'custom:max-body'
102
+ });
103
+ });
104
+
105
+ it('reports the client token from the edgerc associated with the specified section with custom `max-body`', function () {
106
+ assert.strictEqual(this.api.config.client_token, 'sectionClientToken');
107
+ });
108
+
109
+ it('reports the client secret from the edgerc associated with the specified section with custom `max-body`', function () {
110
+ assert.strictEqual(this.api.config.client_secret, 'sectionClientSecret');
111
+ });
112
+
113
+ it('reports the access token from the edgerc associated with the specified section with custom `max-body`', function () {
114
+ assert.strictEqual(this.api.config.access_token, 'sectionAccessToken');
115
+ });
116
+
117
+ it('reports the API host from the edgerc associated with the specified section with custom `max-body`', function () {
118
+ assert.strictEqual(this.api.config.host, 'https://sectionexample.luna.akamaiapis.net');
119
+ });
120
+
121
+ it('reports the max-body from the edgerc associated with the specified section with custom `max-body`', function () {
122
+ assert.equal(this.api.config.max_body, 4096);
123
+ });
124
+ });
125
+
126
+ describe('when it is instantiated with an object with custom `max_body` value', function () {
127
+ beforeEach(function () {
128
+ this.api = new Api({
129
+ path: path.resolve(__dirname, '../test_edgerc'),
130
+ section: 'custom:max_body'
131
+ });
132
+ });
133
+
134
+ it('reports the client token from the edgerc associated with the specified section with custom `max_body`', function () {
135
+ assert.strictEqual(this.api.config.client_token, 'sectionClientToken');
136
+ });
137
+
138
+ it('reports the client secret from the edgerc associated with the specified section with custom `max_body`', function () {
139
+ assert.strictEqual(this.api.config.client_secret, 'sectionClientSecret');
140
+ });
141
+
142
+ it('reports the access token from the edgerc associated with the specified section with custom `max_body`', function () {
143
+ assert.strictEqual(this.api.config.access_token, 'sectionAccessToken');
144
+ });
145
+
146
+ it('reports the API host from the edgerc associated with the specified section with custom `max_body`', function () {
147
+ assert.strictEqual(this.api.config.host, 'https://sectionexample.luna.akamaiapis.net');
148
+ });
149
+
150
+ it('reports the max-body from the edgerc associated with the specified section with custom `max_body`', function () {
151
+ assert.equal(this.api.config.max_body, 8192);
152
+ });
153
+ });
154
+
155
+ describe('when it is instantiated with an object without specified `max_body` value', function () {
156
+ beforeEach(function () {
157
+ this.api = new Api({
158
+ path: path.resolve(__dirname, '../test_edgerc'),
159
+ section: 'no-max-body'
160
+ });
161
+ });
162
+
163
+ it('reports the client token from the edgerc associated with the specified section without specified `max_body`', function () {
164
+ assert.strictEqual(this.api.config.client_token, 'sectionClientToken');
165
+ });
166
+
167
+ it('reports the client secret from the edgerc associated with the specified section without specified `max_body`', function () {
168
+ assert.strictEqual(this.api.config.client_secret, 'sectionClientSecret');
169
+ });
170
+
171
+ it('reports the access token from the edgerc associated with the specified section without specified `max_body`', function () {
172
+ assert.strictEqual(this.api.config.access_token, 'sectionAccessToken');
173
+ });
174
+
175
+ it('reports the API host from the edgerc associated with the specified section without specified `max_body`', function () {
176
+ assert.strictEqual(this.api.config.host, 'https://sectionexample.luna.akamaiapis.net');
177
+ });
178
+
179
+ it('reports the max-body from the edgerc associated with the specified section without specified `max_body`', function () {
180
+ assert.equal(this.api.config.max_body, 131072);
181
+ });
182
+ });
183
+
184
+ describe('when it is instantiated with an object that does not specify a section', function () {
93
185
  beforeEach(function () {
94
186
  this.api = new Api({
95
187
  path: path.resolve(__dirname, '../test_edgerc')
@@ -111,6 +203,10 @@ describe('Api', function () {
111
203
  it('reports the API host from the edgerc associated with the default section', function () {
112
204
  assert.strictEqual(this.api.config.host, 'https://example.luna.akamaiapis.net');
113
205
  });
206
+
207
+ it('reports the max-body from the edgerc associated with the default section', function() {
208
+ assert.equal(this.api.config.max_body, 131072);
209
+ });
114
210
  });
115
211
 
116
212
  describe('when it is instantiated with an object that does not specify a path nor a section', function () {
@@ -126,6 +222,7 @@ describe('Api', function () {
126
222
  assert.strictEqual(this.api.config.client_token, "clientToken");
127
223
  assert.strictEqual(this.api.config.client_secret, "clientSecret");
128
224
  assert.strictEqual(this.api.config.access_token, "accessToken");
225
+ assert.strictEqual(this.api.config.max_body, 131072);
129
226
  });
130
227
  });
131
228
 
@@ -175,6 +272,10 @@ describe('Api', function () {
175
272
  assert.strictEqual(this.api.request.headers['Content-Type'], 'application/json');
176
273
  });
177
274
 
275
+ it('ensures a default Accept of application/json', function () {
276
+ assert.strictEqual(this.api.request.headers['Accept'], 'application/json');
277
+ });
278
+
178
279
  it('ensures a default GET method', function () {
179
280
  assert.strictEqual(this.api.request.method, 'GET');
180
281
  });
@@ -186,6 +287,10 @@ describe('Api', function () {
186
287
  it('ensures a url is properly declared', function () {
187
288
  assert.strictEqual(this.api.request.url, 'https://base.com/foo');
188
289
  });
290
+
291
+ it('ensures no User-Agent is added when AkamaiCLI env variables not set', function () {
292
+ assert.ok(!this.api.request.headers.hasOwnProperty('User-Agent'));
293
+ });
189
294
  });
190
295
 
191
296
  describe('when more specific request options are passed', function () {
@@ -196,7 +301,11 @@ describe('Api', function () {
196
301
  body: {
197
302
  foo: 'bar'
198
303
  },
199
- somethingArbitrary: 'someValue'
304
+ somethingArbitrary: 'someValue',
305
+ headers: {
306
+ 'User-Agent': 'testUserAgent',
307
+ 'Accept': 'text/html'
308
+ }
200
309
  });
201
310
  });
202
311
 
@@ -220,14 +329,24 @@ describe('Api', function () {
220
329
  it('extends the default request options with any others specified', function () {
221
330
  assert.strictEqual(this.api.request.somethingArbitrary, 'someValue');
222
331
  });
332
+
333
+ it('ensures provided User-Agent header is preserved', function () {
334
+ assert.strictEqual(this.api.request.headers['User-Agent'], 'testUserAgent');
335
+ });
336
+
337
+ it('ensures provided Accept header is preserved', function () {
338
+ assert.strictEqual(this.api.request.headers['Accept'], 'text/html');
339
+ });
223
340
  });
224
341
 
225
342
  describe("when gzip response format is expected", function () {
226
343
  beforeEach(function () {
227
344
  this.api.auth({
228
345
  path: '/foo',
346
+ body: 'someBody',
229
347
  headers: {
230
- 'Accept': `application/gzip`
348
+ 'Accept': `application/gzip`,
349
+ 'Content-Type': `application/gzip`
231
350
  }
232
351
  });
233
352
  });
@@ -240,14 +359,114 @@ describe('Api', function () {
240
359
  assert.strictEqual(this.api.request.method, 'GET');
241
360
  });
242
361
 
243
- it('ensures a default empty body', function () {
244
- assert.strictEqual(this.api.request.body, '');
362
+ it('ensures the specified body is not modified', function () {
363
+ assert.strictEqual(this.api.request.body, 'someBody');
364
+ });
365
+
366
+ it('should return response as buffer', function () {
367
+ assert.strictEqual(this.api.request["responseType"], "arraybuffer");
368
+ });
369
+ });
370
+
371
+ describe("when tar+gzip response format is expected", function () {
372
+ beforeEach(function () {
373
+ this.api.auth({
374
+ path: '/foo',
375
+ body: 'someBody',
376
+ headers: {
377
+ 'Accept': `application/tar+gzip`,
378
+ 'Content-Type': `application/tar+gzip`
379
+ }
380
+ });
381
+ });
382
+
383
+ it('adds an Authorization header to the request it is passed', function () {
384
+ assert.strictEqual(typeof this.api.request.headers.Authorization === 'string', true);
385
+ });
386
+
387
+ it('ensures a default GET method', function () {
388
+ assert.strictEqual(this.api.request.method, 'GET');
389
+ });
390
+
391
+ it('ensures the specified body is not modified', function () {
392
+ assert.strictEqual(this.api.request.body, 'someBody');
245
393
  });
246
394
 
247
395
  it('should return response as buffer', function () {
248
396
  assert.strictEqual(this.api.request["responseType"], "arraybuffer");
249
397
  });
250
398
  });
399
+
400
+ describe("when akamai cli user agent is expected", function () {
401
+ beforeEach(function () {
402
+ process.env['AKAMAI_CLI'] = 'AkamaiCLI';
403
+ process.env['AKAMAI_CLI_VERSION'] = '1.0.0';
404
+ process.env['AKAMAI_CLI_COMMAND'] = 'command';
405
+ process.env['AKAMAI_CLI_COMMAND_VERSION'] = '0.0.1';
406
+ });
407
+
408
+ afterEach(function () {
409
+ process.env['AKAMAI_CLI'] = '';
410
+ process.env['AKAMAI_CLI_VERSION'] = '';
411
+ process.env['AKAMAI_CLI_COMMAND'] = '';
412
+ process.env['AKAMAI_CLI_COMMAND_VERSION'] = '';
413
+ });
414
+
415
+ describe("when no User-Agent set in the request", function () {
416
+ beforeEach(function () {
417
+ this.api.auth({
418
+ path: '/foo'
419
+ });
420
+ });
421
+
422
+ it("should set User-Agent", function () {
423
+ assert.strictEqual(this.api.request.headers['User-Agent'], 'AkamaiCLI/1.0.0 AkamaiCLI-command/0.0.1');
424
+ });
425
+ });
426
+
427
+ describe("when User-Agent is already in the request", function () {
428
+ beforeEach(function () {
429
+ this.api.auth({
430
+ path: '/foo',
431
+ headers: {
432
+ 'User-Agent': 'testAgent'
433
+ }
434
+ });
435
+ });
436
+
437
+ it("should append to already present User-Agent header", function () {
438
+ assert.strictEqual(this.api.request.headers['User-Agent'], 'testAgent AkamaiCLI/1.0.0 AkamaiCLI-command/0.0.1');
439
+ });
440
+ });
441
+
442
+ describe("when only AkamaiCLI info is set", function () {
443
+ beforeEach(function () {
444
+ process.env['AKAMAI_CLI_COMMAND'] = '';
445
+ process.env['AKAMAI_CLI_COMMAND_VERSION'] = '';
446
+ this.api.auth({
447
+ path: '/foo'
448
+ });
449
+ });
450
+
451
+ it("should only set AkamaiCLI/version User-Agent", function () {
452
+ assert.strictEqual(this.api.request.headers['User-Agent'], 'AkamaiCLI/1.0.0');
453
+ });
454
+ });
455
+
456
+ describe("when only AkamaiCLI command info is set", function () {
457
+ beforeEach(function () {
458
+ process.env['AKAMAI_CLI'] = '';
459
+ process.env['AKAMAI_CLI_VERSION'] = '';
460
+ this.api.auth({
461
+ path: '/foo'
462
+ });
463
+ });
464
+
465
+ it("should only set AkamaiCLI/version User-Agent", function () {
466
+ assert.strictEqual(this.api.request.headers['User-Agent'], 'AkamaiCLI-command/0.0.1');
467
+ });
468
+ });
469
+ });
251
470
  });
252
471
 
253
472
  describe('#send', function () {
@@ -23,7 +23,7 @@ describe('edgerc', function () {
23
23
  process.env['AKAMAI_CLIENT_SECRET'] = '';
24
24
  process.env['AKAMAI_ACCESS_TOKEN'] = '';
25
25
  });
26
- describe('the parsed edgrc file it returns', function () {
26
+ describe('the parsed edgerc file it returns', function () {
27
27
  describe('when it is not passed a second argument indicating config section', function () {
28
28
  beforeEach(function () {
29
29
  this.config = edgerc(path.resolve(__dirname, '../test_edgerc'));
@@ -44,6 +44,10 @@ describe('edgerc', function () {
44
44
  it('reports the default access_token', function () {
45
45
  assert.strictEqual(this.config.access_token, 'accessToken');
46
46
  });
47
+
48
+ it('reports the default max_body', function () {
49
+ assert.equal(this.config.max_body, 131072);
50
+ });
47
51
  });
48
52
 
49
53
  describe('when it is passed a second argument indicating config section', function () {
@@ -66,6 +70,62 @@ describe('edgerc', function () {
66
70
  it('reports the access_token associated with the section', function () {
67
71
  assert.strictEqual(this.config.access_token, 'sectionAccessToken');
68
72
  });
73
+
74
+ it('reports the max_body associated with the section', function () {
75
+ assert.equal(this.config.max_body, 131072);
76
+ });
77
+ });
78
+
79
+ describe('when it is passed a second argument indicating config section without specified max_body', function () {
80
+ beforeEach(function () {
81
+ this.config = edgerc(path.resolve(__dirname, '../test_edgerc'), 'no-max-body');
82
+ });
83
+
84
+ it('reports the host associated with the section without specified max_body', function () {
85
+ assert.strictEqual(this.config.host, 'https://sectionexample.luna.akamaiapis.net');
86
+ });
87
+
88
+ it('reports the client_token associated with the section without specified max_body', function () {
89
+ assert.strictEqual(this.config.client_token, 'sectionClientToken');
90
+ });
91
+
92
+ it('reports the client_secret associated with the section without specified max_body', function () {
93
+ assert.strictEqual(this.config.client_secret, 'sectionClientSecret');
94
+ });
95
+
96
+ it('reports the access_token associated with the section without specified max_body', function () {
97
+ assert.strictEqual(this.config.access_token, 'sectionAccessToken');
98
+ });
99
+
100
+ it('reports the max_body associated with the section without specified max_body', function () {
101
+ assert.equal(this.config.max_body, 131072);
102
+ });
103
+ });
104
+
105
+ describe('when it is passed a second argument indicating config section with custom `max_body` value', function () {
106
+ beforeEach(function () {
107
+ this.config = edgerc(path.resolve(__dirname, '../test_edgerc'), 'custom:max_body');
108
+ });
109
+
110
+ it('reports the host associated with the section with with custom `max_body`', function () {
111
+ assert.strictEqual(this.config.host, 'https://sectionexample.luna.akamaiapis.net');
112
+ });
113
+
114
+ it('reports the client_token associated with the section with with custom `max_body`', function () {
115
+ assert.strictEqual(this.config.client_token, 'sectionClientToken');
116
+ });
117
+
118
+ it('reports the client_secret associated with the section with with custom `max_body`', function () {
119
+ assert.strictEqual(this.config.client_secret, 'sectionClientSecret');
120
+ });
121
+
122
+ it('reports the access_token associated with the section with with custom `max_body`', function () {
123
+ assert.strictEqual(this.config.access_token, 'sectionAccessToken');
124
+ });
125
+
126
+ it('reports the max_body associated with the section with with custom `max_body`', function () {
127
+ assert.equal(this.config.max_body, 8192);
128
+ });
69
129
  });
70
130
 
71
131
  describe('when the section contains a host with the "https://" protocal specified', function () {
@@ -116,8 +176,8 @@ describe('edgerc', function () {
116
176
  this.config = edgerc();
117
177
  });
118
178
 
119
- it('has four configuration items', function () {
120
- assert.strictEqual(Object.keys(this.config).length, 4);
179
+ it('has five configuration items', function () {
180
+ assert.strictEqual(Object.keys(this.config).length, 5);
121
181
  });
122
182
 
123
183
  it('has valid config values', function () {
@@ -125,6 +185,7 @@ describe('edgerc', function () {
125
185
  assert.strictEqual(this.config.client_token, "clientToken");
126
186
  assert.strictEqual(this.config.client_secret, "clientSecret");
127
187
  assert.strictEqual(this.config.access_token, "accessToken");
188
+ assert.equal(this.config.max_body, 131072);
128
189
  });
129
190
  });
130
191
 
@@ -148,6 +209,7 @@ describe('edgerc', function () {
148
209
  assert.strictEqual(this.config.client_token, "clientToken");
149
210
  assert.strictEqual(this.config.client_secret, "clientSecret");
150
211
  assert.strictEqual(this.config.access_token, "accessToken");
212
+ assert.equal(this.config.max_body, 131072);
151
213
  });
152
214
  });
153
215
  });
@@ -124,4 +124,123 @@ describe('helpers', function () {
124
124
  assert.strictEqual(helpers.resolveHome('some/path/testdir'), "some/path/testdir");
125
125
  });
126
126
  });
127
+
128
+ describe('#extendHeaders', function () {
129
+ describe('when Content-Type is not provided', function () {
130
+ it('should set application/json as default', function () {
131
+ headers = helpers.extendHeaders({})
132
+ assert.strictEqual(headers['Content-Type'], 'application/json')
133
+ })
134
+ })
135
+
136
+ describe('when Content-Type is provided', function () {
137
+ it('should preserve the value', function () {
138
+ contentType = 'text/html'
139
+ headers = helpers.extendHeaders({
140
+ 'Content-Type': contentType
141
+ })
142
+ assert.strictEqual(headers['Content-Type'], contentType)
143
+ })
144
+ })
145
+
146
+ describe('when Accept is not provided', function () {
147
+ it('should set aapplication/json as default', function () {
148
+ headers = helpers.extendHeaders({})
149
+ assert.strictEqual(headers['Accept'], 'application/json')
150
+ })
151
+ })
152
+
153
+ describe('when Accept is provided', function () {
154
+ it('should preserve the value', function () {
155
+ accept = 'text/html'
156
+ headers = helpers.extendHeaders({
157
+ 'Accept': accept
158
+ })
159
+ assert.strictEqual(headers['Accept'], accept)
160
+ })
161
+ })
162
+
163
+ describe('when akamai cli user agent env is not provided', function () {
164
+ describe('when user agent is set in headers', function () {
165
+ it('should preserve the value and not append anything', function () {
166
+ testAgent = 'testAgent/1.0.0'
167
+ headers = helpers.extendHeaders({
168
+ 'User-Agent': testAgent
169
+ });
170
+ assert.strictEqual(headers['User-Agent'], testAgent)
171
+ });
172
+ });
173
+
174
+ describe('when no user agent is set in headers', function () {
175
+ it('should do nothing', function () {
176
+ headers = helpers.extendHeaders({})
177
+ assert.equal(headers.hasOwnProperty('User-Agent'), false)
178
+ });
179
+ });
180
+ });
181
+
182
+ describe('when akamai cli user agent env is provided', function () {
183
+ beforeEach(function () {
184
+ process.env['AKAMAI_CLI'] = 'AkamaiCLI';
185
+ process.env['AKAMAI_CLI_VERSION'] = '1.0.0';
186
+ process.env['AKAMAI_CLI_COMMAND'] = 'command';
187
+ process.env['AKAMAI_CLI_COMMAND_VERSION'] = '0.0.1';
188
+ this.akamaiCLIAgent = 'AkamaiCLI/1.0.0 AkamaiCLI-command/0.0.1'
189
+ });
190
+
191
+ afterEach(function () {
192
+ process.env['AKAMAI_CLI'] = '';
193
+ process.env['AKAMAI_CLI_VERSION'] = '';
194
+ process.env['AKAMAI_CLI_COMMAND'] = '';
195
+ process.env['AKAMAI_CLI_COMMAND_VERSION'] = '';
196
+ });
197
+
198
+ describe('when user agent is set in headers', function () {
199
+ it('should append akamaiCLI agent', function () {
200
+ testAgent = 'testAgent/1.0.0'
201
+ headers = helpers.extendHeaders({
202
+ 'User-Agent': testAgent
203
+ });
204
+ expectedAgent = testAgent + " " + this.akamaiCLIAgent
205
+ assert.strictEqual(headers['User-Agent'], expectedAgent)
206
+ });
207
+ });
208
+
209
+ describe('when no user agent is set in headers', function () {
210
+ describe('when both akamaiCLI and command env is set', function () {
211
+ it('should set two user agents', function () {
212
+ headers = helpers.extendHeaders({})
213
+ assert.strictEqual(headers['User-Agent'], this.akamaiCLIAgent)
214
+ });
215
+ });
216
+
217
+ describe("when only AkamaiCLI info is set", function () {
218
+ beforeEach(function () {
219
+ process.env['AKAMAI_CLI_COMMAND'] = '';
220
+ process.env['AKAMAI_CLI_COMMAND_VERSION'] = '';
221
+ this.akamaiCLIAgent = 'AkamaiCLI/1.0.0'
222
+ });
223
+
224
+ it("should only set AkamaiCLI/version User-Agent", function () {
225
+ headers = helpers.extendHeaders({})
226
+ assert.strictEqual(headers['User-Agent'], this.akamaiCLIAgent);
227
+ });
228
+ });
229
+
230
+ describe("when only AkamaiCLI command info is set", function () {
231
+ beforeEach(function () {
232
+ process.env['AKAMAI_CLI'] = '';
233
+ process.env['AKAMAI_CLI_VERSION'] = '';
234
+ this.akamaiCLIAgent = 'AkamaiCLI-command/0.0.1'
235
+ });
236
+
237
+ it("should only set AkamaiCLI/version User-Agent", function () {
238
+ headers = helpers.extendHeaders({})
239
+ assert.strictEqual(headers['User-Agent'], this.akamaiCLIAgent);
240
+ });
241
+ });
242
+ });
243
+
244
+ })
245
+ })
127
246
  });
package/test/test.js CHANGED
@@ -56,9 +56,24 @@ describe('Signature Generation', function () {
56
56
  });
57
57
  });
58
58
 
59
+ describe('Post uses passed-max-body', function() {
60
+ it('should return the expected string when the signing request is run.', function() {
61
+ const expected_header = "EG1-HMAC-SHA256 client_token=akab-client-token-xxx-xxxxxxxxxxxxxxxx;access_token=akab-access-token-xxx-xxxxxxxxxxxxxxxx;timestamp=20140321T19:34:21+0000;nonce=nonce-xx-xxxx-xxxx-xxxx-xxxxxxxxxxxx;signature=mGFme24S4h+eAIBD2RoyqYgwPPP2JWPwrho7Iiafqt8=";
62
+ const data = "datadatadatadatadatadatadatadata";
63
+ const request = {
64
+ //"url": "https://akaa-kax6r2oleojomqr3-q2i5ed3v35xfwe3j.luna.akamaiapis.net/billing-usage/v1/contractusagedata/contract/C-6JGLXF/6/2014",
65
+ "path": "testapi/v1/t3",
66
+ "method": "POST",
67
+ "body": data
68
+ };
69
+ test_auth = auth.generateAuth(request, client_token, client_secret, access_token, base_url, false, nonce, timestamp);
70
+ assert.equal(test_auth.headers.Authorization, expected_header);
71
+ });
72
+ });
73
+
59
74
  describe('POST inside limit', function () {
60
75
  it('should return the expected string when the signing request is run.', function () {
61
- const expected_header = "EG1-HMAC-SHA256 client_token=akab-client-token-xxx-xxxxxxxxxxxxxxxx;access_token=akab-access-token-xxx-xxxxxxxxxxxxxxxx;timestamp=20140321T19:34:21+0000;nonce=nonce-xx-xxxx-xxxx-xxxx-xxxxxxxxxxxx;signature=hXm4iCxtpN22m4cbZb4lVLW5rhX8Ca82vCFqXzSTPe4=";
76
+ const expected_header = "EG1-HMAC-SHA256 client_token=akab-client-token-xxx-xxxxxxxxxxxxxxxx;access_token=akab-access-token-xxx-xxxxxxxxxxxxxxxx;timestamp=20140321T19:34:21+0000;nonce=nonce-xx-xxxx-xxxx-xxxx-xxxxxxxxxxxx;signature=mGFme24S4h+eAIBD2RoyqYgwPPP2JWPwrho7Iiafqt8=";
62
77
  const data = "datadatadatadatadatadatadatadata";
63
78
  const request = {
64
79
  //"url": "https://akaa-kax6r2oleojomqr3-q2i5ed3v35xfwe3j.luna.akamaiapis.net/billing-usage/v1/contractusagedata/contract/C-6JGLXF/6/2014",
@@ -73,7 +88,7 @@ describe('Signature Generation', function () {
73
88
 
74
89
  describe('POST too large', function () {
75
90
  it('should return the expected string when the signing request is run.', function () {
76
- const expected_header = "EG1-HMAC-SHA256 client_token=akab-client-token-xxx-xxxxxxxxxxxxxxxx;access_token=akab-access-token-xxx-xxxxxxxxxxxxxxxx;timestamp=20140321T19:34:21+0000;nonce=nonce-xx-xxxx-xxxx-xxxx-xxxxxxxxxxxx;signature=Qevb0l2aILIipbL0DcTyjEQCfKdm8YthPULEJD3BOh8=";
91
+ const expected_header = "EG1-HMAC-SHA256 client_token=akab-client-token-xxx-xxxxxxxxxxxxxxxx;access_token=akab-access-token-xxx-xxxxxxxxxxxxxxxx;timestamp=20140321T19:34:21+0000;nonce=nonce-xx-xxxx-xxxx-xxxx-xxxxxxxxxxxx;signature=mGFme24S4h+eAIBD2RoyqYgwPPP2JWPwrho7Iiafqt8=";
77
92
  const data = fs.readFileSync(path.resolve(__dirname, 'test_body_data.txt'));
78
93
 
79
94
  const request = {
@@ -89,7 +104,7 @@ describe('Signature Generation', function () {
89
104
 
90
105
  describe('POST length equals max_body', function () {
91
106
  it('should return the expected string when the signing request is run.', function () {
92
- const expected_header = "EG1-HMAC-SHA256 client_token=akab-client-token-xxx-xxxxxxxxxxxxxxxx;access_token=akab-access-token-xxx-xxxxxxxxxxxxxxxx;timestamp=20140321T19:34:21+0000;nonce=nonce-xx-xxxx-xxxx-xxxx-xxxxxxxxxxxx;signature=6Q6PiTipLae6n4GsSIDTCJ54bEbHUBp+4MUXrbQCBoY=";
107
+ const expected_header = "EG1-HMAC-SHA256 client_token=akab-client-token-xxx-xxxxxxxxxxxxxxxx;access_token=akab-access-token-xxx-xxxxxxxxxxxxxxxx;timestamp=20140321T19:34:21+0000;nonce=nonce-xx-xxxx-xxxx-xxxx-xxxxxxxxxxxx;signature=mGFme24S4h+eAIBD2RoyqYgwPPP2JWPwrho7Iiafqt8=";
93
108
  const data = "dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd";
94
109
  const request = {
95
110
  //"url": "https://akaa-kax6r2oleojomqr3-q2i5ed3v35xfwe3j.luna.akamaiapis.net/billing-usage/v1/contractusagedata/contract/C-6JGLXF/6/2014",
@@ -27,6 +27,17 @@
27
27
  }]
28
28
  },
29
29
  "expectedAuthorization": "EG1-HMAC-SHA256 client_token=akab-client-token-xxx-xxxxxxxxxxxxxxxx;access_token=akab-access-token-xxx-xxxxxxxxxxxxxxxx;timestamp=20140321T19:34:21+0000;nonce=nonce-xx-xxxx-xxxx-xxxx-xxxxxxxxxxxx;signature=hKDH1UlnQySSHjvIcZpDMbQHihTQ0XyVAKZaApabdeA="
30
+ }, {
31
+ "testName": "Post uses passed-max-body",
32
+ "request": {
33
+ "method": "POST",
34
+ "path": "/testapi/v1/t3",
35
+ "data": "datadatadatadatadatadatadatadata",
36
+ "headers": [{
37
+ "Host": "akaa-baseurl-xxxxxxxxxxx-xxxxxxxxxxxxx.luna.akamaiapis.net"
38
+ }]
39
+ },
40
+ "expectedAuthorization": "EG1-HMAC-SHA256 client_token=akab-client-token-xxx-xxxxxxxxxxxxxxxx;access_token=akab-access-token-xxx-xxxxxxxxxxxxxxxx;timestamp=20140321T19:34:21+0000;nonce=nonce-xx-xxxx-xxxx-xxxx-xxxxxxxxxxxx;signature=hXm4iCxtpN22m4cbZb4lVLW5rhX8Ca82vCFqXzSTPe4="
30
41
  }, {
31
42
  "testName": "POST inside limit",
32
43
  "request": {
@@ -37,7 +48,7 @@
37
48
  "Host": "akaa-baseurl-xxxxxxxxxxx-xxxxxxxxxxxxx.luna.akamaiapis.net"
38
49
  }]
39
50
  },
40
- "expectedAuthorization": "EG1-HMAC-SHA256 client_token=akab-client-token-xxx-xxxxxxxxxxxxxxxx;access_token=akab-access-token-xxx-xxxxxxxxxxxxxxxx;timestamp=20140321T19:34:21+0000;nonce=nonce-xx-xxxx-xxxx-xxxx-xxxxxxxxxxxx;signature=hXm4iCxtpN22m4cbZb4lVLW5rhX8Ca82vCFqXzSTPe4="
51
+ "expectedAuthorization": "EG1-HMAC-SHA256 client_token=akab-client-token-xxx-xxxxxxxxxxxxxxxx;access_token=akab-access-token-xxx-xxxxxxxxxxxxxxxx;timestamp=20140321T19:34:21+0000;nonce=nonce-xx-xxxx-xxxx-xxxx-xxxxxxxxxxxx;signature=mGFme24S4h+eAIBD2RoyqYgwPPP2JWPwrho7Iiafqt8="
41
52
  }, {
42
53
  "testName": "POST too large",
43
54
  "request": {
package/test/test_edgerc CHANGED
@@ -12,6 +12,26 @@ client_secret = sectionClientSecret
12
12
  access_token = sectionAccessToken
13
13
  max-body = 131072
14
14
 
15
+ [custom:max-body]
16
+ host = sectionexample.luna.akamaiapis.net
17
+ client_token = sectionClientToken
18
+ client_secret = sectionClientSecret
19
+ access_token = sectionAccessToken
20
+ max-body = 4096
21
+
22
+ [custom:max_body]
23
+ host = sectionexample.luna.akamaiapis.net
24
+ client_token = sectionClientToken
25
+ client_secret = sectionClientSecret
26
+ access_token = sectionAccessToken
27
+ max_body = 8192
28
+
29
+ [no-max-body]
30
+ host = sectionexample.luna.akamaiapis.net
31
+ client_token = sectionClientToken
32
+ client_secret = sectionClientSecret
33
+ access_token = sectionAccessToken
34
+
15
35
  [https]
16
36
  host = https://example.luna.akamaiapis.net
17
37
  client_token = sectionClientToken