quankee-framework-common-ts 1.4.2 → 1.4.3

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.
@@ -1 +1 @@
1
- {"modules":[{"ast":{"type":"Program","start":0,"end":1112,"body":[{"type":"ExportNamedDeclaration","start":0,"end":217,"specifiers":[],"source":null,"attributes":[],"declaration":{"type":"FunctionDeclaration","start":7,"end":217,"async":false,"generator":false,"id":{"type":"Identifier","start":16,"end":32,"name":"injectAuthHeader"},"params":[{"type":"Identifier","start":33,"end":36,"name":"req"},{"type":"Identifier","start":38,"end":43,"name":"token"}],"body":{"type":"BlockStatement","start":45,"end":217,"body":[{"type":"IfStatement","start":51,"end":199,"test":{"type":"Identifier","start":55,"end":60,"name":"token"},"consequent":{"type":"BlockStatement","start":62,"end":199,"body":[{"type":"ReturnStatement","start":72,"end":193,"argument":{"type":"CallExpression","start":79,"end":192,"optional":false,"callee":{"type":"MemberExpression","start":79,"end":88,"computed":false,"optional":false,"object":{"type":"Identifier","start":79,"end":82,"name":"req"},"property":{"type":"Identifier","start":83,"end":88,"name":"clone"}},"arguments":[{"type":"ObjectExpression","start":89,"end":191,"properties":[{"type":"Property","start":103,"end":180,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":103,"end":113,"name":"setHeaders"},"value":{"type":"ObjectExpression","start":115,"end":180,"properties":[{"type":"Property","start":133,"end":165,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":133,"end":146,"name":"Authorization"},"value":{"type":"TemplateLiteral","start":148,"end":165,"quasis":[{"type":"TemplateElement","start":149,"end":156,"tail":false,"value":{"cooked":"Bearer ","raw":"Bearer "}},{"type":"TemplateElement","start":164,"end":164,"tail":true,"value":{"cooked":"","raw":""}}],"expressions":[{"type":"Identifier","start":158,"end":163,"name":"token"}]},"kind":"init"}]},"kind":"init"}]}]}}]},"alternate":null},{"type":"ReturnStatement","start":204,"end":215,"argument":{"type":"Identifier","start":211,"end":214,"name":"req"}}]},"expression":false}}],"_rollupRemoved":[{"end":1112,"start":218,"type":"sourcemap"}],"sourceType":"module"},"attributes":{},"code":"export function injectAuthHeader(req, token) {\n if (token) {\n return req.clone({\n setHeaders: {\n Authorization: `Bearer ${token}`,\n },\n });\n }\n return req;\n}\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidG9rZW4uaGVscGVyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvcXVhbmtlZS1mcmFtZXdvcmstaW50ZXJjZXB0b3Ivc3JjL2xpYi9jb3JlL3Rva2VuLmhlbHBlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxNQUFNLFVBQVUsZ0JBQWdCLENBQUMsR0FBUSxFQUFFLEtBQVU7SUFDbkQsSUFBSSxLQUFLLEVBQUUsQ0FBQztRQUNWLE9BQU8sR0FBRyxDQUFDLEtBQUssQ0FBQztZQUNmLFVBQVUsRUFBRTtnQkFDVixhQUFhLEVBQUUsVUFBVSxLQUFLLEVBQUU7YUFDakM7U0FDRixDQUFDLENBQUM7SUFDTCxDQUFDO0lBQ0QsT0FBTyxHQUFHLENBQUM7QUFDYixDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGZ1bmN0aW9uIGluamVjdEF1dGhIZWFkZXIocmVxOiBhbnksIHRva2VuOiBhbnkpOiBhbnkge1xyXG4gIGlmICh0b2tlbikge1xyXG4gICAgcmV0dXJuIHJlcS5jbG9uZSh7XHJcbiAgICAgIHNldEhlYWRlcnM6IHtcclxuICAgICAgICBBdXRob3JpemF0aW9uOiBgQmVhcmVyICR7dG9rZW59YCxcclxuICAgICAgfSxcclxuICAgIH0pO1xyXG4gIH1cclxuICByZXR1cm4gcmVxO1xyXG59XHJcbiJdfQ==","customTransformCache":false,"dependencies":[],"id":"C:/usr/local/workspaces/workspace-quankee/quankee-framework/quankee-framework-common-ts/dist/quankee-framework-interceptor/esm2022/lib/core/token.helper.mjs","meta":{},"moduleSideEffects":true,"originalCode":"export function injectAuthHeader(req, token) {\n if (token) {\n return req.clone({\n setHeaders: {\n Authorization: `Bearer ${token}`,\n },\n });\n }\n return req;\n}\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidG9rZW4uaGVscGVyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvcXVhbmtlZS1mcmFtZXdvcmstaW50ZXJjZXB0b3Ivc3JjL2xpYi9jb3JlL3Rva2VuLmhlbHBlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxNQUFNLFVBQVUsZ0JBQWdCLENBQUMsR0FBUSxFQUFFLEtBQVU7SUFDbkQsSUFBSSxLQUFLLEVBQUUsQ0FBQztRQUNWLE9BQU8sR0FBRyxDQUFDLEtBQUssQ0FBQztZQUNmLFVBQVUsRUFBRTtnQkFDVixhQUFhLEVBQUUsVUFBVSxLQUFLLEVBQUU7YUFDakM7U0FDRixDQUFDLENBQUM7SUFDTCxDQUFDO0lBQ0QsT0FBTyxHQUFHLENBQUM7QUFDYixDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGZ1bmN0aW9uIGluamVjdEF1dGhIZWFkZXIocmVxOiBhbnksIHRva2VuOiBhbnkpOiBhbnkge1xyXG4gIGlmICh0b2tlbikge1xyXG4gICAgcmV0dXJuIHJlcS5jbG9uZSh7XHJcbiAgICAgIHNldEhlYWRlcnM6IHtcclxuICAgICAgICBBdXRob3JpemF0aW9uOiBgQmVhcmVyICR7dG9rZW59YCxcclxuICAgICAgfSxcclxuICAgIH0pO1xyXG4gIH1cclxuICByZXR1cm4gcmVxO1xyXG59XHJcbiJdfQ==","originalSourcemap":{"version":3,"file":"token.helper.js","sourceRoot":"","sources":["../../../../../projects/quankee-framework-interceptor/src/lib/core/token.helper.ts"],"names":[],"mappings":[[[0,0,0,0],[6,0,0,6],[16,0,0,16],[32,0,0,32],[33,0,0,33],[36,0,0,41],[38,0,0,43],[43,0,0,53]],[[4,0,1,2],[8,0,1,6],[13,0,1,11],[15,0,1,13],[16,0,1,14]],[[8,0,2,4],[15,0,2,11],[18,0,2,14],[19,0,2,15],[24,0,2,20],[25,0,2,21]],[[12,0,3,6],[22,0,3,16],[24,0,3,18]],[[16,0,4,8],[29,0,4,21],[31,0,4,23],[41,0,4,33],[46,0,4,38],[48,0,4,40]],[[13,0,5,7]],[[9,0,6,5],[10,0,6,6],[11,0,6,7]],[[4,0,7,2],[5,0,7,3]],[[4,0,8,2],[11,0,8,9],[14,0,8,12],[15,0,8,13]],[[0,0,9,0],[1,0,9,1]]],"sourcesContent":["export function injectAuthHeader(req: any, token: any): any {\r\n if (token) {\r\n return req.clone({\r\n setHeaders: {\r\n Authorization: `Bearer ${token}`,\r\n },\r\n });\r\n }\r\n return req;\r\n}\r\n"]},"resolvedIds":{},"sourcemapChain":[],"syntheticNamedExports":false,"transformDependencies":[]},{"ast":{"type":"Program","start":0,"end":5214,"body":[{"type":"ImportDeclaration","start":0,"end":43,"specifiers":[{"type":"ImportSpecifier","start":9,"end":19,"imported":{"type":"Identifier","start":9,"end":19,"name":"Injectable"},"local":{"type":"Identifier","start":9,"end":19,"name":"Injectable"}}],"source":{"type":"Literal","start":27,"end":42,"value":"@angular/core","raw":"'@angular/core'"},"attributes":[]},{"type":"ImportDeclaration","start":44,"end":90,"specifiers":[{"type":"ImportSpecifier","start":53,"end":63,"imported":{"type":"Identifier","start":53,"end":63,"name":"catchError"},"local":{"type":"Identifier","start":53,"end":63,"name":"catchError"}},{"type":"ImportSpecifier","start":65,"end":75,"imported":{"type":"Identifier","start":65,"end":75,"name":"throwError"},"local":{"type":"Identifier","start":65,"end":75,"name":"throwError"}}],"source":{"type":"Literal","start":83,"end":89,"value":"rxjs","raw":"'rxjs'"},"attributes":[]},{"type":"ImportDeclaration","start":91,"end":127,"specifiers":[{"type":"ImportNamespaceSpecifier","start":98,"end":105,"local":{"type":"Identifier","start":103,"end":105,"name":"i0"}}],"source":{"type":"Literal","start":111,"end":126,"value":"@angular/core","raw":"\"@angular/core\""},"attributes":[]},{"type":"ImportDeclaration","start":128,"end":177,"specifiers":[{"type":"ImportNamespaceSpecifier","start":135,"end":142,"local":{"type":"Identifier","start":140,"end":142,"name":"i1"}}],"source":{"type":"Literal","start":148,"end":176,"value":"quankee-framework-keycloak","raw":"\"quankee-framework-keycloak\""},"attributes":[]},{"type":"ExportNamedDeclaration","start":178,"end":1500,"specifiers":[],"source":null,"attributes":[],"declaration":{"type":"ClassDeclaration","start":185,"end":1500,"decorators":[],"id":{"type":"Identifier","start":191,"end":215,"name":"AuthorizationInterceptor"},"superClass":null,"body":{"type":"ClassBody","start":216,"end":1500,"body":[{"type":"PropertyDefinition","start":222,"end":238,"static":false,"computed":false,"decorators":[],"key":{"type":"Identifier","start":222,"end":237,"name":"keycloakService"},"value":null},{"type":"MethodDefinition","start":243,"end":327,"static":false,"computed":false,"decorators":[],"key":{"type":"Identifier","start":243,"end":254,"name":"constructor"},"value":{"type":"FunctionExpression","start":254,"end":327,"async":false,"generator":false,"id":null,"params":[{"type":"Identifier","start":255,"end":270,"name":"keycloakService"}],"body":{"type":"BlockStatement","start":272,"end":327,"body":[{"type":"ExpressionStatement","start":282,"end":321,"expression":{"type":"AssignmentExpression","start":282,"end":320,"operator":"=","left":{"type":"MemberExpression","start":282,"end":302,"computed":false,"optional":false,"object":{"type":"ThisExpression","start":282,"end":286},"property":{"type":"Identifier","start":287,"end":302,"name":"keycloakService"}},"right":{"type":"Identifier","start":305,"end":320,"name":"keycloakService"}}}]},"expression":false},"kind":"constructor"},{"type":"MethodDefinition","start":332,"end":1150,"static":false,"computed":false,"decorators":[],"key":{"type":"Identifier","start":332,"end":341,"name":"intercept"},"value":{"type":"FunctionExpression","start":341,"end":1150,"async":false,"generator":false,"id":null,"params":[{"type":"Identifier","start":342,"end":345,"name":"req"},{"type":"Identifier","start":347,"end":351,"name":"next"}],"body":{"type":"BlockStatement","start":353,"end":1150,"body":[{"type":"ExpressionStatement","start":363,"end":405,"expression":{"type":"CallExpression","start":363,"end":404,"optional":false,"callee":{"type":"MemberExpression","start":363,"end":374,"computed":false,"optional":false,"object":{"type":"Identifier","start":363,"end":370,"name":"console"},"property":{"type":"Identifier","start":371,"end":374,"name":"log"}},"arguments":[{"type":"Literal","start":375,"end":403,"value":"[Interceptor] Executing...","raw":"'[Interceptor] Executing...'"}]}},{"type":"VariableDeclaration","start":414,"end":460,"kind":"const","declarations":[{"type":"VariableDeclarator","start":420,"end":459,"id":{"type":"Identifier","start":420,"end":425,"name":"token"},"init":{"type":"CallExpression","start":428,"end":459,"optional":false,"callee":{"type":"MemberExpression","start":428,"end":457,"computed":false,"optional":false,"object":{"type":"MemberExpression","start":428,"end":448,"computed":false,"optional":false,"object":{"type":"ThisExpression","start":428,"end":432},"property":{"type":"Identifier","start":433,"end":448,"name":"keycloakService"}},"property":{"type":"Identifier","start":449,"end":457,"name":"getToken"}},"arguments":[]}}]},{"type":"ExpressionStatement","start":487,"end":542,"expression":{"type":"CallExpression","start":487,"end":541,"optional":false,"callee":{"type":"MemberExpression","start":487,"end":498,"computed":false,"optional":false,"object":{"type":"Identifier","start":487,"end":494,"name":"console"},"property":{"type":"Identifier","start":495,"end":498,"name":"log"}},"arguments":[{"type":"BinaryExpression","start":499,"end":540,"operator":"+","left":{"type":"Literal","start":499,"end":532,"value":"[Interceptor] is token found...","raw":"'[Interceptor] is token found...'"},"right":{"type":"Identifier","start":535,"end":540,"name":"token"}}]}},{"type":"VariableDeclaration","start":551,"end":569,"kind":"let","declarations":[{"type":"VariableDeclarator","start":555,"end":568,"id":{"type":"Identifier","start":555,"end":562,"name":"authReq"},"init":{"type":"Identifier","start":565,"end":568,"name":"req"}}]},{"type":"IfStatement","start":578,"end":818,"test":{"type":"Identifier","start":582,"end":587,"name":"token"},"consequent":{"type":"BlockStatement","start":589,"end":818,"body":[{"type":"ExpressionStatement","start":603,"end":655,"expression":{"type":"CallExpression","start":603,"end":654,"optional":false,"callee":{"type":"MemberExpression","start":603,"end":614,"computed":false,"optional":false,"object":{"type":"Identifier","start":603,"end":610,"name":"console"},"property":{"type":"Identifier","start":611,"end":614,"name":"log"}},"arguments":[{"type":"BinaryExpression","start":615,"end":653,"operator":"+","left":{"type":"Literal","start":615,"end":645,"value":"[Interceptor] token found...","raw":"'[Interceptor] token found...'"},"right":{"type":"Identifier","start":648,"end":653,"name":"token"}}]}},{"type":"ExpressionStatement","start":668,"end":808,"expression":{"type":"AssignmentExpression","start":668,"end":807,"operator":"=","left":{"type":"Identifier","start":668,"end":675,"name":"authReq"},"right":{"type":"CallExpression","start":678,"end":807,"optional":false,"callee":{"type":"MemberExpression","start":678,"end":687,"computed":false,"optional":false,"object":{"type":"Identifier","start":678,"end":681,"name":"req"},"property":{"type":"Identifier","start":682,"end":687,"name":"clone"}},"arguments":[{"type":"ObjectExpression","start":688,"end":806,"properties":[{"type":"Property","start":706,"end":791,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":706,"end":716,"name":"setHeaders"},"value":{"type":"ObjectExpression","start":718,"end":791,"properties":[{"type":"Property","start":740,"end":772,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":740,"end":753,"name":"Authorization"},"value":{"type":"TemplateLiteral","start":755,"end":772,"quasis":[{"type":"TemplateElement","start":756,"end":763,"tail":false,"value":{"cooked":"Bearer ","raw":"Bearer "}},{"type":"TemplateElement","start":771,"end":771,"tail":true,"value":{"cooked":"","raw":""}}],"expressions":[{"type":"Identifier","start":765,"end":770,"name":"token"}]},"kind":"init"}]},"kind":"init"}]}]}}}]},"alternate":null},{"type":"ReturnStatement","start":827,"end":1144,"argument":{"type":"CallExpression","start":834,"end":1143,"optional":false,"callee":{"type":"MemberExpression","start":834,"end":859,"computed":false,"optional":false,"object":{"type":"CallExpression","start":834,"end":854,"optional":false,"callee":{"type":"MemberExpression","start":834,"end":845,"computed":false,"optional":false,"object":{"type":"Identifier","start":834,"end":838,"name":"next"},"property":{"type":"Identifier","start":839,"end":845,"name":"handle"}},"arguments":[{"type":"Identifier","start":846,"end":853,"name":"authReq"}]},"property":{"type":"Identifier","start":855,"end":859,"name":"pipe"}},"arguments":[{"type":"CallExpression","start":860,"end":1142,"optional":false,"callee":{"type":"Identifier","start":860,"end":870,"name":"catchError"},"arguments":[{"type":"ArrowFunctionExpression","start":871,"end":1141,"async":false,"expression":false,"generator":false,"params":[{"type":"Identifier","start":872,"end":877,"name":"error"}],"body":{"type":"BlockStatement","start":882,"end":1141,"body":[{"type":"ExpressionStatement","start":896,"end":932,"expression":{"type":"CallExpression","start":896,"end":931,"optional":false,"callee":{"type":"MemberExpression","start":896,"end":909,"computed":false,"optional":false,"object":{"type":"Identifier","start":896,"end":903,"name":"console"},"property":{"type":"Identifier","start":904,"end":909,"name":"error"}},"arguments":[{"type":"Literal","start":910,"end":923,"value":"HTTP Error:","raw":"'HTTP Error:'"},{"type":"Identifier","start":925,"end":930,"name":"error"}]}},{"type":"IfStatement","start":945,"end":1087,"test":{"type":"BinaryExpression","start":949,"end":969,"operator":"===","left":{"type":"MemberExpression","start":949,"end":961,"computed":false,"optional":false,"object":{"type":"Identifier","start":949,"end":954,"name":"error"},"property":{"type":"Identifier","start":955,"end":961,"name":"status"}},"right":{"type":"Literal","start":966,"end":969,"raw":"401","value":401}},"consequent":{"type":"BlockStatement","start":971,"end":1087,"body":[{"type":"ExpressionStatement","start":1028,"end":1073,"expression":{"type":"CallExpression","start":1028,"end":1072,"optional":false,"callee":{"type":"MemberExpression","start":1028,"end":1041,"computed":false,"optional":false,"object":{"type":"Identifier","start":1028,"end":1035,"name":"console"},"property":{"type":"Identifier","start":1036,"end":1041,"name":"error"}},"arguments":[{"type":"Literal","start":1042,"end":1071,"value":"[Interceptor] Unauthorized.","raw":"'[Interceptor] Unauthorized.'"}]}}]},"alternate":null},{"type":"ReturnStatement","start":1100,"end":1131,"argument":{"type":"CallExpression","start":1107,"end":1130,"optional":false,"callee":{"type":"Identifier","start":1107,"end":1117,"name":"throwError"},"arguments":[{"type":"ArrowFunctionExpression","start":1118,"end":1129,"async":false,"expression":true,"generator":false,"params":[],"body":{"type":"Identifier","start":1124,"end":1129,"name":"error"},"id":null}]}}]},"id":null}]}]}}]},"expression":false},"kind":"method"},{"type":"PropertyDefinition","start":1155,"end":1361,"static":true,"computed":false,"decorators":[],"key":{"type":"Identifier","start":1162,"end":1166,"name":"ɵfac"},"value":{"type":"CallExpression","start":1169,"end":1360,"optional":false,"callee":{"type":"MemberExpression","start":1169,"end":1190,"computed":false,"optional":false,"object":{"type":"Identifier","start":1169,"end":1171,"name":"i0"},"property":{"type":"Identifier","start":1172,"end":1190,"name":"ɵɵngDeclareFactory"}},"arguments":[{"type":"ObjectExpression","start":1191,"end":1359,"properties":[{"type":"Property","start":1193,"end":1213,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":1193,"end":1203,"name":"minVersion"},"value":{"type":"Literal","start":1205,"end":1213,"value":"12.0.0","raw":"\"12.0.0\""},"kind":"init"},{"type":"Property","start":1215,"end":1233,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":1215,"end":1222,"name":"version"},"value":{"type":"Literal","start":1224,"end":1233,"value":"19.2.14","raw":"\"19.2.14\""},"kind":"init"},{"type":"Property","start":1235,"end":1247,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":1235,"end":1243,"name":"ngImport"},"value":{"type":"Identifier","start":1245,"end":1247,"name":"i0"},"kind":"init"},{"type":"Property","start":1249,"end":1279,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":1249,"end":1253,"name":"type"},"value":{"type":"Identifier","start":1255,"end":1279,"name":"AuthorizationInterceptor"},"kind":"init"},{"type":"Property","start":1281,"end":1318,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":1281,"end":1285,"name":"deps"},"value":{"type":"ArrayExpression","start":1287,"end":1318,"elements":[{"type":"ObjectExpression","start":1288,"end":1317,"properties":[{"type":"Property","start":1290,"end":1315,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":1290,"end":1295,"name":"token"},"value":{"type":"MemberExpression","start":1297,"end":1315,"computed":false,"optional":false,"object":{"type":"Identifier","start":1297,"end":1299,"name":"i1"},"property":{"type":"Identifier","start":1300,"end":1315,"name":"KeycloakService"}},"kind":"init"}]}]},"kind":"init"},{"type":"Property","start":1320,"end":1357,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":1320,"end":1326,"name":"target"},"value":{"type":"MemberExpression","start":1328,"end":1357,"computed":false,"optional":false,"object":{"type":"MemberExpression","start":1328,"end":1346,"computed":false,"optional":false,"object":{"type":"Identifier","start":1328,"end":1330,"name":"i0"},"property":{"type":"Identifier","start":1331,"end":1346,"name":"ɵɵFactoryTarget"}},"property":{"type":"Identifier","start":1347,"end":1357,"name":"Injectable"}},"kind":"init"}]}]}},{"type":"PropertyDefinition","start":1366,"end":1498,"static":true,"computed":false,"decorators":[],"key":{"type":"Identifier","start":1373,"end":1378,"name":"ɵprov"},"value":{"type":"CallExpression","start":1381,"end":1497,"optional":false,"callee":{"type":"MemberExpression","start":1381,"end":1405,"computed":false,"optional":false,"object":{"type":"Identifier","start":1381,"end":1383,"name":"i0"},"property":{"type":"Identifier","start":1384,"end":1405,"name":"ɵɵngDeclareInjectable"}},"arguments":[{"type":"ObjectExpression","start":1406,"end":1496,"properties":[{"type":"Property","start":1408,"end":1428,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":1408,"end":1418,"name":"minVersion"},"value":{"type":"Literal","start":1420,"end":1428,"value":"12.0.0","raw":"\"12.0.0\""},"kind":"init"},{"type":"Property","start":1430,"end":1448,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":1430,"end":1437,"name":"version"},"value":{"type":"Literal","start":1439,"end":1448,"value":"19.2.14","raw":"\"19.2.14\""},"kind":"init"},{"type":"Property","start":1450,"end":1462,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":1450,"end":1458,"name":"ngImport"},"value":{"type":"Identifier","start":1460,"end":1462,"name":"i0"},"kind":"init"},{"type":"Property","start":1464,"end":1494,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":1464,"end":1468,"name":"type"},"value":{"type":"Identifier","start":1470,"end":1494,"name":"AuthorizationInterceptor"},"kind":"init"}]}]}}]}}},{"type":"ExpressionStatement","start":1501,"end":1731,"expression":{"type":"CallExpression","start":1501,"end":1730,"optional":false,"callee":{"type":"MemberExpression","start":1501,"end":1528,"computed":false,"optional":false,"object":{"type":"Identifier","start":1501,"end":1503,"name":"i0"},"property":{"type":"Identifier","start":1504,"end":1528,"name":"ɵɵngDeclareClassMetadata"}},"arguments":[{"type":"ObjectExpression","start":1529,"end":1729,"properties":[{"type":"Property","start":1531,"end":1551,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":1531,"end":1541,"name":"minVersion"},"value":{"type":"Literal","start":1543,"end":1551,"value":"12.0.0","raw":"\"12.0.0\""},"kind":"init"},{"type":"Property","start":1553,"end":1571,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":1553,"end":1560,"name":"version"},"value":{"type":"Literal","start":1562,"end":1571,"value":"19.2.14","raw":"\"19.2.14\""},"kind":"init"},{"type":"Property","start":1573,"end":1585,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":1573,"end":1581,"name":"ngImport"},"value":{"type":"Identifier","start":1583,"end":1585,"name":"i0"},"kind":"init"},{"type":"Property","start":1587,"end":1617,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":1587,"end":1591,"name":"type"},"value":{"type":"Identifier","start":1593,"end":1617,"name":"AuthorizationInterceptor"},"kind":"init"},{"type":"Property","start":1619,"end":1673,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":1619,"end":1629,"name":"decorators"},"value":{"type":"ArrayExpression","start":1631,"end":1673,"elements":[{"type":"ObjectExpression","start":1632,"end":1672,"properties":[{"type":"Property","start":1646,"end":1662,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":1646,"end":1650,"name":"type"},"value":{"type":"Identifier","start":1652,"end":1662,"name":"Injectable"},"kind":"init"}]}]},"kind":"init"},{"type":"Property","start":1675,"end":1727,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":1675,"end":1689,"name":"ctorParameters"},"value":{"type":"ArrowFunctionExpression","start":1691,"end":1727,"async":false,"expression":true,"generator":false,"params":[],"body":{"type":"ArrayExpression","start":1697,"end":1727,"elements":[{"type":"ObjectExpression","start":1698,"end":1726,"properties":[{"type":"Property","start":1700,"end":1724,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":1700,"end":1704,"name":"type"},"value":{"type":"MemberExpression","start":1706,"end":1724,"computed":false,"optional":false,"object":{"type":"Identifier","start":1706,"end":1708,"name":"i1"},"property":{"type":"Identifier","start":1709,"end":1724,"name":"KeycloakService"}},"kind":"init"}]}]},"id":null},"kind":"init"}]}]}}],"_rollupRemoved":[{"end":5214,"start":1732,"type":"sourcemap"}],"sourceType":"module"},"attributes":{},"code":"import { Injectable } from '@angular/core';\nimport { catchError, throwError } from 'rxjs';\nimport * as i0 from \"@angular/core\";\nimport * as i1 from \"quankee-framework-keycloak\";\nexport class AuthorizationInterceptor {\n keycloakService;\n constructor(keycloakService) {\n this.keycloakService = keycloakService;\n }\n intercept(req, next) {\n console.log('[Interceptor] Executing...');\n const token = this.keycloakService.getToken(); // returns string\n console.log('[Interceptor] is token found...' + token);\n let authReq = req;\n if (token) {\n console.log('[Interceptor] token found...' + token);\n authReq = req.clone({\n setHeaders: {\n Authorization: `Bearer ${token}`,\n },\n });\n }\n return next.handle(authReq).pipe(catchError((error) => {\n console.error('HTTP Error:', error);\n if (error.status === 401) {\n // handle unauthorized\n console.error('[Interceptor] Unauthorized.');\n }\n return throwError(() => error);\n }));\n }\n static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"19.2.14\", ngImport: i0, type: AuthorizationInterceptor, deps: [{ token: i1.KeycloakService }], target: i0.ɵɵFactoryTarget.Injectable });\n static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: \"12.0.0\", version: \"19.2.14\", ngImport: i0, type: AuthorizationInterceptor });\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"19.2.14\", ngImport: i0, type: AuthorizationInterceptor, decorators: [{\n type: Injectable\n }], ctorParameters: () => [{ type: i1.KeycloakService }] });\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXV0aG9yaXphdGlvbi5pbnRlcmNlcHRvci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL3F1YW5rZWUtZnJhbWV3b3JrLWludGVyY2VwdG9yL3NyYy9saWIvY29yZS9hdXRob3JpemF0aW9uLmludGVyY2VwdG9yLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUNBLE9BQU8sRUFBQyxVQUFVLEVBQUMsTUFBTSxlQUFlLENBQUM7QUFFekMsT0FBTyxFQUFDLFVBQVUsRUFBYyxVQUFVLEVBQUMsTUFBTSxNQUFNLENBQUM7OztBQUd4RCxNQUFNLE9BQU8sd0JBQXdCO0lBRU47SUFBN0IsWUFBNkIsZUFBZ0M7UUFBaEMsb0JBQWUsR0FBZixlQUFlLENBQWlCO0lBQUcsQ0FBQztJQUVqRSxTQUFTLENBQUMsR0FBcUIsRUFBRSxJQUFpQjtRQUNoRCxPQUFPLENBQUMsR0FBRyxDQUFDLDRCQUE0QixDQUFDLENBQUM7UUFFMUMsTUFBTSxLQUFLLEdBQUcsSUFBSSxDQUFDLGVBQWUsQ0FBQyxRQUFRLEVBQUUsQ0FBQyxDQUFDLGlCQUFpQjtRQUNoRSxPQUFPLENBQUMsR0FBRyx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2VufWAsXHJcbiAgICAgICAgfSxcclxuICAgICAgfSk7XHJcbiAgICB9XHJcbiAgICByZXR1cm4gbmV4dC5oYW5kbGUoYXV0aFJlcSkucGlwZShcclxuICAgICAgICBjYXRjaEVycm9yKChlcnJvcjogSHR0cEVycm9yUmVzcG9uc2UpID0+IHtcclxuICAgICAgICAgIGNvbnNvbGUuZXJyb3IoJ0hUVFAgRXJyb3I6JywgZXJyb3IpO1xyXG4gICAgICAgICAgaWYgKGVycm9yLnN0YXR1cyA9PT0gNDAxKSB7XHJcbiAgICAgICAgICAgIC8vIGhhbmRsZSB1bmF1dGhvcml6ZWRcclxuICAgICAgICAgICAgY29uc29sZS5lcnJvcignW0ludGVyY2VwdG9yXSBVbmF1dGhvcml6ZWQuJylcclxuICAgICAgICAgIH1cclxuICAgICAgICAgIHJldHVybiB0aHJvd0Vycm9yKCgpID0+IGVycm9yKTtcclxuICAgICAgICB9KVxyXG4gICAgKTtcclxuICB9XHJcbn1cclxuIl19","customTransformCache":false,"dependencies":["@angular/core","rxjs","quankee-framework-keycloak"],"id":"C:/usr/local/workspaces/workspace-quankee/quankee-framework/quankee-framework-common-ts/dist/quankee-framework-interceptor/esm2022/lib/core/authorization.interceptor.mjs","meta":{},"moduleSideEffects":true,"originalCode":"import { Injectable } from '@angular/core';\nimport { catchError, throwError } from 'rxjs';\nimport * as i0 from \"@angular/core\";\nimport * as i1 from \"quankee-framework-keycloak\";\nexport class AuthorizationInterceptor {\n keycloakService;\n constructor(keycloakService) {\n this.keycloakService = keycloakService;\n }\n intercept(req, next) {\n console.log('[Interceptor] Executing...');\n const token = this.keycloakService.getToken(); // returns string\n console.log('[Interceptor] is token found...' + token);\n let authReq = req;\n if (token) {\n console.log('[Interceptor] token found...' + token);\n authReq = req.clone({\n setHeaders: {\n Authorization: `Bearer ${token}`,\n },\n });\n }\n return next.handle(authReq).pipe(catchError((error) => {\n console.error('HTTP Error:', error);\n if (error.status === 401) {\n // handle unauthorized\n console.error('[Interceptor] Unauthorized.');\n }\n return throwError(() => error);\n }));\n }\n static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"19.2.14\", ngImport: i0, type: AuthorizationInterceptor, deps: [{ token: i1.KeycloakService }], target: i0.ɵɵFactoryTarget.Injectable });\n static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: \"12.0.0\", version: \"19.2.14\", ngImport: i0, type: AuthorizationInterceptor });\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"19.2.14\", ngImport: i0, type: AuthorizationInterceptor, decorators: [{\n type: Injectable\n }], ctorParameters: () => [{ type: i1.KeycloakService }] });\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXV0aG9yaXphdGlvbi5pbnRlcmNlcHRvci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL3F1YW5rZWUtZnJhbWV3b3JrLWludGVyY2VwdG9yL3NyYy9saWIvY29yZS9hdXRob3JpemF0aW9uLmludGVyY2VwdG9yLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUNBLE9BQU8sRUFBQyxVQUFVLEVBQUMsTUFBTSxlQUFlLENBQUM7QUFFekMsT0FBTyxFQUFDLFVBQVUsRUFBYyxVQUFVLEVBQUMsTUFBTSxNQUFNLENBQUM7OztBQUd4RCxNQUFNLE9BQU8sd0JBQXdCO0lBRU47SUFBN0IsWUFBNkIsZUFBZ0M7UUFBaEMsb0JBQWUsR0FBZixlQUFlLENBQWlCO0lBQUcsQ0FBQztJQUVqRSxTQUFTLENBQUMsR0FBcUIsRUFBRSxJQUFpQjtRQUNoRCxPQUFPLENBQUMsR0FBRyxDQUFDLDRCQUE0QixDQUFDLENBQUM7UUFFMUMsTUFBTSxLQUFLLEdBQUcsSUFBSSxDQUFDLGVBQWUsQ0FBQyxRQUFRLEVBQUUsQ0FBQyxDQUFDLGl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AgQXV0aG9yaXphdGlvbjogYEJlYXJlciAke3Rva2VufWAsXHJcbiAgICAgICAgfSxcclxuICAgICAgfSk7XHJcbiAgICB9XHJcbiAgICByZXR1cm4gbmV4dC5oYW5kbGUoYXV0aFJlcSkucGlwZShcclxuICAgICAgICBjYXRjaEVycm9yKChlcnJvcjogSHR0cEVycm9yUmVzcG9uc2UpID0+IHtcclxuICAgICAgICAgIGNvbnNvbGUuZXJyb3IoJ0hUVFAgRXJyb3I6JywgZXJyb3IpO1xyXG4gICAgICAgICAgaWYgKGVycm9yLnN0YXR1cyA9PT0gNDAxKSB7XHJcbiAgICAgICAgICAgIC8vIGhhbmRsZSB1bmF1dGhvcml6ZWRcclxuICAgICAgICAgICAgY29uc29sZS5lcnJvcignW0ludGVyY2VwdG9yXSBVbmF1dGhvcml6ZWQuJylcclxuICAgICAgICAgIH1cclxuICAgICAgICAgIHJldHVybiB0aHJvd0Vycm9yKCgpID0+IGVycm9yKTtcclxuICAgICAgICB9KVxyXG4gICAgKTtcclxuICB9XHJcbn1cclxuIl19","originalSourcemap":{"version":3,"file":"authorization.interceptor.js","sourceRoot":"","sources":["../../../../../projects/quankee-framework-interceptor/src/lib/core/authorization.interceptor.ts"],"names":[],"mappings":[[[0,0,1,0],[7,0,1,7],[9,0,1,8],[19,0,1,18],[21,0,1,19],[27,0,1,25],[42,0,1,40],[43,0,1,41]],[[0,0,3,0],[7,0,3,7],[9,0,3,8],[19,0,3,18],[21,0,3,32],[31,0,3,42],[33,0,3,43],[39,0,3,49],[45,0,3,55],[46,0,3,56]],[],[],[[0,0,6,0],[6,0,6,6],[13,0,6,13],[37,0,6,37]],[[4,0,8,31]],[[4,0,8,2],[16,0,8,31],[31,0,8,63]],[[8,0,8,31],[28,0,8,46],[31,0,8,31],[46,0,8,46],[47,0,8,63]],[[4,0,8,66],[5,0,8,67]],[[4,0,10,2],[13,0,10,11],[14,0,10,12],[17,0,10,33],[19,0,10,35],[23,0,10,52]],[[8,0,11,4],[15,0,11,11],[16,0,11,12],[19,0,11,15],[20,0,11,16],[48,0,11,44],[49,0,11,45],[50,0,11,46]],[[8,0,13,4],[14,0,13,10],[19,0,13,15],[22,0,13,18],[26,0,13,22],[27,0,13,23],[42,0,13,38],[43,0,13,39],[51,0,13,47],[53,0,13,49],[54,0,13,50],[55,0,13,51],[72,0,13,68]],[[8,0,14,4],[15,0,14,11],[16,0,14,12],[19,0,14,15],[20,0,14,16],[53,0,14,49],[56,0,14,52],[61,0,14,57],[62,0,14,58],[63,0,14,59]],[[8,0,15,4],[12,0,15,8],[19,0,15,15],[22,0,15,18],[25,0,15,21],[26,0,15,22]],[[8,0,17,4],[12,0,17,8],[17,0,17,13],[19,0,17,15],[20,0,17,16]],[[12,0,18,6],[19,0,18,13],[20,0,18,14],[23,0,18,17],[24,0,18,18],[54,0,18,48],[57,0,18,51],[62,0,18,56],[63,0,18,57],[64,0,18,58]],[[12,0,19,6],[19,0,19,13],[22,0,19,16],[25,0,19,19],[26,0,19,20],[31,0,19,25],[32,0,19,26]],[[16,0,20,8],[26,0,20,18],[28,0,20,20]],[[20,0,21,10],[33,0,21,23],[35,0,21,25],[45,0,21,35],[50,0,21,40],[52,0,21,42]],[[17,0,22,9]],[[13,0,23,7],[14,0,23,8],[15,0,23,9]],[[8,0,24,4],[9,0,24,5]],[[8,0,25,4],[15,0,25,11],[19,0,25,15],[20,0,25,16],[26,0,25,22],[27,0,25,23],[34,0,25,30],[35,0,25,31],[36,0,25,32],[40,0,25,36],[41,0,26,8],[51,0,26,18],[52,0,26,19],[53,0,26,20],[58,0,26,44],[60,0,26,46],[62,0,26,48]],[[12,0,27,10],[19,0,27,17],[20,0,27,18],[25,0,27,23],[26,0,27,24],[39,0,27,37],[41,0,27,39],[46,0,27,44],[47,0,27,45],[48,0,27,46]],[[12,0,28,10],[16,0,28,14],[21,0,28,19],[22,0,28,20],[28,0,28,26],[33,0,28,31],[36,0,28,34],[38,0,28,36],[39,0,28,37]],[[16,0,29,12],[38,0,29,34]],[[16,0,30,12],[23,0,30,19],[24,0,30,20],[29,0,30,25],[30,0,30,26],[59,0,30,55],[60,0,30,56],[61,0,30,56]],[[12,0,31,10],[13,0,31,11]],[[12,0,32,10],[19,0,32,17],[29,0,32,27],[30,0,32,28],[33,0,32,31],[35,0,32,33],[36,0,32,34],[41,0,32,39],[42,0,32,40],[43,0,32,41]],[[8,0,33,8],[9,0,33,9],[10,0,33,10],[11,0,34,5],[12,0,34,6]],[[4,0,35,2],[5,0,35,3]],[[104,0,6,13],[128,0,6,37]],[[108,0,6,13],[132,0,6,37]],[],[[92,0,6,13],[116,0,6,37]],[[18,0,5,1],[28,0,5,11]]],"sourcesContent":["import {HttpErrorResponse, HttpEvent, HttpHandler, HttpInterceptor, HttpRequest} from '@angular/common/http';\r\nimport {Injectable} from '@angular/core';\r\nimport {KeycloakService} from 'quankee-framework-keycloak';\r\nimport {catchError, Observable, throwError} from 'rxjs';\r\n\r\n@Injectable()\r\nexport class AuthorizationInterceptor implements HttpInterceptor {\r\n\r\n constructor(private readonly keycloakService: KeycloakService) {}\r\n\r\n intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {\r\n console.log('[Interceptor] Executing...');\r\n\r\n const token = this.keycloakService.getToken(); // returns string\r\n console.log('[Interceptor] is token found...' + token);\r\n let authReq = req;\r\n\r\n if (token) {\r\n console.log('[Interceptor] token found...' + token);\r\n authReq = req.clone({\r\n setHeaders: {\r\n Authorization: `Bearer ${token}`,\r\n },\r\n });\r\n }\r\n return next.handle(authReq).pipe(\r\n catchError((error: HttpErrorResponse) => {\r\n console.error('HTTP Error:', error);\r\n if (error.status === 401) {\r\n // handle unauthorized\r\n console.error('[Interceptor] Unauthorized.')\r\n }\r\n return throwError(() => error);\r\n })\r\n );\r\n }\r\n}\r\n"]},"resolvedIds":{"@angular/core":{"attributes":{},"external":true,"id":"@angular/core","meta":{},"moduleSideEffects":true,"resolvedBy":"rollup","syntheticNamedExports":false},"rxjs":{"attributes":{},"external":true,"id":"rxjs","meta":{},"moduleSideEffects":true,"resolvedBy":"rollup","syntheticNamedExports":false},"quankee-framework-keycloak":{"attributes":{},"external":true,"id":"quankee-framework-keycloak","meta":{},"moduleSideEffects":true,"resolvedBy":"rollup","syntheticNamedExports":false}},"sourcemapChain":[],"syntheticNamedExports":false,"transformDependencies":[]},{"ast":{"type":"Program","start":0,"end":755,"body":[{"type":"ExportAllDeclaration","start":62,"end":102,"exported":null,"source":{"type":"Literal","start":76,"end":101,"value":"./lib/core/token.helper","raw":"'./lib/core/token.helper'"},"attributes":[]},{"type":"ExportAllDeclaration","start":103,"end":156,"exported":null,"source":{"type":"Literal","start":117,"end":155,"value":"./lib/core/authorization.interceptor","raw":"'./lib/core/authorization.interceptor'"},"attributes":[]}],"_rollupRemoved":[{"end":755,"start":157,"type":"sourcemap"}],"sourceType":"module"},"attributes":{},"code":"/*\n * Public API Surface of quankee-framework-interceptor\n */\nexport * from './lib/core/token.helper';\nexport * from './lib/core/authorization.interceptor';\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljLWFwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3Byb2plY3RzL3F1YW5rZWUtZnJhbWV3b3JrLWludGVyY2VwdG9yL3NyYy9wdWJsaWMtYXBpLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBRUgsY0FBYyx5QkFBeUIsQ0FBQztBQUN4QyxjQUFjLHNDQUFzQyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLypcclxuICogUHVibGljIEFQSSBTdXJmYWNlIG9mIHF1YW5rZWUtZnJhbWV3b3JrLWludGVyY2VwdG9yXHJcbiAqL1xyXG5cclxuZXhwb3J0ICogZnJvbSAnLi9saWIvY29yZS90b2tlbi5oZWxwZXInO1xyXG5leHBvcnQgKiBmcm9tICcuL2xpYi9jb3JlL2F1dGhvcml6YXRpb24uaW50ZXJjZXB0b3InO1xyXG4iXX0=","customTransformCache":false,"dependencies":["C:/usr/local/workspaces/workspace-quankee/quankee-framework/quankee-framework-common-ts/dist/quankee-framework-interceptor/esm2022/lib/core/token.helper.mjs","C:/usr/local/workspaces/workspace-quankee/quankee-framework/quankee-framework-common-ts/dist/quankee-framework-interceptor/esm2022/lib/core/authorization.interceptor.mjs"],"id":"C:/usr/local/workspaces/workspace-quankee/quankee-framework/quankee-framework-common-ts/dist/quankee-framework-interceptor/esm2022/public-api.mjs","meta":{},"moduleSideEffects":true,"originalCode":"/*\n * Public API Surface of quankee-framework-interceptor\n */\nexport * from './lib/core/token.helper';\nexport * from './lib/core/authorization.interceptor';\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljLWFwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3Byb2plY3RzL3F1YW5rZWUtZnJhbWV3b3JrLWludGVyY2VwdG9yL3NyYy9wdWJsaWMtYXBpLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBRUgsY0FBYyx5QkFBeUIsQ0FBQztBQUN4QyxjQUFjLHNDQUFzQyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLypcclxuICogUHVibGljIEFQSSBTdXJmYWNlIG9mIHF1YW5rZWUtZnJhbWV3b3JrLWludGVyY2VwdG9yXHJcbiAqL1xyXG5cclxuZXhwb3J0ICogZnJvbSAnLi9saWIvY29yZS90b2tlbi5oZWxwZXInO1xyXG5leHBvcnQgKiBmcm9tICcuL2xpYi9jb3JlL2F1dGhvcml6YXRpb24uaW50ZXJjZXB0b3InO1xyXG4iXX0=","originalSourcemap":{"version":3,"file":"public-api.js","sourceRoot":"","sources":["../../../projects/quankee-framework-interceptor/src/public-api.ts"],"names":[],"mappings":[[[0,0,0,0]],[],[[3,0,2,3]],[[0,0,4,0],[14,0,4,14],[39,0,4,39],[40,0,4,40]],[[0,0,5,0],[14,0,5,14],[52,0,5,52],[53,0,5,53]]],"sourcesContent":["/*\r\n * Public API Surface of quankee-framework-interceptor\r\n */\r\n\r\nexport * from './lib/core/token.helper';\r\nexport * from './lib/core/authorization.interceptor';\r\n"]},"resolvedIds":{"./lib/core/token.helper":{"attributes":{},"external":false,"id":"C:/usr/local/workspaces/workspace-quankee/quankee-framework/quankee-framework-common-ts/dist/quankee-framework-interceptor/esm2022/lib/core/token.helper.mjs","meta":{},"moduleSideEffects":true,"resolvedBy":"file-loader","syntheticNamedExports":false},"./lib/core/authorization.interceptor":{"attributes":{},"external":false,"id":"C:/usr/local/workspaces/workspace-quankee/quankee-framework/quankee-framework-common-ts/dist/quankee-framework-interceptor/esm2022/lib/core/authorization.interceptor.mjs","meta":{},"moduleSideEffects":true,"resolvedBy":"file-loader","syntheticNamedExports":false}},"sourcemapChain":[],"syntheticNamedExports":false,"transformDependencies":[]},{"ast":{"type":"Program","start":0,"end":572,"body":[{"type":"ExportAllDeclaration","start":48,"end":77,"exported":null,"source":{"type":"Literal","start":62,"end":76,"value":"./public-api","raw":"'./public-api'"},"attributes":[]}],"_rollupRemoved":[{"end":572,"start":78,"type":"sourcemap"}],"sourceType":"module"},"attributes":{},"code":"/**\n * Generated bundle index. Do not edit.\n */\nexport * from './public-api';\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicXVhbmtlZS1mcmFtZXdvcmstaW50ZXJjZXB0b3IuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9wcm9qZWN0cy9xdWFua2VlLWZyYW1ld29yay1pbnRlcmNlcHRvci9zcmMvcXVhbmtlZS1mcmFtZXdvcmstaW50ZXJjZXB0b3IudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7O0dBRUc7QUFFSCxjQUFjLGNBQWMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogR2VuZXJhdGVkIGJ1bmRsZSBpbmRleC4gRG8gbm90IGVkaXQuXG4gKi9cblxuZXhwb3J0ICogZnJvbSAnLi9wdWJsaWMtYXBpJztcbiJdfQ==","customTransformCache":false,"dependencies":["C:/usr/local/workspaces/workspace-quankee/quankee-framework/quankee-framework-common-ts/dist/quankee-framework-interceptor/esm2022/public-api.mjs"],"id":"C:\\usr\\local\\workspaces\\workspace-quankee\\quankee-framework\\quankee-framework-common-ts\\dist\\quankee-framework-interceptor\\esm2022\\quankee-framework-interceptor.mjs","meta":{},"moduleSideEffects":true,"originalCode":"/**\n * Generated bundle index. Do not edit.\n */\nexport * from './public-api';\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicXVhbmtlZS1mcmFtZXdvcmstaW50ZXJjZXB0b3IuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9wcm9qZWN0cy9xdWFua2VlLWZyYW1ld29yay1pbnRlcmNlcHRvci9zcmMvcXVhbmtlZS1mcmFtZXdvcmstaW50ZXJjZXB0b3IudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7O0dBRUc7QUFFSCxjQUFjLGNBQWMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogR2VuZXJhdGVkIGJ1bmRsZSBpbmRleC4gRG8gbm90IGVkaXQuXG4gKi9cblxuZXhwb3J0ICogZnJvbSAnLi9wdWJsaWMtYXBpJztcbiJdfQ==","originalSourcemap":{"version":3,"file":"quankee-framework-interceptor.js","sourceRoot":"","sources":["../../../projects/quankee-framework-interceptor/src/quankee-framework-interceptor.ts"],"names":[],"mappings":[[[0,0,0,0]],[],[[3,0,2,3]],[[0,0,4,0],[14,0,4,14],[28,0,4,28],[29,0,4,29]]],"sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"]},"resolvedIds":{"./public-api":{"attributes":{},"external":false,"id":"C:/usr/local/workspaces/workspace-quankee/quankee-framework/quankee-framework-common-ts/dist/quankee-framework-interceptor/esm2022/public-api.mjs","meta":{},"moduleSideEffects":true,"resolvedBy":"file-loader","syntheticNamedExports":false}},"sourcemapChain":[],"syntheticNamedExports":false,"transformDependencies":[]}],"plugins":{"file-loader":{},"json":{}}}
1
+ {"modules":[{"ast":{"type":"Program","start":0,"end":1112,"body":[{"type":"ExportNamedDeclaration","start":0,"end":217,"specifiers":[],"source":null,"attributes":[],"declaration":{"type":"FunctionDeclaration","start":7,"end":217,"async":false,"generator":false,"id":{"type":"Identifier","start":16,"end":32,"name":"injectAuthHeader"},"params":[{"type":"Identifier","start":33,"end":36,"name":"req"},{"type":"Identifier","start":38,"end":43,"name":"token"}],"body":{"type":"BlockStatement","start":45,"end":217,"body":[{"type":"IfStatement","start":51,"end":199,"test":{"type":"Identifier","start":55,"end":60,"name":"token"},"consequent":{"type":"BlockStatement","start":62,"end":199,"body":[{"type":"ReturnStatement","start":72,"end":193,"argument":{"type":"CallExpression","start":79,"end":192,"optional":false,"callee":{"type":"MemberExpression","start":79,"end":88,"computed":false,"optional":false,"object":{"type":"Identifier","start":79,"end":82,"name":"req"},"property":{"type":"Identifier","start":83,"end":88,"name":"clone"}},"arguments":[{"type":"ObjectExpression","start":89,"end":191,"properties":[{"type":"Property","start":103,"end":180,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":103,"end":113,"name":"setHeaders"},"value":{"type":"ObjectExpression","start":115,"end":180,"properties":[{"type":"Property","start":133,"end":165,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":133,"end":146,"name":"Authorization"},"value":{"type":"TemplateLiteral","start":148,"end":165,"quasis":[{"type":"TemplateElement","start":149,"end":156,"tail":false,"value":{"cooked":"Bearer ","raw":"Bearer "}},{"type":"TemplateElement","start":164,"end":164,"tail":true,"value":{"cooked":"","raw":""}}],"expressions":[{"type":"Identifier","start":158,"end":163,"name":"token"}]},"kind":"init"}]},"kind":"init"}]}]}}]},"alternate":null},{"type":"ReturnStatement","start":204,"end":215,"argument":{"type":"Identifier","start":211,"end":214,"name":"req"}}]},"expression":false}}],"_rollupRemoved":[{"end":1112,"start":218,"type":"sourcemap"}],"sourceType":"module"},"attributes":{},"code":"export function injectAuthHeader(req, token) {\n if (token) {\n return req.clone({\n setHeaders: {\n Authorization: `Bearer ${token}`,\n },\n });\n }\n return req;\n}\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidG9rZW4uaGVscGVyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvcXVhbmtlZS1mcmFtZXdvcmstaW50ZXJjZXB0b3Ivc3JjL2xpYi9jb3JlL3Rva2VuLmhlbHBlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxNQUFNLFVBQVUsZ0JBQWdCLENBQUMsR0FBUSxFQUFFLEtBQVU7SUFDbkQsSUFBSSxLQUFLLEVBQUUsQ0FBQztRQUNWLE9BQU8sR0FBRyxDQUFDLEtBQUssQ0FBQztZQUNmLFVBQVUsRUFBRTtnQkFDVixhQUFhLEVBQUUsVUFBVSxLQUFLLEVBQUU7YUFDakM7U0FDRixDQUFDLENBQUM7SUFDTCxDQUFDO0lBQ0QsT0FBTyxHQUFHLENBQUM7QUFDYixDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGZ1bmN0aW9uIGluamVjdEF1dGhIZWFkZXIocmVxOiBhbnksIHRva2VuOiBhbnkpOiBhbnkge1xyXG4gIGlmICh0b2tlbikge1xyXG4gICAgcmV0dXJuIHJlcS5jbG9uZSh7XHJcbiAgICAgIHNldEhlYWRlcnM6IHtcclxuICAgICAgICBBdXRob3JpemF0aW9uOiBgQmVhcmVyICR7dG9rZW59YCxcclxuICAgICAgfSxcclxuICAgIH0pO1xyXG4gIH1cclxuICByZXR1cm4gcmVxO1xyXG59XHJcbiJdfQ==","customTransformCache":false,"dependencies":[],"id":"C:/usr/local/workspaces/workspace-quankee/quankee-framework/quankee-framework-common-ts/dist/quankee-framework-interceptor/esm2022/lib/core/token.helper.mjs","meta":{},"moduleSideEffects":true,"originalCode":"export function injectAuthHeader(req, token) {\n if (token) {\n return req.clone({\n setHeaders: {\n Authorization: `Bearer ${token}`,\n },\n });\n }\n return req;\n}\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidG9rZW4uaGVscGVyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvcXVhbmtlZS1mcmFtZXdvcmstaW50ZXJjZXB0b3Ivc3JjL2xpYi9jb3JlL3Rva2VuLmhlbHBlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxNQUFNLFVBQVUsZ0JBQWdCLENBQUMsR0FBUSxFQUFFLEtBQVU7SUFDbkQsSUFBSSxLQUFLLEVBQUUsQ0FBQztRQUNWLE9BQU8sR0FBRyxDQUFDLEtBQUssQ0FBQztZQUNmLFVBQVUsRUFBRTtnQkFDVixhQUFhLEVBQUUsVUFBVSxLQUFLLEVBQUU7YUFDakM7U0FDRixDQUFDLENBQUM7SUFDTCxDQUFDO0lBQ0QsT0FBTyxHQUFHLENBQUM7QUFDYixDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGZ1bmN0aW9uIGluamVjdEF1dGhIZWFkZXIocmVxOiBhbnksIHRva2VuOiBhbnkpOiBhbnkge1xyXG4gIGlmICh0b2tlbikge1xyXG4gICAgcmV0dXJuIHJlcS5jbG9uZSh7XHJcbiAgICAgIHNldEhlYWRlcnM6IHtcclxuICAgICAgICBBdXRob3JpemF0aW9uOiBgQmVhcmVyICR7dG9rZW59YCxcclxuICAgICAgfSxcclxuICAgIH0pO1xyXG4gIH1cclxuICByZXR1cm4gcmVxO1xyXG59XHJcbiJdfQ==","originalSourcemap":{"version":3,"file":"token.helper.js","sourceRoot":"","sources":["../../../../../projects/quankee-framework-interceptor/src/lib/core/token.helper.ts"],"names":[],"mappings":[[[0,0,0,0],[6,0,0,6],[16,0,0,16],[32,0,0,32],[33,0,0,33],[36,0,0,41],[38,0,0,43],[43,0,0,53]],[[4,0,1,2],[8,0,1,6],[13,0,1,11],[15,0,1,13],[16,0,1,14]],[[8,0,2,4],[15,0,2,11],[18,0,2,14],[19,0,2,15],[24,0,2,20],[25,0,2,21]],[[12,0,3,6],[22,0,3,16],[24,0,3,18]],[[16,0,4,8],[29,0,4,21],[31,0,4,23],[41,0,4,33],[46,0,4,38],[48,0,4,40]],[[13,0,5,7]],[[9,0,6,5],[10,0,6,6],[11,0,6,7]],[[4,0,7,2],[5,0,7,3]],[[4,0,8,2],[11,0,8,9],[14,0,8,12],[15,0,8,13]],[[0,0,9,0],[1,0,9,1]]],"sourcesContent":["export function injectAuthHeader(req: any, token: any): any {\r\n if (token) {\r\n return req.clone({\r\n setHeaders: {\r\n Authorization: `Bearer ${token}`,\r\n },\r\n });\r\n }\r\n return req;\r\n}\r\n"]},"resolvedIds":{},"sourcemapChain":[],"syntheticNamedExports":false,"transformDependencies":[]},{"ast":{"type":"Program","start":0,"end":5579,"body":[{"type":"ImportDeclaration","start":0,"end":43,"specifiers":[{"type":"ImportSpecifier","start":9,"end":19,"imported":{"type":"Identifier","start":9,"end":19,"name":"Injectable"},"local":{"type":"Identifier","start":9,"end":19,"name":"Injectable"}}],"source":{"type":"Literal","start":27,"end":42,"value":"@angular/core","raw":"'@angular/core'"},"attributes":[]},{"type":"ImportDeclaration","start":44,"end":107,"specifiers":[{"type":"ImportSpecifier","start":53,"end":63,"imported":{"type":"Identifier","start":53,"end":63,"name":"catchError"},"local":{"type":"Identifier","start":53,"end":63,"name":"catchError"}},{"type":"ImportSpecifier","start":65,"end":69,"imported":{"type":"Identifier","start":65,"end":69,"name":"from"},"local":{"type":"Identifier","start":65,"end":69,"name":"from"}},{"type":"ImportSpecifier","start":71,"end":80,"imported":{"type":"Identifier","start":71,"end":80,"name":"switchMap"},"local":{"type":"Identifier","start":71,"end":80,"name":"switchMap"}},{"type":"ImportSpecifier","start":82,"end":92,"imported":{"type":"Identifier","start":82,"end":92,"name":"throwError"},"local":{"type":"Identifier","start":82,"end":92,"name":"throwError"}}],"source":{"type":"Literal","start":100,"end":106,"value":"rxjs","raw":"'rxjs'"},"attributes":[]},{"type":"ImportDeclaration","start":108,"end":144,"specifiers":[{"type":"ImportNamespaceSpecifier","start":115,"end":122,"local":{"type":"Identifier","start":120,"end":122,"name":"i0"}}],"source":{"type":"Literal","start":128,"end":143,"value":"@angular/core","raw":"\"@angular/core\""},"attributes":[]},{"type":"ImportDeclaration","start":145,"end":194,"specifiers":[{"type":"ImportNamespaceSpecifier","start":152,"end":159,"local":{"type":"Identifier","start":157,"end":159,"name":"i1"}}],"source":{"type":"Literal","start":165,"end":193,"value":"quankee-framework-keycloak","raw":"\"quankee-framework-keycloak\""},"attributes":[]},{"type":"ExportNamedDeclaration","start":195,"end":1541,"specifiers":[],"source":null,"attributes":[],"declaration":{"type":"ClassDeclaration","start":202,"end":1541,"decorators":[],"id":{"type":"Identifier","start":208,"end":232,"name":"AuthorizationInterceptor"},"superClass":null,"body":{"type":"ClassBody","start":233,"end":1541,"body":[{"type":"PropertyDefinition","start":239,"end":255,"static":false,"computed":false,"decorators":[],"key":{"type":"Identifier","start":239,"end":254,"name":"keycloakService"},"value":null},{"type":"MethodDefinition","start":260,"end":344,"static":false,"computed":false,"decorators":[],"key":{"type":"Identifier","start":260,"end":271,"name":"constructor"},"value":{"type":"FunctionExpression","start":271,"end":344,"async":false,"generator":false,"id":null,"params":[{"type":"Identifier","start":272,"end":287,"name":"keycloakService"}],"body":{"type":"BlockStatement","start":289,"end":344,"body":[{"type":"ExpressionStatement","start":299,"end":338,"expression":{"type":"AssignmentExpression","start":299,"end":337,"operator":"=","left":{"type":"MemberExpression","start":299,"end":319,"computed":false,"optional":false,"object":{"type":"ThisExpression","start":299,"end":303},"property":{"type":"Identifier","start":304,"end":319,"name":"keycloakService"}},"right":{"type":"Identifier","start":322,"end":337,"name":"keycloakService"}}}]},"expression":false},"kind":"constructor"},{"type":"MethodDefinition","start":349,"end":1191,"static":false,"computed":false,"decorators":[],"key":{"type":"Identifier","start":349,"end":358,"name":"intercept"},"value":{"type":"FunctionExpression","start":358,"end":1191,"async":false,"generator":false,"id":null,"params":[{"type":"Identifier","start":359,"end":362,"name":"req"},{"type":"Identifier","start":364,"end":368,"name":"next"}],"body":{"type":"BlockStatement","start":370,"end":1191,"body":[{"type":"ExpressionStatement","start":380,"end":422,"expression":{"type":"CallExpression","start":380,"end":421,"optional":false,"callee":{"type":"MemberExpression","start":380,"end":391,"computed":false,"optional":false,"object":{"type":"Identifier","start":380,"end":387,"name":"console"},"property":{"type":"Identifier","start":388,"end":391,"name":"log"}},"arguments":[{"type":"Literal","start":392,"end":420,"value":"[Interceptor] Executing...","raw":"'[Interceptor] Executing...'"}]}},{"type":"ReturnStatement","start":431,"end":1185,"argument":{"type":"CallExpression","start":438,"end":1184,"optional":false,"callee":{"type":"MemberExpression","start":438,"end":485,"computed":false,"optional":false,"object":{"type":"CallExpression","start":438,"end":480,"optional":false,"callee":{"type":"Identifier","start":438,"end":442,"name":"from"},"arguments":[{"type":"CallExpression","start":443,"end":479,"optional":false,"callee":{"type":"MemberExpression","start":443,"end":476,"computed":false,"optional":false,"object":{"type":"MemberExpression","start":443,"end":463,"computed":false,"optional":false,"object":{"type":"ThisExpression","start":443,"end":447},"property":{"type":"Identifier","start":448,"end":463,"name":"keycloakService"}},"property":{"type":"Identifier","start":464,"end":476,"name":"refreshToken"}},"arguments":[{"type":"Literal","start":477,"end":478,"raw":"5","value":5}]}]},"property":{"type":"Identifier","start":481,"end":485,"name":"pipe"}},"arguments":[{"type":"CallExpression","start":486,"end":925,"optional":false,"callee":{"type":"Identifier","start":486,"end":495,"name":"switchMap"},"arguments":[{"type":"ArrowFunctionExpression","start":496,"end":924,"async":false,"expression":false,"generator":false,"params":[],"body":{"type":"BlockStatement","start":502,"end":924,"body":[{"type":"VariableDeclaration","start":516,"end":562,"kind":"const","declarations":[{"type":"VariableDeclarator","start":522,"end":561,"id":{"type":"Identifier","start":522,"end":527,"name":"token"},"init":{"type":"CallExpression","start":530,"end":561,"optional":false,"callee":{"type":"MemberExpression","start":530,"end":559,"computed":false,"optional":false,"object":{"type":"MemberExpression","start":530,"end":550,"computed":false,"optional":false,"object":{"type":"ThisExpression","start":530,"end":534},"property":{"type":"Identifier","start":535,"end":550,"name":"keycloakService"}},"property":{"type":"Identifier","start":551,"end":559,"name":"getToken"}},"arguments":[]}}]},{"type":"ExpressionStatement","start":575,"end":630,"expression":{"type":"CallExpression","start":575,"end":629,"optional":false,"callee":{"type":"MemberExpression","start":575,"end":586,"computed":false,"optional":false,"object":{"type":"Identifier","start":575,"end":582,"name":"console"},"property":{"type":"Identifier","start":583,"end":586,"name":"log"}},"arguments":[{"type":"BinaryExpression","start":587,"end":628,"operator":"+","left":{"type":"Literal","start":587,"end":620,"value":"[Interceptor] is token found...","raw":"'[Interceptor] is token found...'"},"right":{"type":"Identifier","start":623,"end":628,"name":"token"}}]}},{"type":"VariableDeclaration","start":643,"end":661,"kind":"let","declarations":[{"type":"VariableDeclarator","start":647,"end":660,"id":{"type":"Identifier","start":647,"end":654,"name":"authReq"},"init":{"type":"Identifier","start":657,"end":660,"name":"req"}}]},{"type":"IfStatement","start":674,"end":873,"test":{"type":"Identifier","start":678,"end":683,"name":"token"},"consequent":{"type":"BlockStatement","start":685,"end":873,"body":[{"type":"ExpressionStatement","start":703,"end":859,"expression":{"type":"AssignmentExpression","start":703,"end":858,"operator":"=","left":{"type":"Identifier","start":703,"end":710,"name":"authReq"},"right":{"type":"CallExpression","start":713,"end":858,"optional":false,"callee":{"type":"MemberExpression","start":713,"end":722,"computed":false,"optional":false,"object":{"type":"Identifier","start":713,"end":716,"name":"req"},"property":{"type":"Identifier","start":717,"end":722,"name":"clone"}},"arguments":[{"type":"ObjectExpression","start":723,"end":857,"properties":[{"type":"Property","start":745,"end":838,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":745,"end":755,"name":"setHeaders"},"value":{"type":"ObjectExpression","start":757,"end":838,"properties":[{"type":"Property","start":783,"end":815,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":783,"end":796,"name":"Authorization"},"value":{"type":"TemplateLiteral","start":798,"end":815,"quasis":[{"type":"TemplateElement","start":799,"end":806,"tail":false,"value":{"cooked":"Bearer ","raw":"Bearer "}},{"type":"TemplateElement","start":814,"end":814,"tail":true,"value":{"cooked":"","raw":""}}],"expressions":[{"type":"Identifier","start":808,"end":813,"name":"token"}]},"kind":"init"}]},"kind":"init"}]}]}}}]},"alternate":null},{"type":"ReturnStatement","start":886,"end":914,"argument":{"type":"CallExpression","start":893,"end":913,"optional":false,"callee":{"type":"MemberExpression","start":893,"end":904,"computed":false,"optional":false,"object":{"type":"Identifier","start":893,"end":897,"name":"next"},"property":{"type":"Identifier","start":898,"end":904,"name":"handle"}},"arguments":[{"type":"Identifier","start":905,"end":912,"name":"authReq"}]}}]},"id":null}]},{"type":"CallExpression","start":927,"end":1183,"optional":false,"callee":{"type":"Identifier","start":927,"end":937,"name":"catchError"},"arguments":[{"type":"ArrowFunctionExpression","start":938,"end":1182,"async":false,"expression":false,"generator":false,"params":[{"type":"Identifier","start":939,"end":944,"name":"error"}],"body":{"type":"BlockStatement","start":949,"end":1182,"body":[{"type":"ExpressionStatement","start":963,"end":1013,"expression":{"type":"CallExpression","start":963,"end":1012,"optional":false,"callee":{"type":"MemberExpression","start":963,"end":976,"computed":false,"optional":false,"object":{"type":"Identifier","start":963,"end":970,"name":"console"},"property":{"type":"Identifier","start":971,"end":976,"name":"error"}},"arguments":[{"type":"Literal","start":977,"end":1004,"value":"[Interceptor] HTTP Error:","raw":"'[Interceptor] HTTP Error:'"},{"type":"Identifier","start":1006,"end":1011,"name":"error"}]}},{"type":"IfStatement","start":1026,"end":1128,"test":{"type":"BinaryExpression","start":1030,"end":1050,"operator":"===","left":{"type":"MemberExpression","start":1030,"end":1042,"computed":false,"optional":false,"object":{"type":"Identifier","start":1030,"end":1035,"name":"error"},"property":{"type":"Identifier","start":1036,"end":1042,"name":"status"}},"right":{"type":"Literal","start":1047,"end":1050,"raw":"401","value":401}},"consequent":{"type":"BlockStatement","start":1052,"end":1128,"body":[{"type":"ExpressionStatement","start":1070,"end":1114,"expression":{"type":"CallExpression","start":1070,"end":1113,"optional":false,"callee":{"type":"MemberExpression","start":1070,"end":1083,"computed":false,"optional":false,"object":{"type":"Identifier","start":1070,"end":1077,"name":"console"},"property":{"type":"Identifier","start":1078,"end":1083,"name":"error"}},"arguments":[{"type":"Literal","start":1084,"end":1112,"value":"[Interceptor] Unauthorized","raw":"'[Interceptor] Unauthorized'"}]}}]},"alternate":null},{"type":"ReturnStatement","start":1141,"end":1172,"argument":{"type":"CallExpression","start":1148,"end":1171,"optional":false,"callee":{"type":"Identifier","start":1148,"end":1158,"name":"throwError"},"arguments":[{"type":"ArrowFunctionExpression","start":1159,"end":1170,"async":false,"expression":true,"generator":false,"params":[],"body":{"type":"Identifier","start":1165,"end":1170,"name":"error"},"id":null}]}}]},"id":null}]}]}}]},"expression":false},"kind":"method"},{"type":"PropertyDefinition","start":1196,"end":1402,"static":true,"computed":false,"decorators":[],"key":{"type":"Identifier","start":1203,"end":1207,"name":"ɵfac"},"value":{"type":"CallExpression","start":1210,"end":1401,"optional":false,"callee":{"type":"MemberExpression","start":1210,"end":1231,"computed":false,"optional":false,"object":{"type":"Identifier","start":1210,"end":1212,"name":"i0"},"property":{"type":"Identifier","start":1213,"end":1231,"name":"ɵɵngDeclareFactory"}},"arguments":[{"type":"ObjectExpression","start":1232,"end":1400,"properties":[{"type":"Property","start":1234,"end":1254,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":1234,"end":1244,"name":"minVersion"},"value":{"type":"Literal","start":1246,"end":1254,"value":"12.0.0","raw":"\"12.0.0\""},"kind":"init"},{"type":"Property","start":1256,"end":1274,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":1256,"end":1263,"name":"version"},"value":{"type":"Literal","start":1265,"end":1274,"value":"19.2.14","raw":"\"19.2.14\""},"kind":"init"},{"type":"Property","start":1276,"end":1288,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":1276,"end":1284,"name":"ngImport"},"value":{"type":"Identifier","start":1286,"end":1288,"name":"i0"},"kind":"init"},{"type":"Property","start":1290,"end":1320,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":1290,"end":1294,"name":"type"},"value":{"type":"Identifier","start":1296,"end":1320,"name":"AuthorizationInterceptor"},"kind":"init"},{"type":"Property","start":1322,"end":1359,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":1322,"end":1326,"name":"deps"},"value":{"type":"ArrayExpression","start":1328,"end":1359,"elements":[{"type":"ObjectExpression","start":1329,"end":1358,"properties":[{"type":"Property","start":1331,"end":1356,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":1331,"end":1336,"name":"token"},"value":{"type":"MemberExpression","start":1338,"end":1356,"computed":false,"optional":false,"object":{"type":"Identifier","start":1338,"end":1340,"name":"i1"},"property":{"type":"Identifier","start":1341,"end":1356,"name":"KeycloakService"}},"kind":"init"}]}]},"kind":"init"},{"type":"Property","start":1361,"end":1398,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":1361,"end":1367,"name":"target"},"value":{"type":"MemberExpression","start":1369,"end":1398,"computed":false,"optional":false,"object":{"type":"MemberExpression","start":1369,"end":1387,"computed":false,"optional":false,"object":{"type":"Identifier","start":1369,"end":1371,"name":"i0"},"property":{"type":"Identifier","start":1372,"end":1387,"name":"ɵɵFactoryTarget"}},"property":{"type":"Identifier","start":1388,"end":1398,"name":"Injectable"}},"kind":"init"}]}]}},{"type":"PropertyDefinition","start":1407,"end":1539,"static":true,"computed":false,"decorators":[],"key":{"type":"Identifier","start":1414,"end":1419,"name":"ɵprov"},"value":{"type":"CallExpression","start":1422,"end":1538,"optional":false,"callee":{"type":"MemberExpression","start":1422,"end":1446,"computed":false,"optional":false,"object":{"type":"Identifier","start":1422,"end":1424,"name":"i0"},"property":{"type":"Identifier","start":1425,"end":1446,"name":"ɵɵngDeclareInjectable"}},"arguments":[{"type":"ObjectExpression","start":1447,"end":1537,"properties":[{"type":"Property","start":1449,"end":1469,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":1449,"end":1459,"name":"minVersion"},"value":{"type":"Literal","start":1461,"end":1469,"value":"12.0.0","raw":"\"12.0.0\""},"kind":"init"},{"type":"Property","start":1471,"end":1489,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":1471,"end":1478,"name":"version"},"value":{"type":"Literal","start":1480,"end":1489,"value":"19.2.14","raw":"\"19.2.14\""},"kind":"init"},{"type":"Property","start":1491,"end":1503,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":1491,"end":1499,"name":"ngImport"},"value":{"type":"Identifier","start":1501,"end":1503,"name":"i0"},"kind":"init"},{"type":"Property","start":1505,"end":1535,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":1505,"end":1509,"name":"type"},"value":{"type":"Identifier","start":1511,"end":1535,"name":"AuthorizationInterceptor"},"kind":"init"}]}]}}]}}},{"type":"ExpressionStatement","start":1542,"end":1772,"expression":{"type":"CallExpression","start":1542,"end":1771,"optional":false,"callee":{"type":"MemberExpression","start":1542,"end":1569,"computed":false,"optional":false,"object":{"type":"Identifier","start":1542,"end":1544,"name":"i0"},"property":{"type":"Identifier","start":1545,"end":1569,"name":"ɵɵngDeclareClassMetadata"}},"arguments":[{"type":"ObjectExpression","start":1570,"end":1770,"properties":[{"type":"Property","start":1572,"end":1592,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":1572,"end":1582,"name":"minVersion"},"value":{"type":"Literal","start":1584,"end":1592,"value":"12.0.0","raw":"\"12.0.0\""},"kind":"init"},{"type":"Property","start":1594,"end":1612,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":1594,"end":1601,"name":"version"},"value":{"type":"Literal","start":1603,"end":1612,"value":"19.2.14","raw":"\"19.2.14\""},"kind":"init"},{"type":"Property","start":1614,"end":1626,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":1614,"end":1622,"name":"ngImport"},"value":{"type":"Identifier","start":1624,"end":1626,"name":"i0"},"kind":"init"},{"type":"Property","start":1628,"end":1658,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":1628,"end":1632,"name":"type"},"value":{"type":"Identifier","start":1634,"end":1658,"name":"AuthorizationInterceptor"},"kind":"init"},{"type":"Property","start":1660,"end":1714,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":1660,"end":1670,"name":"decorators"},"value":{"type":"ArrayExpression","start":1672,"end":1714,"elements":[{"type":"ObjectExpression","start":1673,"end":1713,"properties":[{"type":"Property","start":1687,"end":1703,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":1687,"end":1691,"name":"type"},"value":{"type":"Identifier","start":1693,"end":1703,"name":"Injectable"},"kind":"init"}]}]},"kind":"init"},{"type":"Property","start":1716,"end":1768,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":1716,"end":1730,"name":"ctorParameters"},"value":{"type":"ArrowFunctionExpression","start":1732,"end":1768,"async":false,"expression":true,"generator":false,"params":[],"body":{"type":"ArrayExpression","start":1738,"end":1768,"elements":[{"type":"ObjectExpression","start":1739,"end":1767,"properties":[{"type":"Property","start":1741,"end":1765,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":1741,"end":1745,"name":"type"},"value":{"type":"MemberExpression","start":1747,"end":1765,"computed":false,"optional":false,"object":{"type":"Identifier","start":1747,"end":1749,"name":"i1"},"property":{"type":"Identifier","start":1750,"end":1765,"name":"KeycloakService"}},"kind":"init"}]}]},"id":null},"kind":"init"}]}]}}],"_rollupRemoved":[{"end":5579,"start":1773,"type":"sourcemap"}],"sourceType":"module"},"attributes":{},"code":"import { Injectable } from '@angular/core';\nimport { catchError, from, switchMap, throwError } from 'rxjs';\nimport * as i0 from \"@angular/core\";\nimport * as i1 from \"quankee-framework-keycloak\";\nexport class AuthorizationInterceptor {\n keycloakService;\n constructor(keycloakService) {\n this.keycloakService = keycloakService;\n }\n intercept(req, next) {\n console.log('[Interceptor] Executing...');\n return from(this.keycloakService.refreshToken(5)).pipe(switchMap(() => {\n const token = this.keycloakService.getToken();\n console.log('[Interceptor] is token found...' + token);\n let authReq = req;\n if (token) {\n authReq = req.clone({\n setHeaders: {\n Authorization: `Bearer ${token}`,\n },\n });\n }\n return next.handle(authReq);\n }), catchError((error) => {\n console.error('[Interceptor] HTTP Error:', error);\n if (error.status === 401) {\n console.error('[Interceptor] Unauthorized');\n }\n return throwError(() => error);\n }));\n }\n static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"19.2.14\", ngImport: i0, type: AuthorizationInterceptor, deps: [{ token: i1.KeycloakService }], target: i0.ɵɵFactoryTarget.Injectable });\n static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: \"12.0.0\", version: \"19.2.14\", ngImport: i0, type: AuthorizationInterceptor });\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"19.2.14\", ngImport: i0, type: AuthorizationInterceptor, decorators: [{\n type: Injectable\n }], ctorParameters: () => [{ type: i1.KeycloakService }] });\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXV0aG9yaXphdGlvbi5pbnRlcmNlcHRvci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL3F1YW5rZWUtZnJhbWV3b3JrLWludGVyY2VwdG9yL3NyYy9saWIvY29yZS9hdXRob3JpemF0aW9uLmludGVyY2VwdG9yLnRzIl0sIm5hbWVzIj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VxdWVzdDxhbnk+LCBuZXh0OiBIdHRwSGFuZGxlcik6IE9ic2VydmFibGU8SHR0cEV2ZW50PGFueT4+IHtcclxuICAgIGNvbnNvbGUubG9nKCdbSW50ZXJjZXB0b3JdIEV4ZWN1dGluZy4uLicpO1xyXG5cclxuICAgICAgcmV0dXJuIGZyb20odGhpcy5rZXljbG9ha1NlcnZpY2UucmVmcmVzaFRva2VuKDUpKS5waXBlKFxyXG4gICAgICAgICAgc3dpdGNoTWFwKCgpID0+IHtcclxuICAgICAgICAgICAgICBjb25zdCB0b2tlbiA9IHRoaXMua2V5Y2xvYWtTZXJ2aWNlLmdldFRva2VuKCk7XHJcbiAgICAgICAgICAgICAgY29uc29sZS5sb2coJ1tJbnRlcmNlcHRvcl0gaXMgdG9rZW4gZm91bmQuLi4nICsgdG9rZW4pO1xyXG4gICAgICAgICAgICAgIGxldCBhdXRoUmVxID0gcmVxO1xyXG5cclxuICAgICAgICAgICAgICBpZiAodG9rZW4pIHtcclxuICAgICAgICAgICAgICAgICAgYXV0aFJlcSA9IHJlcS5jbG9uZSh7XHJcbiAgICAgICAgICAgICAgICAgICAgICBzZXRIZWFkZXJzOiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgQXV0aG9yaXphdGlvbjogYEJlYXJlciAke3Rva2VufWAsXHJcbiAgICAgICAgICAgICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICAgICAgICB9KTtcclxuICAgICAgICAgICAgICB9XHJcblxyXG4gICAgICAgICAgICAgIHJldHVybiBuZXh0LmhhbmRsZShhdXRoUmVxKTtcclxuICAgICAgICAgIH0pLFxyXG4gICAgICAgICAgY2F0Y2hFcnJvcigoZXJyb3I6IEh0dHBFcnJvclJlc3BvbnNlKSA9PiB7XHJcbiAgICAgICAgICAgICAgY29uc29sZS5lcnJvcignW0ludGVyY2VwdG9yXSBIVFRQIEVycm9yOicsIGVycm9yKTtcclxuICAgICAgICAgICAgICBpZiAoZXJyb3Iuc3RhdHVzID09PSA0MDEpIHtcclxuICAgICAgICAgICAgICAgICAgY29uc29sZS5lcnJvcignW0ludGVyY2VwdG9yXSBVbmF1dGhvcml6ZWQnKTtcclxuICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgcmV0dXJuIHRocm93RXJyb3IoKCkgPT4gZXJyb3IpO1xyXG4gICAgICAgICAgfSlcclxuICAgICAgKTtcclxuICB9XHJcbn1cclxuXHJcbiJdfQ==","customTransformCache":false,"dependencies":["@angular/core","rxjs","quankee-framework-keycloak"],"id":"C:/usr/local/workspaces/workspace-quankee/quankee-framework/quankee-framework-common-ts/dist/quankee-framework-interceptor/esm2022/lib/core/authorization.interceptor.mjs","meta":{},"moduleSideEffects":true,"originalCode":"import { Injectable } from '@angular/core';\nimport { catchError, from, switchMap, throwError } from 'rxjs';\nimport * as i0 from \"@angular/core\";\nimport * as i1 from \"quankee-framework-keycloak\";\nexport class AuthorizationInterceptor {\n keycloakService;\n constructor(keycloakService) {\n this.keycloakService = keycloakService;\n }\n intercept(req, next) {\n console.log('[Interceptor] Executing...');\n return from(this.keycloakService.refreshToken(5)).pipe(switchMap(() => {\n const token = this.keycloakService.getToken();\n console.log('[Interceptor] is token found...' + token);\n let authReq = req;\n if (token) {\n authReq = req.clone({\n setHeaders: {\n Authorization: `Bearer ${token}`,\n },\n });\n }\n return next.handle(authReq);\n }), catchError((error) => {\n console.error('[Interceptor] HTTP Error:', error);\n if (error.status === 401) {\n console.error('[Interceptor] Unauthorized');\n }\n return throwError(() => error);\n }));\n }\n static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"19.2.14\", ngImport: i0, type: AuthorizationInterceptor, deps: [{ token: i1.KeycloakService }], target: i0.ɵɵFactoryTarget.Injectable });\n static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: \"12.0.0\", version: \"19.2.14\", ngImport: i0, type: AuthorizationInterceptor });\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"19.2.14\", ngImport: i0, type: AuthorizationInterceptor, decorators: [{\n type: Injectable\n }], ctorParameters: () => [{ type: i1.KeycloakService }] });\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXV0aG9yaXphdGlvbi5pbnRlcmNlcHRvci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL3F1YW5rZWUtZnJhbWV3b3JrLWludGVyY2VwdG9yL3NyYy9saWIvY29yZS9hdXRob3JpemF0aW9uLmludGVyY2VwdG9yLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUNBLE9BQU8sRUFBQyxVQUFVLEVBQUMsTUFBTSxlQUFlLENBQUM7QUFFekMsT0FBTyxFQUFDLFVBQVUsRUFBRSxJQUFJLEVBQWMsU0FBUyxFQUFFLFVBQVUsRUFBQyxNQUFNLE1BQU0sQ0FBQzs7O0FBR3pFLE1BQU0sT0FBTyx3QkFBd0I7SUFFTjtJQUE3QixZQUE2QixlQUFnQztRQUFoQyxvQkFBZSxHQUFmLGVBQWUsQ0FBaUI7SUFBRyxDQUFDO0lBRWpFLFNBQVMsQ0FBQyxHQUFxQixFQUFFLElBQWlCO1FBQ2hELE9BQU8sQ0FBQyxHQUFHLENBQUMsNEJBQTRCLENBQUMsQ0FBQztRQUV4QyxPQUFPLElBQUksQ0FBQyxJQUFJLENBQUMsZUFBZSxDQUFDLFlBQVksQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLElBQUksQ0FDbEQsU0FBUyxDQUFDLEdBQUcsRUFBRTtZQUNYLE1BQU0sS0FBSyxHQUFHLElBQUksQ0FBQyxlQUFlLENBQUMsUUFBUSxFQUFFLENBQUM7WUFDOUMsT0FBTyxDQUFDLEdBQUcsQ0FBQyxpQ0FBaUMsR0FBRyxLQUFLLENBQUMsQ0FBQztZQUN2RCxJQUFJLE9BQU8sR0FBRyxHQUFHLENBQUM7WUFFbEIsSUFB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XG4gICAgICAgICAgICAgICAgICB9KTtcclxuICAgICAgICAgICAgICB9XHJcblxyXG4gICAgICAgICAgICAgIHJldHVybiBuZXh0LmhhbmRsZShhdXRoUmVxKTtcclxuICAgICAgICAgIH0pLFxyXG4gICAgICAgICAgY2F0Y2hFcnJvcigoZXJyb3I6IEh0dHBFcnJvclJlc3BvbnNlKSA9PiB7XHJcbiAgICAgICAgICAgICAgY29uc29sZS5lcnJvcignW0ludGVyY2VwdG9yXSBIVFRQIEVycm9yOicsIGVycm9yKTtcclxuICAgICAgICAgICAgICBpZiAoZXJyb3Iuc3RhdHVzID09PSA0MDEpIHtcclxuICAgICAgICAgICAgICAgICAgY29uc29sZS5lcnJvcignW0ludGVyY2VwdG9yXSBVbmF1dGhvcml6ZWQnKTtcclxuICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgcmV0dXJuIHRocm93RXJyb3IoKCkgPT4gZXJyb3IpO1xyXG4gICAgICAgICAgfSlcclxuICAgICAgKTtcclxuICB9XHJcbn1cclxuXHJcbiJdfQ==","originalSourcemap":{"version":3,"file":"authorization.interceptor.js","sourceRoot":"","sources":["../../../../../projects/quankee-framework-interceptor/src/lib/core/authorization.interceptor.ts"],"names":[],"mappings":[[[0,0,1,0],[7,0,1,7],[9,0,1,8],[19,0,1,18],[21,0,1,19],[27,0,1,25],[42,0,1,40],[43,0,1,41]],[[0,0,3,0],[7,0,3,7],[9,0,3,8],[19,0,3,18],[21,0,3,20],[25,0,3,24],[27,0,3,38],[36,0,3,47],[38,0,3,49],[48,0,3,59],[50,0,3,60],[56,0,3,66],[62,0,3,72],[63,0,3,73]],[],[],[[0,0,6,0],[6,0,6,6],[13,0,6,13],[37,0,6,37]],[[4,0,8,31]],[[4,0,8,2],[16,0,8,31],[31,0,8,63]],[[8,0,8,31],[28,0,8,46],[31,0,8,31],[46,0,8,46],[47,0,8,63]],[[4,0,8,66],[5,0,8,67]],[[4,0,10,2],[13,0,10,11],[14,0,10,12],[17,0,10,33],[19,0,10,35],[23,0,10,52]],[[8,0,11,4],[15,0,11,11],[16,0,11,12],[19,0,11,15],[20,0,11,16],[48,0,11,44],[49,0,11,45],[50,0,11,46]],[[8,0,13,6],[15,0,13,13],[19,0,13,17],[20,0,13,18],[24,0,13,22],[25,0,13,23],[40,0,13,38],[41,0,13,39],[53,0,13,51],[54,0,13,52],[55,0,13,53],[56,0,13,54],[57,0,13,55],[58,0,13,56],[62,0,13,60],[63,0,14,10],[72,0,14,19],[73,0,14,20],[76,0,14,23],[78,0,14,25]],[[12,0,15,14],[18,0,15,20],[23,0,15,25],[26,0,15,28],[30,0,15,32],[31,0,15,33],[46,0,15,48],[47,0,15,49],[55,0,15,57],[57,0,15,59],[58,0,15,60]],[[12,0,16,14],[19,0,16,21],[20,0,16,22],[23,0,16,25],[24,0,16,26],[57,0,16,59],[60,0,16,62],[65,0,16,67],[66,0,16,68],[67,0,16,69]],[[12,0,17,14],[16,0,17,18],[23,0,17,25],[26,0,17,28],[29,0,17,31],[30,0,17,32]],[[12,0,19,14],[16,0,19,18],[21,0,19,23],[23,0,19,25],[24,0,19,26]],[[16,0,20,18],[23,0,20,25],[26,0,20,28],[29,0,20,31],[30,0,20,32],[35,0,20,37],[36,0,20,38]],[[20,0,21,22],[30,0,21,32],[32,0,21,34]],[[24,0,22,26],[37,0,22,39],[39,0,22,41],[49,0,22,51],[54,0,22,56],[56,0,22,58]],[[21,0,23,23]],[[17,0,24,19],[18,0,24,20],[19,0,24,21]],[[12,0,25,14],[13,0,25,15]],[[12,0,27,14],[19,0,27,21],[23,0,27,25],[24,0,27,26],[30,0,27,32],[31,0,27,33],[38,0,27,40],[39,0,27,41],[40,0,27,42]],[[8,0,28,10],[9,0,28,11],[10,0,28,12],[12,0,29,10],[22,0,29,20],[23,0,29,21],[24,0,29,22],[29,0,29,46],[31,0,29,48],[33,0,29,50]],[[12,0,30,14],[19,0,30,21],[20,0,30,22],[25,0,30,27],[26,0,30,28],[53,0,30,55],[55,0,30,57],[60,0,30,62],[61,0,30,63],[62,0,30,64]],[[12,0,31,14],[16,0,31,18],[21,0,31,23],[22,0,31,24],[28,0,31,30],[33,0,31,35],[36,0,31,38],[38,0,31,40],[39,0,31,41]],[[16,0,32,18],[23,0,32,25],[24,0,32,26],[29,0,32,31],[30,0,32,32],[58,0,32,60],[59,0,32,61],[60,0,32,62]],[[12,0,33,14],[13,0,33,15]],[[12,0,34,14],[19,0,34,21],[29,0,34,31],[30,0,34,32],[33,0,34,35],[35,0,34,37],[36,0,34,38],[41,0,34,43],[42,0,34,44],[43,0,34,45]],[[8,0,35,10],[9,0,35,11],[10,0,35,12],[11,0,36,7],[12,0,36,8]],[[4,0,37,2],[5,0,37,3]],[[104,0,6,13],[128,0,6,37]],[[108,0,6,13],[132,0,6,37]],[],[[92,0,6,13],[116,0,6,37]],[[18,0,5,1],[28,0,5,11]]],"sourcesContent":["import {HttpErrorResponse, HttpEvent, HttpHandler, HttpInterceptor, HttpRequest} from '@angular/common/http';\r\nimport {Injectable} from '@angular/core';\r\nimport {KeycloakService} from 'quankee-framework-keycloak';\r\nimport {catchError, from, Observable, switchMap, throwError} from 'rxjs';\r\n\r\n@Injectable()\r\nexport class AuthorizationInterceptor implements HttpInterceptor {\r\n\r\n constructor(private readonly keycloakService: KeycloakService) {}\r\n\r\n intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {\r\n console.log('[Interceptor] Executing...');\r\n\r\n return from(this.keycloakService.refreshToken(5)).pipe(\r\n switchMap(() => {\r\n const token = this.keycloakService.getToken();\r\n console.log('[Interceptor] is token found...' + token);\r\n let authReq = req;\r\n\r\n if (token) {\r\n authReq = req.clone({\r\n setHeaders: {\r\n Authorization: `Bearer ${token}`,\r\n },\r\n });\r\n }\r\n\r\n return next.handle(authReq);\r\n }),\r\n catchError((error: HttpErrorResponse) => {\r\n console.error('[Interceptor] HTTP Error:', error);\r\n if (error.status === 401) {\r\n console.error('[Interceptor] Unauthorized');\r\n }\r\n return throwError(() => error);\r\n })\r\n );\r\n }\r\n}\r\n\r\n"]},"resolvedIds":{"@angular/core":{"attributes":{},"external":true,"id":"@angular/core","meta":{},"moduleSideEffects":true,"resolvedBy":"rollup","syntheticNamedExports":false},"rxjs":{"attributes":{},"external":true,"id":"rxjs","meta":{},"moduleSideEffects":true,"resolvedBy":"rollup","syntheticNamedExports":false},"quankee-framework-keycloak":{"attributes":{},"external":true,"id":"quankee-framework-keycloak","meta":{},"moduleSideEffects":true,"resolvedBy":"rollup","syntheticNamedExports":false}},"sourcemapChain":[],"syntheticNamedExports":false,"transformDependencies":[]},{"ast":{"type":"Program","start":0,"end":755,"body":[{"type":"ExportAllDeclaration","start":62,"end":102,"exported":null,"source":{"type":"Literal","start":76,"end":101,"value":"./lib/core/token.helper","raw":"'./lib/core/token.helper'"},"attributes":[]},{"type":"ExportAllDeclaration","start":103,"end":156,"exported":null,"source":{"type":"Literal","start":117,"end":155,"value":"./lib/core/authorization.interceptor","raw":"'./lib/core/authorization.interceptor'"},"attributes":[]}],"_rollupRemoved":[{"end":755,"start":157,"type":"sourcemap"}],"sourceType":"module"},"attributes":{},"code":"/*\n * Public API Surface of quankee-framework-interceptor\n */\nexport * from './lib/core/token.helper';\nexport * from './lib/core/authorization.interceptor';\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljLWFwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3Byb2plY3RzL3F1YW5rZWUtZnJhbWV3b3JrLWludGVyY2VwdG9yL3NyYy9wdWJsaWMtYXBpLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBRUgsY0FBYyx5QkFBeUIsQ0FBQztBQUN4QyxjQUFjLHNDQUFzQyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLypcclxuICogUHVibGljIEFQSSBTdXJmYWNlIG9mIHF1YW5rZWUtZnJhbWV3b3JrLWludGVyY2VwdG9yXHJcbiAqL1xyXG5cclxuZXhwb3J0ICogZnJvbSAnLi9saWIvY29yZS90b2tlbi5oZWxwZXInO1xyXG5leHBvcnQgKiBmcm9tICcuL2xpYi9jb3JlL2F1dGhvcml6YXRpb24uaW50ZXJjZXB0b3InO1xyXG4iXX0=","customTransformCache":false,"dependencies":["C:/usr/local/workspaces/workspace-quankee/quankee-framework/quankee-framework-common-ts/dist/quankee-framework-interceptor/esm2022/lib/core/token.helper.mjs","C:/usr/local/workspaces/workspace-quankee/quankee-framework/quankee-framework-common-ts/dist/quankee-framework-interceptor/esm2022/lib/core/authorization.interceptor.mjs"],"id":"C:/usr/local/workspaces/workspace-quankee/quankee-framework/quankee-framework-common-ts/dist/quankee-framework-interceptor/esm2022/public-api.mjs","meta":{},"moduleSideEffects":true,"originalCode":"/*\n * Public API Surface of quankee-framework-interceptor\n */\nexport * from './lib/core/token.helper';\nexport * from './lib/core/authorization.interceptor';\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljLWFwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3Byb2plY3RzL3F1YW5rZWUtZnJhbWV3b3JrLWludGVyY2VwdG9yL3NyYy9wdWJsaWMtYXBpLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBRUgsY0FBYyx5QkFBeUIsQ0FBQztBQUN4QyxjQUFjLHNDQUFzQyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLypcclxuICogUHVibGljIEFQSSBTdXJmYWNlIG9mIHF1YW5rZWUtZnJhbWV3b3JrLWludGVyY2VwdG9yXHJcbiAqL1xyXG5cclxuZXhwb3J0ICogZnJvbSAnLi9saWIvY29yZS90b2tlbi5oZWxwZXInO1xyXG5leHBvcnQgKiBmcm9tICcuL2xpYi9jb3JlL2F1dGhvcml6YXRpb24uaW50ZXJjZXB0b3InO1xyXG4iXX0=","originalSourcemap":{"version":3,"file":"public-api.js","sourceRoot":"","sources":["../../../projects/quankee-framework-interceptor/src/public-api.ts"],"names":[],"mappings":[[[0,0,0,0]],[],[[3,0,2,3]],[[0,0,4,0],[14,0,4,14],[39,0,4,39],[40,0,4,40]],[[0,0,5,0],[14,0,5,14],[52,0,5,52],[53,0,5,53]]],"sourcesContent":["/*\r\n * Public API Surface of quankee-framework-interceptor\r\n */\r\n\r\nexport * from './lib/core/token.helper';\r\nexport * from './lib/core/authorization.interceptor';\r\n"]},"resolvedIds":{"./lib/core/token.helper":{"attributes":{},"external":false,"id":"C:/usr/local/workspaces/workspace-quankee/quankee-framework/quankee-framework-common-ts/dist/quankee-framework-interceptor/esm2022/lib/core/token.helper.mjs","meta":{},"moduleSideEffects":true,"resolvedBy":"file-loader","syntheticNamedExports":false},"./lib/core/authorization.interceptor":{"attributes":{},"external":false,"id":"C:/usr/local/workspaces/workspace-quankee/quankee-framework/quankee-framework-common-ts/dist/quankee-framework-interceptor/esm2022/lib/core/authorization.interceptor.mjs","meta":{},"moduleSideEffects":true,"resolvedBy":"file-loader","syntheticNamedExports":false}},"sourcemapChain":[],"syntheticNamedExports":false,"transformDependencies":[]},{"ast":{"type":"Program","start":0,"end":572,"body":[{"type":"ExportAllDeclaration","start":48,"end":77,"exported":null,"source":{"type":"Literal","start":62,"end":76,"value":"./public-api","raw":"'./public-api'"},"attributes":[]}],"_rollupRemoved":[{"end":572,"start":78,"type":"sourcemap"}],"sourceType":"module"},"attributes":{},"code":"/**\n * Generated bundle index. Do not edit.\n */\nexport * from './public-api';\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicXVhbmtlZS1mcmFtZXdvcmstaW50ZXJjZXB0b3IuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9wcm9qZWN0cy9xdWFua2VlLWZyYW1ld29yay1pbnRlcmNlcHRvci9zcmMvcXVhbmtlZS1mcmFtZXdvcmstaW50ZXJjZXB0b3IudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7O0dBRUc7QUFFSCxjQUFjLGNBQWMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogR2VuZXJhdGVkIGJ1bmRsZSBpbmRleC4gRG8gbm90IGVkaXQuXG4gKi9cblxuZXhwb3J0ICogZnJvbSAnLi9wdWJsaWMtYXBpJztcbiJdfQ==","customTransformCache":false,"dependencies":["C:/usr/local/workspaces/workspace-quankee/quankee-framework/quankee-framework-common-ts/dist/quankee-framework-interceptor/esm2022/public-api.mjs"],"id":"C:\\usr\\local\\workspaces\\workspace-quankee\\quankee-framework\\quankee-framework-common-ts\\dist\\quankee-framework-interceptor\\esm2022\\quankee-framework-interceptor.mjs","meta":{},"moduleSideEffects":true,"originalCode":"/**\n * Generated bundle index. Do not edit.\n */\nexport * from './public-api';\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicXVhbmtlZS1mcmFtZXdvcmstaW50ZXJjZXB0b3IuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9wcm9qZWN0cy9xdWFua2VlLWZyYW1ld29yay1pbnRlcmNlcHRvci9zcmMvcXVhbmtlZS1mcmFtZXdvcmstaW50ZXJjZXB0b3IudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7O0dBRUc7QUFFSCxjQUFjLGNBQWMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogR2VuZXJhdGVkIGJ1bmRsZSBpbmRleC4gRG8gbm90IGVkaXQuXG4gKi9cblxuZXhwb3J0ICogZnJvbSAnLi9wdWJsaWMtYXBpJztcbiJdfQ==","originalSourcemap":{"version":3,"file":"quankee-framework-interceptor.js","sourceRoot":"","sources":["../../../projects/quankee-framework-interceptor/src/quankee-framework-interceptor.ts"],"names":[],"mappings":[[[0,0,0,0]],[],[[3,0,2,3]],[[0,0,4,0],[14,0,4,14],[28,0,4,28],[29,0,4,29]]],"sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"]},"resolvedIds":{"./public-api":{"attributes":{},"external":false,"id":"C:/usr/local/workspaces/workspace-quankee/quankee-framework/quankee-framework-common-ts/dist/quankee-framework-interceptor/esm2022/public-api.mjs","meta":{},"moduleSideEffects":true,"resolvedBy":"file-loader","syntheticNamedExports":false}},"sourcemapChain":[],"syntheticNamedExports":false,"transformDependencies":[]}],"plugins":{"file-loader":{},"json":{}}}
@@ -1 +1 @@
1
- {"hash":"85398286d0e703d2d7bf617c747331c3a8219525009cb872d8da3eb53adc192c","fesm2022":[{"exports":["AuthorizationInterceptor","injectAuthHeader"],"facadeModuleId":"C:\\usr\\local\\workspaces\\workspace-quankee\\quankee-framework\\quankee-framework-common-ts\\dist\\quankee-framework-interceptor\\esm2022\\quankee-framework-interceptor.mjs","isDynamicEntry":false,"isEntry":true,"isImplicitEntry":false,"moduleIds":["C:/usr/local/workspaces/workspace-quankee/quankee-framework/quankee-framework-common-ts/dist/quankee-framework-interceptor/esm2022/lib/core/token.helper.mjs","C:/usr/local/workspaces/workspace-quankee/quankee-framework/quankee-framework-common-ts/dist/quankee-framework-interceptor/esm2022/lib/core/authorization.interceptor.mjs","C:/usr/local/workspaces/workspace-quankee/quankee-framework/quankee-framework-common-ts/dist/quankee-framework-interceptor/esm2022/public-api.mjs","C:\\usr\\local\\workspaces\\workspace-quankee\\quankee-framework\\quankee-framework-common-ts\\dist\\quankee-framework-interceptor\\esm2022\\quankee-framework-interceptor.mjs"],"name":"quankee-framework-interceptor","type":"chunk","dynamicImports":[],"fileName":"quankee-framework-interceptor.mjs","implicitlyLoadedBefore":[],"importedBindings":{"@angular/core":["*","Injectable"],"rxjs":["catchError","throwError"],"quankee-framework-keycloak":["*"]},"imports":["@angular/core","rxjs","quankee-framework-keycloak"],"modules":{"C:/usr/local/workspaces/workspace-quankee/quankee-framework/quankee-framework-common-ts/dist/quankee-framework-interceptor/esm2022/lib/core/token.helper.mjs":{"code":"function injectAuthHeader(req, token) {\n if (token) {\n return req.clone({\n setHeaders: {\n Authorization: `Bearer ${token}`,\n },\n });\n }\n return req;\n}","originalLength":1112,"removedExports":[],"renderedExports":["injectAuthHeader"],"renderedLength":210},"C:/usr/local/workspaces/workspace-quankee/quankee-framework/quankee-framework-common-ts/dist/quankee-framework-interceptor/esm2022/lib/core/authorization.interceptor.mjs":{"code":"class AuthorizationInterceptor {\n keycloakService;\n constructor(keycloakService) {\n this.keycloakService = keycloakService;\n }\n intercept(req, next) {\n console.log('[Interceptor] Executing...');\n const token = this.keycloakService.getToken(); // returns string\n console.log('[Interceptor] is token found...' + token);\n let authReq = req;\n if (token) {\n console.log('[Interceptor] token found...' + token);\n authReq = req.clone({\n setHeaders: {\n Authorization: `Bearer ${token}`,\n },\n });\n }\n return next.handle(authReq).pipe(catchError((error) => {\n console.error('HTTP Error:', error);\n if (error.status === 401) {\n // handle unauthorized\n console.error('[Interceptor] Unauthorized.');\n }\n return throwError(() => error);\n }));\n }\n static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"19.2.14\", ngImport: i0, type: AuthorizationInterceptor, deps: [{ token: i1.KeycloakService }], target: i0.ɵɵFactoryTarget.Injectable });\n static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: \"12.0.0\", version: \"19.2.14\", ngImport: i0, type: AuthorizationInterceptor });\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"19.2.14\", ngImport: i0, type: AuthorizationInterceptor, decorators: [{\n type: Injectable\n }], ctorParameters: () => [{ type: i1.KeycloakService }] });","originalLength":5214,"removedExports":[],"renderedExports":["AuthorizationInterceptor"],"renderedLength":1546},"C:/usr/local/workspaces/workspace-quankee/quankee-framework/quankee-framework-common-ts/dist/quankee-framework-interceptor/esm2022/public-api.mjs":{"code":"/*\n * Public API Surface of quankee-framework-interceptor\n */","originalLength":755,"removedExports":[],"renderedExports":[],"renderedLength":61},"C:\\usr\\local\\workspaces\\workspace-quankee\\quankee-framework\\quankee-framework-common-ts\\dist\\quankee-framework-interceptor\\esm2022\\quankee-framework-interceptor.mjs":{"code":"/**\n * Generated bundle index. Do not edit.\n */","originalLength":572,"removedExports":[],"renderedExports":[],"renderedLength":47}},"referencedFiles":[],"code":"import * as i0 from '@angular/core';\nimport { Injectable } from '@angular/core';\nimport { catchError, throwError } from 'rxjs';\nimport * as i1 from 'quankee-framework-keycloak';\n\nfunction injectAuthHeader(req, token) {\n if (token) {\n return req.clone({\n setHeaders: {\n Authorization: `Bearer ${token}`,\n },\n });\n }\n return req;\n}\n\nclass AuthorizationInterceptor {\n keycloakService;\n constructor(keycloakService) {\n this.keycloakService = keycloakService;\n }\n intercept(req, next) {\n console.log('[Interceptor] Executing...');\n const token = this.keycloakService.getToken(); // returns string\n console.log('[Interceptor] is token found...' + token);\n let authReq = req;\n if (token) {\n console.log('[Interceptor] token found...' + token);\n authReq = req.clone({\n setHeaders: {\n Authorization: `Bearer ${token}`,\n },\n });\n }\n return next.handle(authReq).pipe(catchError((error) => {\n console.error('HTTP Error:', error);\n if (error.status === 401) {\n // handle unauthorized\n console.error('[Interceptor] Unauthorized.');\n }\n return throwError(() => error);\n }));\n }\n static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"19.2.14\", ngImport: i0, type: AuthorizationInterceptor, deps: [{ token: i1.KeycloakService }], target: i0.ɵɵFactoryTarget.Injectable });\n static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: \"12.0.0\", version: \"19.2.14\", ngImport: i0, type: AuthorizationInterceptor });\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"19.2.14\", ngImport: i0, type: AuthorizationInterceptor, decorators: [{\n type: Injectable\n }], ctorParameters: () => [{ type: i1.KeycloakService }] });\n\n/*\n * Public API Surface of quankee-framework-interceptor\n */\n\n/**\n * Generated bundle index. Do not edit.\n */\n\nexport { AuthorizationInterceptor, injectAuthHeader };\n//# sourceMappingURL=quankee-framework-interceptor.mjs.map\n","map":null,"preliminaryFileName":"quankee-framework-interceptor.mjs","sourcemapFileName":"quankee-framework-interceptor.mjs.map"},{"fileName":"quankee-framework-interceptor.mjs.map","names":[],"needsCodeReference":false,"originalFileName":null,"originalFileNames":[],"source":"{\"version\":3,\"file\":\"quankee-framework-interceptor.mjs\",\"sources\":[\"../../../projects/quankee-framework-interceptor/src/lib/core/token.helper.ts\",\"../../../projects/quankee-framework-interceptor/src/lib/core/authorization.interceptor.ts\",\"../../../projects/quankee-framework-interceptor/src/public-api.ts\",\"../../../projects/quankee-framework-interceptor/src/quankee-framework-interceptor.ts\"],\"sourcesContent\":[\"export function injectAuthHeader(req: any, token: any): any {\\r\\n if (token) {\\r\\n return req.clone({\\r\\n setHeaders: {\\r\\n Authorization: `Bearer ${token}`,\\r\\n },\\r\\n });\\r\\n }\\r\\n return req;\\r\\n}\\r\\n\",\"import {HttpErrorResponse, HttpEvent, HttpHandler, HttpInterceptor, HttpRequest} from '@angular/common/http';\\r\\nimport {Injectable} from '@angular/core';\\r\\nimport {KeycloakService} from 'quankee-framework-keycloak';\\r\\nimport {catchError, Observable, throwError} from 'rxjs';\\r\\n\\r\\n@Injectable()\\r\\nexport class AuthorizationInterceptor implements HttpInterceptor {\\r\\n\\r\\n constructor(private readonly keycloakService: KeycloakService) {}\\r\\n\\r\\n intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {\\r\\n console.log('[Interceptor] Executing...');\\r\\n\\r\\n const token = this.keycloakService.getToken(); // returns string\\r\\n console.log('[Interceptor] is token found...' + token);\\r\\n let authReq = req;\\r\\n\\r\\n if (token) {\\r\\n console.log('[Interceptor] token found...' + token);\\r\\n authReq = req.clone({\\r\\n setHeaders: {\\r\\n Authorization: `Bearer ${token}`,\\r\\n },\\r\\n });\\r\\n }\\r\\n return next.handle(authReq).pipe(\\r\\n catchError((error: HttpErrorResponse) => {\\r\\n console.error('HTTP Error:', error);\\r\\n if (error.status === 401) {\\r\\n // handle unauthorized\\r\\n console.error('[Interceptor] Unauthorized.')\\r\\n }\\r\\n return throwError(() => error);\\r\\n })\\r\\n );\\r\\n }\\r\\n}\\r\\n\",\"/*\\r\\n * Public API Surface of quankee-framework-interceptor\\r\\n */\\r\\n\\r\\nexport * from './lib/core/token.helper';\\r\\nexport * from './lib/core/authorization.interceptor';\\r\\n\",\"/**\\n * Generated bundle index. Do not edit.\\n */\\n\\nexport * from './public-api';\\n\"],\"names\":[],\"mappings\":\";;;;;AAAgB,SAAA,gBAAgB,CAAC,GAAQ,EAAE,KAAU,EAAA;IACnD,IAAI,KAAK,EAAE;QACT,OAAO,GAAG,CAAC,KAAK,CAAC;AACf,YAAA,UAAU,EAAE;gBACV,aAAa,EAAE,CAAU,OAAA,EAAA,KAAK,CAAE,CAAA;AACjC,aAAA;AACF,SAAA,CAAC;;AAEJ,IAAA,OAAO,GAAG;AACZ;;MCHa,wBAAwB,CAAA;AAEN,IAAA,eAAA;AAA7B,IAAA,WAAA,CAA6B,eAAgC,EAAA;QAAhC,IAAe,CAAA,eAAA,GAAf,eAAe;;IAE5C,SAAS,CAAC,GAAqB,EAAE,IAAiB,EAAA;AAChD,QAAA,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC;QAEzC,MAAM,KAAK,GAAG,IAAI,CAAC,eAAe,CAAC,QAAQ,EAAE,CAAC;AAC9C,QAAA,OAAO,CAAC,GAAG,CAAC,iCAAiC,GAAG,KAAK,CAAC;QACtD,IAAI,OAAO,GAAG,GAAG;QAEjB,IAAI,KAAK,EAAE;AACT,YAAA,OAAO,CAAC,GAAG,CAAC,8BAA8B,GAAG,KAAK,CAAC;AACnD,YAAA,OAAO,GAAG,GAAG,CAAC,KAAK,CAAC;AAClB,gBAAA,UAAU,EAAE;oBACV,aAAa,EAAE,CAAU,OAAA,EAAA,KAAK,CAAE,CAAA;AACjC,iBAAA;AACF,aAAA,CAAC;;AAEJ,QAAA,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAC5B,UAAU,CAAC,CAAC,KAAwB,KAAI;AACtC,YAAA,OAAO,CAAC,KAAK,CAAC,aAAa,EAAE,KAAK,CAAC;AACnC,YAAA,IAAI,KAAK,CAAC,MAAM,KAAK,GAAG,EAAE;;AAExB,gBAAA,OAAO,CAAC,KAAK,CAAC,6BAA6B,CAAC;;AAE9C,YAAA,OAAO,UAAU,CAAC,MAAM,KAAK,CAAC;SAC/B,CAAC,CACL;;wGA5BQ,wBAAwB,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAA,EAAA,CAAA,eAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;4GAAxB,wBAAwB,EAAA,CAAA;;4FAAxB,wBAAwB,EAAA,UAAA,EAAA,CAAA;kBADpC;;;ACLD;;AAEG;;ACFH;;AAEG;;;;\"}","type":"asset"}]}
1
+ {"hash":"5ab25d3e05f402823fcccf0ac6fd85379dd3b7bbd07d2789cacd54340b0aa501","fesm2022":[{"exports":["AuthorizationInterceptor","injectAuthHeader"],"facadeModuleId":"C:\\usr\\local\\workspaces\\workspace-quankee\\quankee-framework\\quankee-framework-common-ts\\dist\\quankee-framework-interceptor\\esm2022\\quankee-framework-interceptor.mjs","isDynamicEntry":false,"isEntry":true,"isImplicitEntry":false,"moduleIds":["C:/usr/local/workspaces/workspace-quankee/quankee-framework/quankee-framework-common-ts/dist/quankee-framework-interceptor/esm2022/lib/core/token.helper.mjs","C:/usr/local/workspaces/workspace-quankee/quankee-framework/quankee-framework-common-ts/dist/quankee-framework-interceptor/esm2022/lib/core/authorization.interceptor.mjs","C:/usr/local/workspaces/workspace-quankee/quankee-framework/quankee-framework-common-ts/dist/quankee-framework-interceptor/esm2022/public-api.mjs","C:\\usr\\local\\workspaces\\workspace-quankee\\quankee-framework\\quankee-framework-common-ts\\dist\\quankee-framework-interceptor\\esm2022\\quankee-framework-interceptor.mjs"],"name":"quankee-framework-interceptor","type":"chunk","dynamicImports":[],"fileName":"quankee-framework-interceptor.mjs","implicitlyLoadedBefore":[],"importedBindings":{"@angular/core":["*","Injectable"],"rxjs":["from","switchMap","catchError","throwError"],"quankee-framework-keycloak":["*"]},"imports":["@angular/core","rxjs","quankee-framework-keycloak"],"modules":{"C:/usr/local/workspaces/workspace-quankee/quankee-framework/quankee-framework-common-ts/dist/quankee-framework-interceptor/esm2022/lib/core/token.helper.mjs":{"code":"function injectAuthHeader(req, token) {\n if (token) {\n return req.clone({\n setHeaders: {\n Authorization: `Bearer ${token}`,\n },\n });\n }\n return req;\n}","originalLength":1112,"removedExports":[],"renderedExports":["injectAuthHeader"],"renderedLength":210},"C:/usr/local/workspaces/workspace-quankee/quankee-framework/quankee-framework-common-ts/dist/quankee-framework-interceptor/esm2022/lib/core/authorization.interceptor.mjs":{"code":"class AuthorizationInterceptor {\n keycloakService;\n constructor(keycloakService) {\n this.keycloakService = keycloakService;\n }\n intercept(req, next) {\n console.log('[Interceptor] Executing...');\n return from(this.keycloakService.refreshToken(5)).pipe(switchMap(() => {\n const token = this.keycloakService.getToken();\n console.log('[Interceptor] is token found...' + token);\n let authReq = req;\n if (token) {\n authReq = req.clone({\n setHeaders: {\n Authorization: `Bearer ${token}`,\n },\n });\n }\n return next.handle(authReq);\n }), catchError((error) => {\n console.error('[Interceptor] HTTP Error:', error);\n if (error.status === 401) {\n console.error('[Interceptor] Unauthorized');\n }\n return throwError(() => error);\n }));\n }\n static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"19.2.14\", ngImport: i0, type: AuthorizationInterceptor, deps: [{ token: i1.KeycloakService }], target: i0.ɵɵFactoryTarget.Injectable });\n static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: \"12.0.0\", version: \"19.2.14\", ngImport: i0, type: AuthorizationInterceptor });\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"19.2.14\", ngImport: i0, type: AuthorizationInterceptor, decorators: [{\n type: Injectable\n }], ctorParameters: () => [{ type: i1.KeycloakService }] });","originalLength":5579,"removedExports":[],"renderedExports":["AuthorizationInterceptor"],"renderedLength":1570},"C:/usr/local/workspaces/workspace-quankee/quankee-framework/quankee-framework-common-ts/dist/quankee-framework-interceptor/esm2022/public-api.mjs":{"code":"/*\n * Public API Surface of quankee-framework-interceptor\n */","originalLength":755,"removedExports":[],"renderedExports":[],"renderedLength":61},"C:\\usr\\local\\workspaces\\workspace-quankee\\quankee-framework\\quankee-framework-common-ts\\dist\\quankee-framework-interceptor\\esm2022\\quankee-framework-interceptor.mjs":{"code":"/**\n * Generated bundle index. Do not edit.\n */","originalLength":572,"removedExports":[],"renderedExports":[],"renderedLength":47}},"referencedFiles":[],"code":"import * as i0 from '@angular/core';\nimport { Injectable } from '@angular/core';\nimport { from, switchMap, catchError, throwError } from 'rxjs';\nimport * as i1 from 'quankee-framework-keycloak';\n\nfunction injectAuthHeader(req, token) {\n if (token) {\n return req.clone({\n setHeaders: {\n Authorization: `Bearer ${token}`,\n },\n });\n }\n return req;\n}\n\nclass AuthorizationInterceptor {\n keycloakService;\n constructor(keycloakService) {\n this.keycloakService = keycloakService;\n }\n intercept(req, next) {\n console.log('[Interceptor] Executing...');\n return from(this.keycloakService.refreshToken(5)).pipe(switchMap(() => {\n const token = this.keycloakService.getToken();\n console.log('[Interceptor] is token found...' + token);\n let authReq = req;\n if (token) {\n authReq = req.clone({\n setHeaders: {\n Authorization: `Bearer ${token}`,\n },\n });\n }\n return next.handle(authReq);\n }), catchError((error) => {\n console.error('[Interceptor] HTTP Error:', error);\n if (error.status === 401) {\n console.error('[Interceptor] Unauthorized');\n }\n return throwError(() => error);\n }));\n }\n static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"19.2.14\", ngImport: i0, type: AuthorizationInterceptor, deps: [{ token: i1.KeycloakService }], target: i0.ɵɵFactoryTarget.Injectable });\n static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: \"12.0.0\", version: \"19.2.14\", ngImport: i0, type: AuthorizationInterceptor });\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"19.2.14\", ngImport: i0, type: AuthorizationInterceptor, decorators: [{\n type: Injectable\n }], ctorParameters: () => [{ type: i1.KeycloakService }] });\n\n/*\n * Public API Surface of quankee-framework-interceptor\n */\n\n/**\n * Generated bundle index. Do not edit.\n */\n\nexport { AuthorizationInterceptor, injectAuthHeader };\n//# sourceMappingURL=quankee-framework-interceptor.mjs.map\n","map":null,"preliminaryFileName":"quankee-framework-interceptor.mjs","sourcemapFileName":"quankee-framework-interceptor.mjs.map"},{"fileName":"quankee-framework-interceptor.mjs.map","names":[],"needsCodeReference":false,"originalFileName":null,"originalFileNames":[],"source":"{\"version\":3,\"file\":\"quankee-framework-interceptor.mjs\",\"sources\":[\"../../../projects/quankee-framework-interceptor/src/lib/core/token.helper.ts\",\"../../../projects/quankee-framework-interceptor/src/lib/core/authorization.interceptor.ts\",\"../../../projects/quankee-framework-interceptor/src/public-api.ts\",\"../../../projects/quankee-framework-interceptor/src/quankee-framework-interceptor.ts\"],\"sourcesContent\":[\"export function injectAuthHeader(req: any, token: any): any {\\r\\n if (token) {\\r\\n return req.clone({\\r\\n setHeaders: {\\r\\n Authorization: `Bearer ${token}`,\\r\\n },\\r\\n });\\r\\n }\\r\\n return req;\\r\\n}\\r\\n\",\"import {HttpErrorResponse, HttpEvent, HttpHandler, HttpInterceptor, HttpRequest} from '@angular/common/http';\\r\\nimport {Injectable} from '@angular/core';\\r\\nimport {KeycloakService} from 'quankee-framework-keycloak';\\r\\nimport {catchError, from, Observable, switchMap, throwError} from 'rxjs';\\r\\n\\r\\n@Injectable()\\r\\nexport class AuthorizationInterceptor implements HttpInterceptor {\\r\\n\\r\\n constructor(private readonly keycloakService: KeycloakService) {}\\r\\n\\r\\n intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {\\r\\n console.log('[Interceptor] Executing...');\\r\\n\\r\\n return from(this.keycloakService.refreshToken(5)).pipe(\\r\\n switchMap(() => {\\r\\n const token = this.keycloakService.getToken();\\r\\n console.log('[Interceptor] is token found...' + token);\\r\\n let authReq = req;\\r\\n\\r\\n if (token) {\\r\\n authReq = req.clone({\\r\\n setHeaders: {\\r\\n Authorization: `Bearer ${token}`,\\r\\n },\\r\\n });\\r\\n }\\r\\n\\r\\n return next.handle(authReq);\\r\\n }),\\r\\n catchError((error: HttpErrorResponse) => {\\r\\n console.error('[Interceptor] HTTP Error:', error);\\r\\n if (error.status === 401) {\\r\\n console.error('[Interceptor] Unauthorized');\\r\\n }\\r\\n return throwError(() => error);\\r\\n })\\r\\n );\\r\\n }\\r\\n}\\r\\n\\r\\n\",\"/*\\r\\n * Public API Surface of quankee-framework-interceptor\\r\\n */\\r\\n\\r\\nexport * from './lib/core/token.helper';\\r\\nexport * from './lib/core/authorization.interceptor';\\r\\n\",\"/**\\n * Generated bundle index. Do not edit.\\n */\\n\\nexport * from './public-api';\\n\"],\"names\":[],\"mappings\":\";;;;;AAAgB,SAAA,gBAAgB,CAAC,GAAQ,EAAE,KAAU,EAAA;IACnD,IAAI,KAAK,EAAE;QACT,OAAO,GAAG,CAAC,KAAK,CAAC;AACf,YAAA,UAAU,EAAE;gBACV,aAAa,EAAE,CAAU,OAAA,EAAA,KAAK,CAAE,CAAA;AACjC,aAAA;AACF,SAAA,CAAC;;AAEJ,IAAA,OAAO,GAAG;AACZ;;MCHa,wBAAwB,CAAA;AAEN,IAAA,eAAA;AAA7B,IAAA,WAAA,CAA6B,eAAgC,EAAA;QAAhC,IAAe,CAAA,eAAA,GAAf,eAAe;;IAE5C,SAAS,CAAC,GAAqB,EAAE,IAAiB,EAAA;AAChD,QAAA,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC;AAEvC,QAAA,OAAO,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAClD,SAAS,CAAC,MAAK;YACX,MAAM,KAAK,GAAG,IAAI,CAAC,eAAe,CAAC,QAAQ,EAAE;AAC7C,YAAA,OAAO,CAAC,GAAG,CAAC,iCAAiC,GAAG,KAAK,CAAC;YACtD,IAAI,OAAO,GAAG,GAAG;YAEjB,IAAI,KAAK,EAAE;AACP,gBAAA,OAAO,GAAG,GAAG,CAAC,KAAK,CAAC;AAChB,oBAAA,UAAU,EAAE;wBACR,aAAa,EAAE,CAAU,OAAA,EAAA,KAAK,CAAE,CAAA;AACnC,qBAAA;AACJ,iBAAA,CAAC;;AAGN,YAAA,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC;AAC/B,SAAC,CAAC,EACF,UAAU,CAAC,CAAC,KAAwB,KAAI;AACpC,YAAA,OAAO,CAAC,KAAK,CAAC,2BAA2B,EAAE,KAAK,CAAC;AACjD,YAAA,IAAI,KAAK,CAAC,MAAM,KAAK,GAAG,EAAE;AACtB,gBAAA,OAAO,CAAC,KAAK,CAAC,4BAA4B,CAAC;;AAE/C,YAAA,OAAO,UAAU,CAAC,MAAM,KAAK,CAAC;SACjC,CAAC,CACL;;wGA9BM,wBAAwB,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAA,EAAA,CAAA,eAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;4GAAxB,wBAAwB,EAAA,CAAA;;4FAAxB,wBAAwB,EAAA,UAAA,EAAA,CAAA;kBADpC;;;ACLD;;AAEG;;ACFH;;AAEG;;;;\"}","type":"asset"}]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "quankee-framework-common-ts",
3
3
  "description": "Quankee Framework Typescript Lib",
4
- "version": "1.4.2",
4
+ "version": "1.4.3",
5
5
  "author": {
6
6
  "email": "info@quankee.co.mz",
7
7
  "name": "Quankee Software, Lda",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "quankee-framework-interceptor",
3
3
  "description": "Quankee Framework Interceptor Lib",
4
- "version": "1.4.2",
4
+ "version": "1.4.3",
5
5
  "author": {
6
6
  "email": "info@quankee.co.mz",
7
7
  "name": "Quankee Software, Lda",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "quankee-framework-keycloak",
3
3
  "description": "Quankee Framework Keycloak Lib",
4
- "version": "1.4.2",
4
+ "version": "1.4.3",
5
5
  "author": {
6
6
  "email": "info@quankee.co.mz",
7
7
  "name": "Quankee Software, Lda",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "quankee-framework-language",
3
3
  "description": "Quankee Framework Language Lib",
4
- "version": "1.4.2",
4
+ "version": "1.4.3",
5
5
  "author": {
6
6
  "email": "info@quankee.co.mz",
7
7
  "name": "Quankee Software, Lda",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "quankee-framework-response",
3
3
  "description": "Quankee Framework Response Lib",
4
- "version": "1.4.2",
4
+ "version": "1.4.3",
5
5
  "author": {
6
6
  "email": "info@quankee.co.mz",
7
7
  "name": "Quankee Software, Lda",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "quankee-framework-user",
3
3
  "description": "Quankee Framework User Lib",
4
- "version": "1.4.2",
4
+ "version": "1.4.3",
5
5
  "author": {
6
6
  "email": "info@quankee.co.mz",
7
7
  "name": "Quankee Software, Lda",